From 0d96d8d044d854f357529fc2f2479f3cd934a239 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 15 Oct 2026 04:08:33 +0200 Subject: [PATCH] fix: fit every selection action and the count in the mail list header on a phone --- src/screens/EmailListScreen.tsx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/screens/EmailListScreen.tsx b/src/screens/EmailListScreen.tsx index 289cc99c..11a1ea85 100644 --- a/src/screens/EmailListScreen.tsx +++ b/src/screens/EmailListScreen.tsx @@ -388,7 +388,8 @@ export default function EmailListScreen({ const resolvedTheme = useResolvedTheme(); // The undo bar floats over the list's bottom right on a phone (on a split // layout it sits over the reading pane instead). - const { isSplit, shortHeight } = useLayout(); + const { isSplit, shortHeight, widthClass } = useLayout(); + const selectionCountOnly = isSplit || widthClass === 'compact'; const listUndo = useEmailStore((s) => s.pendingUndo != null); const sendUndo = useSendUndoStore((s) => s.pending != null); const undoBarUp = !isSplit && (listUndo || sendUndo); @@ -588,6 +589,7 @@ export default function EmailListScreen({ // Selection state const [selectedIds, setSelectedIds] = React.useState>(new Set()); const selectionMode = selectedIds.size > 0; + const selectedLabel = t('email_list.batch_actions.selected_messages', '{count, plural, one {1 email} other {# emails}} selected', { count: selectedIds.size }); const allSelected = visibleEmails.length > 0 && visibleEmails.every((e) => selectedIds.has(rowKeyOf(e))); @@ -1154,7 +1156,9 @@ export default function EmailListScreen({ {/* Header */} {selectionMode ? ( - + // Keyed apart from the normal header: reused in place, its title + // kept the "1 email selected" label for screen readers. + - - {t('email_list.batch_actions.selected_messages', '{count, plural, one {1 email} other {# emails}} selected', { count: selectedIds.size })} + {/* Beside seven buttons a phone or the list pane has room for the + number only; the full label wrapped to three lines there. */} + + {selectionCountOnly ? String(selectedIds.size) : selectedLabel} reportFailure(handleBulkStar())} @@ -1249,7 +1259,7 @@ export default function EmailListScreen({ ) : ( - + {!sidebarDocked && ( setDrawerOpen(true)} @@ -1954,6 +1964,10 @@ function makeStyles(c: ThemePalette) { borderBottomColor: c.border, gap: spacing.md, }, + // Eight 44 dp buttons fit a 412 dp phone only without the header's gaps; + // Delete was pushed off the screen. + selectionHeader: { gap: 0, paddingHorizontal: spacing.sm }, + selectionCount: { flex: 1, minWidth: 24, marginHorizontal: spacing.xs }, headerButton: { width: componentSizes.buttonLg, height: componentSizes.buttonLg, // h-11 w-11 = 44px alignItems: 'center', justifyContent: 'center',