From c37d26ae49d4f17250e145f056c07ba7018bec1e Mon Sep 17 00:00:00 2001 From: greta Date: Tue, 10 Dec 2024 16:56:18 +0100 Subject: [PATCH] fixup! feat: make multiselect menu more discoverable Signed-off-by: greta --- src/components/Envelope.vue | 12 +++-- src/components/EnvelopeList.vue | 89 +++++++++++++++++++++++---------- 2 files changed, 71 insertions(+), 30 deletions(-) diff --git a/src/components/Envelope.vue b/src/components/Envelope.vue index 298fd533eb..3af92df93b 100644 --- a/src/components/Envelope.vue +++ b/src/components/Envelope.vue @@ -43,7 +43,8 @@ :class="{ 'one-line': oneLineLayout, 'junk-icon-style': !oneLineLayout }" :data-starred="data.flags.$junk ? 'true' : 'false'" @click.prevent="hasWriteAcl ? onToggleJunk() : false" /> -
@@ -1123,13 +1124,18 @@ export default { 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; + } } -.check-icon { - color: var(--color-primary-light); +.hover-active { &:hover { color: var(--color-primary-hover); background-color: var(--color-primary-light-hover); border-radius: 32px; } } + diff --git a/src/components/EnvelopeList.vue b/src/components/EnvelopeList.vue index 474eb07c41..f8bc3e3b92 100644 --- a/src/components/EnvelopeList.vue +++ b/src/components/EnvelopeList.vue @@ -7,13 +7,18 @@
- - - + + + + + + - - - + + + + + + 0 }, - areAllSelectedRead() { - // returns false if at least one selected message has not been read yet - return this.selectedEnvelopes.every((env) => env.flags.seen === true) + isAtLeastOneSelectedRead() { + return this.selectedEnvelopes.some((env) => env.flags.seen === true) + }, + isAtLeastOneSelectedUnread() { + return this.selectedEnvelopes.some((env) => env.flags.seen === false) }, isAtLeastOneSelectedImportant() { // returns true if at least one selected message is marked as important @@ -270,9 +282,11 @@ export default { return !env.flags.$junk }) }, - areAllSelectedFavorite() { - // returns false if at least one selected message has not been favorited yet - return this.selectedEnvelopes.every((env) => env.flags.flagged === true) + isAtLeastOneSelectedFavorite() { + return this.selectedEnvelopes.some((env) => env.flags.flagged) + }, + isAtLeastOneSelectedUnFavorite() { + return this.selectedEnvelopes.some((env) => !env.flags.flagged) }, selectedEnvelopes() { return this.sortedEnvelops.filter((env) => this.selection.includes(env.databaseId)) @@ -307,12 +321,20 @@ export default { return this.selection.includes(idx) }, - markSelectedSeenOrUnseen() { - const seen = !this.areAllSelectedRead + markSelectedRead() { this.selectedEnvelopes.forEach((envelope) => { this.$store.dispatch('toggleEnvelopeSeen', { envelope, - seen, + seen: true, + }) + }) + this.unselectAll() + }, + markSelectedUnread() { + this.selectedEnvelopes.forEach((envelope) => { + this.$store.dispatch('toggleEnvelopeSeen', { + envelope, + seen: false, }) }) this.unselectAll() @@ -357,8 +379,18 @@ export default { } this.unselectAll() }, - favoriteOrUnfavoriteAll() { - const favFlag = !this.areAllSelectedFavorite + favoriteAll() { + const favFlag = !this.isAtLeastOneSelectedFavorite + this.selectedEnvelopes.forEach((envelope) => { + this.$store.dispatch('markEnvelopeFavoriteOrUnfavorite', { + envelope, + favFlag, + }) + }) + this.unselectAll() + }, + unFavoriteAll() { + const favFlag = !this.isAtLeastOneSelectedUnFavorite this.selectedEnvelopes.forEach((envelope) => { this.$store.dispatch('markEnvelopeFavoriteOrUnfavorite', { envelope, @@ -529,6 +561,9 @@ div { top: 0px; height: 48px; z-index: 100; + .action-buttons { + display: flex; + } } #load-more-mail-messages { @@ -568,7 +603,7 @@ div { display: block; } } -.action-buttons { - display: flex; +:deep(.button-vue--text-only) { + padding: 0 !important; }