feat: add extra-compact density option and fix font size scaling
- Add 'extra-compact' density level that hides avatars and preview text, showing only sender and subject for maximum information density - Add visual density preview in appearance settings showing a 3-row email list mockup that reflects each density option - Fix global font size setting only changing line height by moving font-size from body to :root so rem-based Tailwind classes scale - Apply extra-compact behavior to email list items, thread list items, thread email items, and thread conversation view (EmailCard) - Update email list virtualizer size estimates for extra-compact - Add extra-compact translations for all 8 locales
This commit is contained in:
@@ -221,6 +221,7 @@ function EmailCard({
|
||||
}: EmailCardProps) {
|
||||
const t = useTranslations();
|
||||
const resolvedTheme = useThemeStore((state) => state.resolvedTheme);
|
||||
const density = useSettingsStore((state) => state.density);
|
||||
const sender = email.from?.[0];
|
||||
const isUnread = !email.keywords?.$seen;
|
||||
const isStarred = email.keywords?.$flagged;
|
||||
@@ -428,12 +429,14 @@ function EmailCard({
|
||||
)}
|
||||
style={{ gap: 'var(--density-item-gap)', padding: 'var(--density-card-p)' }}
|
||||
>
|
||||
<Avatar
|
||||
name={sender?.name}
|
||||
email={sender?.email}
|
||||
size="md"
|
||||
className="flex-shrink-0"
|
||||
/>
|
||||
{density !== 'extra-compact' && (
|
||||
<Avatar
|
||||
name={sender?.name}
|
||||
email={sender?.email}
|
||||
size="md"
|
||||
className="flex-shrink-0"
|
||||
/>
|
||||
)}
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2 mb-0.5">
|
||||
<span className={cn(
|
||||
@@ -452,7 +455,7 @@ function EmailCard({
|
||||
<div className="text-sm text-muted-foreground">
|
||||
{formatDate(email.receivedAt)}
|
||||
</div>
|
||||
{!isExpanded && (
|
||||
{!isExpanded && density !== 'extra-compact' && (
|
||||
<p className="text-sm text-muted-foreground mt-1 line-clamp-2">
|
||||
{email.preview || "No preview available"}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user