From e5ef5ee9bf5434d0d696dd68f55bb2f630a5a3a1 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 28 Oct 2026 05:48:50 +0100 Subject: [PATCH] fix: use the same icons for the same actions in Mail: Refresh, Back, Edit, Compose, More and the amber star --- components/email/__tests__/mail-rtl.test.ts | 17 +++++++++++ components/email/email-context-menu.tsx | 6 ++-- components/email/email-viewer.tsx | 31 +++++++++++---------- components/email/mv-list-toolbar.tsx | 4 +-- components/email/reader-plugin-surfaces.tsx | 4 +-- components/mail/mail-app.tsx | 8 +++--- 6 files changed, 44 insertions(+), 26 deletions(-) diff --git a/components/email/__tests__/mail-rtl.test.ts b/components/email/__tests__/mail-rtl.test.ts index d3a07fb0f..d1112a868 100644 --- a/components/email/__tests__/mail-rtl.test.ts +++ b/components/email/__tests__/mail-rtl.test.ts @@ -36,3 +36,20 @@ describe('Mail in right-to-left languages', () => { expect(source.match(/\{subjectSnippet/g)).toHaveLength(4); }); }); + +// R2: one icon per action. Edit is Pencil, Compose PenSquare, Refresh +// RefreshCw (RotateCcw means reset or undo), the star amber. +describe('Mail icons', () => { + const iconFiles = [ + 'components/mail/mail-app.tsx', + 'components/email/email-viewer.tsx', + 'components/email/email-context-menu.tsx', + 'components/email/mv-list-toolbar.tsx', + 'components/email/reader-plugin-surfaces.tsx', + ]; + it.each(iconFiles)('%s uses the agreed icons', (file) => { + const code = read(file); + expect(code).not.toMatch(/\bEditIcon\b|\bPenLine\b|yellow-400|icon=\{RotateCcw\}| handleAction(onCancelScheduledForEdit!)} disabled={!onCancelScheduledForEdit} @@ -595,7 +595,7 @@ export function EmailContextMenu({ {!isScheduled && !showBatchActions && isDraft && onEditDraft && ( <> handleAction(onEditDraft)} /> diff --git a/components/email/email-viewer.tsx b/components/email/email-viewer.tsx index a6407bfba..c100e6085 100644 --- a/components/email/email-viewer.tsx +++ b/components/email/email-viewer.tsx @@ -91,7 +91,6 @@ import { Sun, Upload, Moon, - EditIcon, PlayCircle, PenSquare, CalendarClock, @@ -100,6 +99,8 @@ import { Maximize2, Minimize2, Filter, + ArrowLeft, + Pencil, } from "@/components/icons"; import { useTranslations } from "next-intl"; import { useRouter } from "@/i18n/navigation"; @@ -547,7 +548,7 @@ export function ContactSidebarPanel({ className="flex-1 min-w-0 gap-2" title={t('contact_sidebar.action_edit_title')} > - + {tCommon('edit')} )} @@ -3807,7 +3808,7 @@ export function EmailViewer({ className="h-9 w-9 flex-shrink-0 -ms-1" aria-label={t('back_to_list')} > - + )} {showBackButton && mvMobileViewer && ( @@ -3861,7 +3862,7 @@ export function EmailViewer({ {showToolbarLabels && {t('reschedule_send')}} {onCancelScheduledSend && !email.isSmimeScheduled && ( @@ -3881,7 +3882,7 @@ export function EmailViewer({ className="sm:flex sm:flex-row sm:h-8 sm:gap-1.5 sm:py-0" title={t('tooltips.edit_draft')} > - + {t('edit_draft')} )} @@ -4036,12 +4037,12 @@ export function EmailViewer({ "flex-col items-center gap-0.5 h-auto py-1.5 px-2 sm:flex-row sm:h-8 sm:gap-1.5 sm:py-0", mvViewer ? "order-2" - : isInJunkFolder ? "hover:bg-green-50 dark:hover:bg-green-950/30" : "hover:bg-red-50 dark:hover:bg-red-950/30" + : isInJunkFolder ? "hover:bg-emerald-50 dark:hover:bg-emerald-950/30" : "hover:bg-red-50 dark:hover:bg-red-950/30" )} title={isInJunkFolder ? t('spam.not_spam_title') : t('spam.button_title')} > {isInJunkFolder ? ( - + ) : ( )} @@ -4170,7 +4171,7 @@ export function EmailViewer({ onClick={() => { onToggleStar?.(); setMoreMenuOpen(false); setMoreMenuSub(null); }} className="w-full px-3 py-1.5 text-sm text-start hover:bg-muted text-foreground flex items-center gap-2" > - + {isStarred ? t('tooltips.unstar') : t('tooltips.star')} {/* Overflow: reply */} @@ -4328,7 +4329,7 @@ export function EmailViewer({ className={cn("w-full px-3 py-1.5 text-sm text-start hover:bg-muted text-foreground flex items-center gap-2", hiddenPriorities.has(7) ? "" : "sm:hidden")} > {isInJunkFolder ? ( - + ) : ( )} @@ -4538,7 +4539,7 @@ export function EmailViewer({ onClick={leaveMoreMenuSub} className="flex items-center gap-1 -ms-2 px-2 py-1 rounded hover:bg-muted text-sm font-semibold text-foreground" > - + {moreMenuSub === 'move' ? t('move_to') : moreMenuSub === 'rules' ? tContextMenu('rules.title') : t('tag')} ) : ( @@ -4564,7 +4565,7 @@ export function EmailViewer({ onClick={() => { onToggleStar?.(); setMoreMenuOpen(false); }} className="w-full px-4 py-3 min-h-[44px] text-sm text-start hover:bg-muted text-foreground flex items-center gap-3" > - + {isStarred ? t('tooltips.unstar') : t('tooltips.star')} {/* Move to folder (opens sub-view). The toolbar's own Move button @@ -4752,7 +4753,7 @@ export function EmailViewer({ className="h-11 w-11 lg:h-10 lg:w-10 flex-shrink-0 -ms-2" aria-label={t('back_to_list')} > - + )}
@@ -4779,7 +4780,7 @@ export function EmailViewer({ > )} @@ -5697,7 +5698,7 @@ export function EmailViewer({ {t('reschedule_send')} {onCancelScheduledSend && !email.isSmimeScheduled && ( @@ -6438,7 +6439,7 @@ export function EmailViewer({ className="flex flex-col items-center justify-center gap-1 py-2 px-1 min-h-[44px] grow shrink-0 basis-[64px] text-primary active:text-primary/80 transition-colors duration-150" aria-label={t('tooltips.edit_draft')} > - + {t('edit_draft')} ) : ( diff --git a/components/email/mv-list-toolbar.tsx b/components/email/mv-list-toolbar.tsx index c07962676..6f5c24336 100644 --- a/components/email/mv-list-toolbar.tsx +++ b/components/email/mv-list-toolbar.tsx @@ -11,13 +11,13 @@ import { Mail, MailOpen, MoreVertical, - RotateCcw, Search, ShieldAlert, ShieldCheck, Square, Tag, Trash2, + RefreshCw, } from "@/components/icons"; import { useTranslations } from "next-intl"; import { useAuthStore } from "@/stores/auth-store"; @@ -425,7 +425,7 @@ export function MvListToolbar({ openContextMenu(e, true)} > - + - + {tCommon('reconnecting')}
)} @@ -5036,7 +5036,7 @@ export function MailApp({ linkSegments: routeSegments }: MailAppProps = {}) { title={tCommon("refresh")} aria-label={tCommon("refresh")} > - + {/* The folder's actions, as the Mountain View list ⋮ has them. */} - +
{t('email_composer.continue_draft')} {pendingDraft.subject && (