From 838de8e5da70e30f569918e50d8e0ae7589c7bc4 Mon Sep 17 00:00:00 2001 From: Linus Rath Date: Sat, 14 Mar 2026 18:35:43 +0100 Subject: [PATCH] fix: make density setting functional across entire UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename "List Density" to "Density" and apply spacing changes globally instead of only to email list item heights. - Replace hardcoded padding/gap values with CSS custom properties (--density-item-py, --density-item-gap, --density-header-py, --density-card-p, --density-sidebar-py) set via JS on :root - Apply density-responsive spacing to email list items, thread views, email viewer, sidebar, navigation rail, contacts, and calendar - Use inline styles instead of Tailwind arbitrary value classes to avoid Turbopack compilation hangs - Rename listDensity → density in store, types, and components - Add persist migration (v1 → v2) and onRehydrateStorage callback - Update all 8 locale files with broadened labels/descriptions --- app/globals.css | 7 ++ components/calendar/calendar-agenda-view.tsx | 3 +- components/contacts/contact-group-list.tsx | 3 +- components/contacts/contact-list-item.tsx | 3 +- components/contacts/contact-list.tsx | 3 +- components/email/email-list-item.tsx | 2 +- components/email/email-list.tsx | 10 +-- components/email/email-viewer.tsx | 10 +-- components/email/thread-conversation-view.tsx | 9 ++- components/email/thread-email-item.tsx | 3 +- components/email/thread-list-item.tsx | 4 +- components/layout/navigation-rail.tsx | 3 +- components/layout/sidebar.tsx | 24 +++--- components/settings/appearance-settings.tsx | 8 +- locales/de/common.json | 4 +- locales/en/common.json | 4 +- locales/es/common.json | 4 +- locales/fr/common.json | 4 +- locales/it/common.json | 4 +- locales/ja/common.json | 4 +- locales/nl/common.json | 4 +- locales/pt/common.json | 4 +- stores/settings-store.ts | 79 +++++++++++++++---- 23 files changed, 133 insertions(+), 70 deletions(-) diff --git a/app/globals.css b/app/globals.css index c19fec0d..4386b06e 100644 --- a/app/globals.css +++ b/app/globals.css @@ -23,6 +23,13 @@ --font-size-base: 16px; --list-item-height: 48px; --transition-duration: 0.2s; + + /* Density spacing variables (defaults = regular) */ + --density-item-py: 12px; + --density-item-gap: 12px; + --density-header-py: 12px; + --density-card-p: 16px; + --density-sidebar-py: 4px; } .dark { diff --git a/components/calendar/calendar-agenda-view.tsx b/components/calendar/calendar-agenda-view.tsx index e8b3f6ee..74f5801d 100644 --- a/components/calendar/calendar-agenda-view.tsx +++ b/components/calendar/calendar-agenda-view.tsx @@ -146,7 +146,8 @@ export function CalendarAgendaView({ onClick={(e) => onSelectEvent(ev, e.currentTarget.getBoundingClientRect())} onMouseEnter={(e) => onHoverEvent?.(ev, e.currentTarget.getBoundingClientRect())} onMouseLeave={() => onHoverLeave?.()} - className="w-full flex items-start gap-3 px-4 py-3 hover:bg-muted/50 transition-colors text-left" + className="w-full flex items-start px-4 hover:bg-muted/50 transition-colors text-left" + style={{ gap: 'var(--density-item-gap)', paddingBlock: 'var(--density-item-py)' }} >
{ev.showWithoutTime ? ( diff --git a/components/contacts/contact-group-list.tsx b/components/contacts/contact-group-list.tsx index 7714cdc1..0c3127b1 100644 --- a/components/contacts/contact-group-list.tsx +++ b/components/contacts/contact-group-list.tsx @@ -69,10 +69,11 @@ export function ContactGroupList({ key={group.id} onClick={() => onSelectGroup(group.id)} className={cn( - "w-full flex items-center gap-3 px-4 py-3 text-left transition-colors", + "w-full flex items-center px-4 text-left transition-colors", "hover:bg-muted", group.id === selectedGroupId && "bg-accent text-accent-foreground" )} + style={{ gap: 'var(--density-item-gap)', paddingBlock: 'var(--density-item-py)' }} >
diff --git a/components/contacts/contact-list-item.tsx b/components/contacts/contact-list-item.tsx index 9e95d609..e87ce17a 100644 --- a/components/contacts/contact-list-item.tsx +++ b/components/contacts/contact-list-item.tsx @@ -22,10 +22,11 @@ export function ContactListItem({ contact, isSelected, onClick }: ContactListIte