Skip to content

Commit

Permalink
feat: make multiselect menu more discoverable
Browse files Browse the repository at this point in the history
Signed-off-by: greta <[email protected]>
  • Loading branch information
GretaD committed Dec 10, 2024
1 parent 93f6d65 commit 085af79
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 226 deletions.
50 changes: 30 additions & 20 deletions src/components/Envelope.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@
:class="{ 'one-line': oneLineLayout, 'junk-icon-style': !oneLineLayout }"
:data-starred="data.flags.$junk ? 'true' : 'false'"
@click.prevent="hasWriteAcl ? onToggleJunk() : false" />
<div class="app-content-list-item-icon">
<Avatar :display-name="addresses" :email="avatarEmail" />
<p v-if="selectMode" class="app-content-list-item-select-checkbox">
<input :id="`select-checkbox-${data.uid}`"
class="checkbox"
type="checkbox"
:checked="selected">
<label :for="`select-checkbox-${data.uid}`"
@click.exact.prevent="toggleSelected"
@click.shift.exact.prevent="onSelectMultiple" />
</p>
<div class="hovering-status"
:class="{ 'hover-active': hoveringAvatar && !selected }"
@mouseenter="hoveringAvatar = true"
@mouseleave="hoveringAvatar = false"
@click.stop.prevent="toggleSelected">
<template v-if="hoveringAvatar || selected">
<CheckIcon :size="40" class="check-icon" :class="{ 'app-content-list-item-avatar-selected': selected }" />
</template>
<template v-else>
<Avatar :display-name="addresses" :email="avatarEmail" />
</template>
</div>
</template>
<template #subname>
Expand Down Expand Up @@ -152,15 +152,6 @@
data.flags.$junk ? t('mail', 'Mark not spam') : t('mail', 'Mark as spam')
}}
</ActionButton>
<ActionButton :close-after-click="true"
@click.prevent="toggleSelected">
<template #icon>
<CheckIcon :size="16" />
</template>
{{
selected ? t('mail', 'Unselect') : t('mail', 'Select')
}}
</ActionButton>
<ActionButton v-if="hasWriteAcl"
:close-after-click="true"
@click.prevent="onOpenTagModal">
Expand Down Expand Up @@ -477,6 +468,7 @@ export default {
snoozeOptions: false,
customSnoozeDateTime: new Date(moment().add(2, 'hours').minute(0).second(0).valueOf()),
overwriteOneLineMobile: false,
hoveringAvatar: false,
}
},
mounted() {
Expand Down Expand Up @@ -1128,4 +1120,22 @@ export default {
text-overflow: ellipsis;
overflow: hidden;
}
.app-content-list-item-avatar-selected {
background-color: var(--color-primary-element);
color: var(--color-primary-light);
border-radius: 32px;
&:hover {
background-color: var(--color-primary-element);
color: var(--color-primary-light);
border-radius: 32px;
}
}
.hover-active {
&:hover {
color: var(--color-primary-hover);
background-color: var(--color-primary-light-hover);
border-radius: 32px;
}
}

</style>
Loading

0 comments on commit 085af79

Please sign in to comment.