diff --git a/CHANGELOG.md b/CHANGELOG.md index 0af5ae59..b92e923b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,19 @@ The published image tags: `latest` follows the most recent release below, ## Unreleased +**The mail list is readable beside an open message.** A row went to a single line once the list was +about 575px wide, which left the subject around 120px and its preview wrapped next to it ("Facture +pour Co…") whenever the reading pane was open, or on a large phone. A row now goes to one line only +once the list is 75rem (about 1200px) wide. Below that it is two lines — sender and subject, then +the preview across the whole row — and on a list narrower than about 575px, a phone, the three it +always was. Not less, because a one-line row in a 65rem list (the list beside the reading pane on a +2560px screen) still cut real subjects after about 30 characters. Archive, delete, snooze and the +other row actions appear on hover in two- and three-line rows too, instead of only in one-line rows. +A two-line row has no unread dot; like a one-line row it says unread with a bold sender and subject. +Also fixed: with the two-line preview setting on, a one-line row wrapped its preview anyway. No +setting; no migration. +[#62](https://github.com/karatektus/pl_mail/pull/62), by @Flouss. + **Each inbox tab shows how many conversations in it are unread.** The number is the sidebar's Inbox badge split by category, so the tabs add up to it, and it appears on every tab, the one you are on included, and updates in place on sync. Before, an unread conversation in Promotions made diff --git a/DESIGN.md b/DESIGN.md index 6f009c7f..4f8c8272 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -582,8 +582,8 @@ at the right. It has three positions (mail, split, calendar), and the split need - **Below 768px** the sidebar becomes a drawer, compose goes full-screen, and search collapses to an icon that opens a full-width row under the top bar. - **Container queries, not viewport queries,** for anything inside a pane. A mail row switches - between stacked and single-line on the *list's* width (`@xl`, 36rem), because a docked calendar can - make the list narrower than a phone. + between three lines, two and one on the *list's* width (`@xl`, 36rem, and `@rowwide`, 75rem), + because a docked calendar can make the list narrower than a phone. - **Nothing scrolls the page sideways.** Panes scroll their own overflow. The shell uses `dvh` and honours safe-area insets. - **Design at German length, at 320px wide, and at text scale 1.25.** @@ -705,7 +705,8 @@ The row is the product. Keep it quiet. - A **36px avatar disc** that doubles as the checkbox. It turns into an accent disc with a tick on hover or when checked. - **Sender, subject, snippet, chips, time.** In a wide list they share one line, subject and snippet - together. In a narrow one they stack, and the snippet clamps to the user's 0–2 lines. + together. In a middling one sender and subject share the first line and the snippet takes the + second. In a narrow one they stack. Below one line the snippet clamps to the user's 0–2 lines. - **The row** is `flex items-center gap-3 pl-3 pr-4 list-row-y`. Its padding comes from the density variable, never `py-*`. - **Unread:** sender and subject `font-semibold text-ink`, plus a faint white wash (`row-unread`, diff --git a/assets/styles/app.css b/assets/styles/app.css index e9a333d2..a422ce89 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -5078,6 +5078,36 @@ label:has(> input.sr-only) { preview in the settings pane is styled by these same rules rather than by a copy of them that could drift. */ +/* + Where a list row stops being three stacked lines and becomes one. + + This was Tailwind's stock `@xl` (36rem), and it was too early: one line has to + carry the avatar, a 10rem sender column and a 9rem date/actions column before + the subject and preview get a single pixel, so a list with the reading pane + open (about 45rem) left them ~260px between them — "Facture pour Co…" and a + preview wrapped to two cramped lines. Stacked gives them the full width, and + it is already the layout a phone gets. One line pays off only when there is + room for it. 58rem was the first guess and still too early for real mail: a + list of about 65rem (a 2560px window with the reading pane open) cut a + subject like "Votre Colis N°8373 Nécessite Une Vérification" after ~30 + characters and the preview after ~35. Measured by sweeping the list width + with long French and English subjects: at 75rem both the subject and a + usable preview fit; wider only adds preview. `@rowwide:` in + _thread_row.html.twig is this token, and so is the `@container` rule below, + which reads it through `theme()` rather than repeating the number. + + Below it the row is not three lines everywhere. From `@xl` (36rem) up to this + token it is two — sender and subject on the first, the preview on the second + — because three lines in a list 60rem wide spent a line on a sender name + with most of the row empty beside it. That band is `@xl:@max-rowwide:` in the + row template and needs no rule here: the preview clamp below treats it like + the three-line row, which is what it should do, since the preview has a + line of its own in both. +*/ +@theme { + --container-rowwide: 75rem; +} + /* The account corner: the coloured triangle in a row's lower-left. */ [data-account-corner] { display: var(--list-corner-display); @@ -5134,8 +5164,13 @@ label:has(> input.sr-only) { arrangement the wide layout exists to avoid. So the wide branch takes the same on/off switch without the clamp. - `@container`, matching the row's own `@xl` (Tailwind's 36rem container - width, written out by hand because a plain rule cannot use the variant): the + `@container`, matching the row's own `@rowwide` (the 75rem container width + declared by --container-rowwide in the "Mail list display" block above). A + plain rule cannot use the variant, and a custom property means nothing inside + a query, so the number comes through `theme()`, which Tailwind resolves at + build time. It was written out by hand once, with a comment asking for the + two to be changed together, which is the kind of promise that gets kept + until it does not: the row switches on the LIST's width, not the viewport's — the list is narrower than a phone whenever the calendar pane is docked wide. */ @@ -5145,7 +5180,9 @@ label:has(> input.sr-only) { badge saying when it goes has already eaten the line, and what is left of the snippet at 393px is two characters and an ellipsis. These rules are unlayered and would otherwise beat that `.hidden` and put the fragment back. - Wide, where the row shows both, there is nothing to exempt. + From `@xl` up, where the row shows both, the element still carries + `.hidden`, so it stays out of this rule and its one line is Tailwind's + `truncate`. */ [data-row-snippet]:not(.hidden) { display: var(--list-preview-display); @@ -5155,8 +5192,13 @@ label:has(> input.sr-only) { overflow: hidden; } -@container (min-width: 36rem) { - [data-row-snippet] { +@container (min-width: theme(--container-rowwide)) { + /* `:not(.hidden)` for SPECIFICITY, not for the exemption above: a container + query adds none, so a bare `[data-row-snippet]` (0,1,0) lost to the + stacked rule's `[data-row-snippet]:not(.hidden)` (0,2,0) and the + "wide is always one line" override never applied — with the two-line + setting on, a one-line row wrapped its preview anyway. */ + [data-row-snippet]:not(.hidden) { display: var(--list-preview-display-wide); -webkit-line-clamp: 1; white-space: nowrap; diff --git a/templates/_partials/_thread_row.html.twig b/templates/_partials/_thread_row.html.twig index 6769f9e8..55b15236 100644 --- a/templates/_partials/_thread_row.html.twig +++ b/templates/_partials/_thread_row.html.twig @@ -361,7 +361,7 @@ be a worse regression than the one this feature fixes. move, not a restyle. What it buys is that both are now custom properties, which is what lets the density differ per surface and the unread tint scale with the emphasis setting. #} - class="pointer-events-auto flex items-center @xl:items-center gap-3 pl-3 pr-4 list-row-y cursor-pointer transition-colors + class="pointer-events-auto flex items-center @rowwide:items-center gap-3 pl-3 pr-4 list-row-y cursor-pointer transition-colors {{ unread ? 'row-unread' : 'bg-transparent' }} hover:bg-white/60 dark:hover:bg-white/[0.06]" > @@ -404,12 +404,31 @@ be a worse regression than the one this feature fixes. aria-hidden="true"> - {# Content — one line when the list is wide, three when it is not #} -