From b92e42db82d89f30734357fdec1125753cd3c0d6 Mon Sep 17 00:00:00 2001 From: John Coffey Date: Fri, 13 Nov 2026 10:59:15 -0700 Subject: [PATCH] Message header: room for the sender on a phone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On a phone the date and the three buttons beside it never shrank, so the sender's column was squeezed to a few dozen pixels: a long name or address ran under the date, and the recipients line had room only for "to …". On a phone the header now shows the short date that a collapsed message shows (the full one is in the title and the details), and drops the Reply button, which is under the thread and in the ⋮ menu. At any width a long name wraps inside its column and the address keeps to one line with an ellipsis. "me" in the recipients line was never translated; it now has a key in all ten catalogs. Fixes #89 --- web/src/locales/de.ts | 2 ++ web/src/locales/es.ts | 2 ++ web/src/locales/fr.ts | 2 ++ web/src/locales/ja.ts | 2 ++ web/src/locales/nl.ts | 2 ++ web/src/locales/pt-BR.ts | 2 ++ web/src/locales/ru.ts | 2 ++ web/src/locales/tr.ts | 2 ++ web/src/locales/uk.ts | 2 ++ web/src/locales/zh-Hans.ts | 2 ++ web/src/styles/app.css | 10 +++++++++- web/src/views/mail/MessageView.tsx | 10 +++++++--- 12 files changed, 36 insertions(+), 4 deletions(-) diff --git a/web/src/locales/de.ts b/web/src/locales/de.ts index 99c35bf..e0f45a5 100644 --- a/web/src/locales/de.ts +++ b/web/src/locales/de.ts @@ -512,6 +512,8 @@ export const catalog: Catalog = { "Normal": "Normal", "Low": "Niedrig", "to {recipients}": "an {recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "mich", "From: {sender}": "Von: {sender}", "Waiting on the server — goes out {when}.": "Wartet auf dem Server — geht {when} raus.", "Scheduled — click to clear the schedule": "Geplant — zum Aufheben klicken", diff --git a/web/src/locales/es.ts b/web/src/locales/es.ts index 956f84d..6de4160 100644 --- a/web/src/locales/es.ts +++ b/web/src/locales/es.ts @@ -504,6 +504,8 @@ export const catalog: Catalog = { "Normal": "Normal", "Low": "Baja", "to {recipients}": "para {recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "mí", "From: {sender}": "De: {sender}", "Waiting on the server — goes out {when}.": "Esperando en el servidor: se enviará {when}.", "Scheduled — click to clear the schedule": "Programado: haga clic para anular la programación", diff --git a/web/src/locales/fr.ts b/web/src/locales/fr.ts index 43f3995..7cf5675 100644 --- a/web/src/locales/fr.ts +++ b/web/src/locales/fr.ts @@ -509,6 +509,8 @@ export const catalog: Catalog = { "Normal": "Normale", "Low": "Basse", "to {recipients}": "à {recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "moi", "From: {sender}": "De : {sender}", "Waiting on the server — goes out {when}.": "En attente sur le serveur — envoi {when}.", "Scheduled — click to clear the schedule": "Programmé — cliquez pour annuler la programmation", diff --git a/web/src/locales/ja.ts b/web/src/locales/ja.ts index 40ab537..58f16ce 100644 --- a/web/src/locales/ja.ts +++ b/web/src/locales/ja.ts @@ -503,6 +503,8 @@ export const catalog: Catalog = { "Normal": "標準", "Low": "低", "to {recipients}": "宛先: {recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "自分", "From: {sender}": "差出人: {sender}", "Waiting on the server — goes out {when}.": "サーバーで待機中です。{when} に送信されます。", "Scheduled — click to clear the schedule": "予約済み — クリックすると予約を解除します", diff --git a/web/src/locales/nl.ts b/web/src/locales/nl.ts index 040e4a7..a9780e2 100644 --- a/web/src/locales/nl.ts +++ b/web/src/locales/nl.ts @@ -503,6 +503,8 @@ export const catalog: Catalog = { "Normal": "Normaal", "Low": "Laag", "to {recipients}": "aan {recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "mij", "From: {sender}": "Van: {sender}", "Waiting on the server — goes out {when}.": "Wacht op de server — wordt {when} verzonden.", "Scheduled — click to clear the schedule": "Gepland — klik om de planning te wissen", diff --git a/web/src/locales/pt-BR.ts b/web/src/locales/pt-BR.ts index b688aad..4c7adf6 100644 --- a/web/src/locales/pt-BR.ts +++ b/web/src/locales/pt-BR.ts @@ -507,6 +507,8 @@ export const catalog: Catalog = { "Normal": "Normal", "Low": "Baixa", "to {recipients}": "para {recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "mim", "From: {sender}": "De: {sender}", "Waiting on the server — goes out {when}.": "Aguardando no servidor — será enviada {when}.", "Scheduled — click to clear the schedule": "Programada — clique para cancelar a programação", diff --git a/web/src/locales/ru.ts b/web/src/locales/ru.ts index a02bf95..b8c2617 100644 --- a/web/src/locales/ru.ts +++ b/web/src/locales/ru.ts @@ -506,6 +506,8 @@ export const catalog: Catalog = { "Normal": "Обычный", "Low": "Низкий", "to {recipients}": "кому: {recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "мне", "From: {sender}": "От: {sender}", "Waiting on the server — goes out {when}.": "Ожидает на сервере — будет отправлено {when}.", "Scheduled — click to clear the schedule": "Отложено — нажмите, чтобы отменить", diff --git a/web/src/locales/tr.ts b/web/src/locales/tr.ts index 61f6d61..a423a5a 100644 --- a/web/src/locales/tr.ts +++ b/web/src/locales/tr.ts @@ -1548,6 +1548,8 @@ export const catalog: Catalog = { "this view": "bu görünüm", "to": "kime", "to {recipients}": "alıcı: {recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "ben", "users": "kullanıcılar", "vCard": "vCard", "vCard attachment": "vCard eki", diff --git a/web/src/locales/uk.ts b/web/src/locales/uk.ts index 59a3fe2..dc176c9 100644 --- a/web/src/locales/uk.ts +++ b/web/src/locales/uk.ts @@ -500,6 +500,8 @@ export const catalog: Catalog = { "Normal": "Звичайний", "Low": "Низький", "to {recipients}": "кому: {recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "мені", "From: {sender}": "Від: {sender}", "Waiting on the server — goes out {when}.": "Очікує на сервері — буде надіслано {when}.", "Scheduled — click to clear the schedule": "Заплановано — натисніть, щоб скасувати", diff --git a/web/src/locales/zh-Hans.ts b/web/src/locales/zh-Hans.ts index 2042393..d35fe25 100644 --- a/web/src/locales/zh-Hans.ts +++ b/web/src/locales/zh-Hans.ts @@ -502,6 +502,8 @@ export const catalog: Catalog = { "Normal": "普通", "Low": "低", "to {recipients}": "收件人:{recipients}", + // The recipient summary's word for the reader, as in "to me". + "me": "我", "From: {sender}": "发件人:{sender}", "Waiting on the server — goes out {when}.": "正在服务器上等待,将于 {when} 发出。", "Scheduled — click to clear the schedule": "已定时,点击可取消定时", diff --git a/web/src/styles/app.css b/web/src/styles/app.css index 2af55e0..efc098c 100644 --- a/web/src/styles/app.css +++ b/web/src/styles/app.css @@ -1582,7 +1582,13 @@ a.menu-item:hover { color: var(--fg); } .message-head .who { flex: 1; min-width: 0; } .message-head .who .from { font-weight: 650; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .message-head .who .from .email { color: var(--fg-muted); font-weight: 400; font-size: .9em; } -.message-head .who .to { color: var(--fg-muted); font-size: .88em; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } +/* A long name breaks inside the column rather than running out of it, under + the date beside it (#89). The address keeps to one line and shortens: it's + whole in the details, and broken it leaves a ">" on a line of its own. */ +.message-head .who .from .addr { min-width: 0; overflow-wrap: anywhere; } +.message-head .who .from .email { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.message-head .who .to { color: var(--fg-muted); font-size: .88em; display: flex; align-items: center; gap: 4px; } +.message-head .who .to .truncate { min-width: 0; } .message-head .who .to button { color: var(--fg-muted); display: inline-flex; align-items: center; } .message-head .who .snippet { color: var(--fg-muted); font-size: .92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .message-head .meta { display: flex; align-items: center; gap: 2px; color: var(--fg-muted); font-size: .85em; white-space: nowrap; flex: 0 0 auto; } @@ -2270,6 +2276,8 @@ select optgroup { background-color: var(--bg-elev); color: var(--fg); } .thread-subject { padding: 14px 16px 8px; } .message { margin: 0 8px 8px; } .message-head { padding: 10px 12px; } + /* Reply is under the thread and in the ⋮ menu; here it only took the sender's room. */ + .message-head .meta .hide-mobile { display: none; } .message-body { padding: 4px 12px 12px; } .thread-toolbar .hide-mobile { display: none; } .list-toolbar .hide-mobile { display: none; } diff --git a/web/src/views/mail/MessageView.tsx b/web/src/views/mail/MessageView.tsx index 9daca03..a62e6df 100644 --- a/web/src/views/mail/MessageView.tsx +++ b/web/src/views/mail/MessageView.tsx @@ -28,7 +28,7 @@ const FilterFromMessageDialog = lazy(() => import("./FilterFromMessage").then((m const FilePreviewDialog = lazy(() => import("@/ui/filepreview").then((m) => ({ default: m.FilePreviewDialog }))); import { findQuoteStart, htmlToText, textToHtml, withoutBidiControls } from "@/lib/text/text"; import { canShare, canShareFiles, shareFile, shareText } from "@/lib/share"; -import { Avatar } from "@/ui/misc"; +import { Avatar, useIsMobile } from "@/ui/misc"; import { MenuItem, MenuSep, Popover, useMenu } from "@/ui/popover"; import { Dialog, choiceDialog} from "@/ui/dialog"; import { toast } from "@/ui/toast"; @@ -113,6 +113,10 @@ export const MessageView = memo(function MessageView({ email: e, expanded, wasUn const reply = useCompose((s) => s.reply); const cardRef = useRef(null); + /* The full date takes about half a phone's width, and the sender loses it + (#89). The short one is what a collapsed message shows; the full one is + still the title and in the details. */ + const isMobile = useIsMobile(); const [details, setDetails] = useState(false); const [showSource, setShowSource] = useState(false); const [showHeaders, setShowHeaders] = useState(false); @@ -330,7 +334,7 @@ export const MessageView = memo(function MessageView({ email: e, expanded, wasUn
{e.hasAttachment && !expanded && } - {expanded ? formatFullDate(e.receivedAt) : formatListDate(e.receivedAt)} + {expanded && !isMobile ? formatFullDate(e.receivedAt) : formatListDate(e.receivedAt)} @@ -520,7 +524,7 @@ function summarizeRecipients(e: Email): string { const all = [...(e.to ?? []), ...(e.cc ?? [])]; if (!all.length) return "(undisclosed recipients)"; const me = useMail.getState().identities.map((i) => i.email.toLowerCase()); - const names = all.map((a) => (me.includes(a.email.toLowerCase()) ? "me" : displayName(a).split(" ")[0] || a.email)); + const names = all.map((a) => (me.includes(a.email.toLowerCase()) ? translate("me") : displayName(a).split(" ")[0] || a.email)); if (names.length <= 3) return names.join(", "); return `${names.slice(0, 3).join(", ")} +${names.length - 3}`; } -- 2.54.0