From 8ac43bd73f10f1f9fb2d615db42b16c55cea7a70 Mon Sep 17 00:00:00 2001 From: Void Date: Mon, 9 Nov 2026 10:05:02 +0000 Subject: [PATCH] Name pill shows the full name on phones, wraps when long The pill was capped at a percentage of the bubble column and clipped with an ellipsis; a short bubble's column is narrower than its own name, so names read as "E..." and "V...". It is now max-content up to a viewport-based cap and wraps. Demo fixtures gain a long display name to keep this honest. Co-Authored-By: Claude Sonnet 5.5 --- src/app/components/message/layout/layout.css.ts | 13 +++++++------ src/preview-demo/fixtures.ts | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/components/message/layout/layout.css.ts b/src/app/components/message/layout/layout.css.ts index 6c7b97f3..f5890c1e 100644 --- a/src/app/components/message/layout/layout.css.ts +++ b/src/app/components/message/layout/layout.css.ts @@ -209,12 +209,13 @@ export const BubbleHeaderPose = style({ padding: `0 ${toRem(13)}`, background: color.Secondary.Container, border: `1px solid ${color.Secondary.ContainerLine}`, - borderRadius: toRem(999), - whiteSpace: 'nowrap', - // Never wider than the bubble minus the portrait, so it cannot reach the portrait's face. - maxWidth: `calc(100% - ${PHONE_PORTRAIT} - ${toRem(30)})`, - overflow: 'hidden', - textOverflow: 'ellipsis', + // The pill is as wide as the full name needs, up to the room beside the portrait, then the + // name wraps. It is capped by the viewport, not by the column: a short bubble's column is + // narrower than its own name, and a percentage cap there truncated names to one letter. + width: 'max-content', + maxWidth: `calc(100vw - ${PHONE_PORTRAIT} - ${toRem(64)})`, + overflowWrap: 'anywhere', + borderRadius: toRem(14), }, }, }); diff --git a/src/preview-demo/fixtures.ts b/src/preview-demo/fixtures.ts index 32d3c7a6..6d03ec4c 100644 --- a/src/preview-demo/fixtures.ts +++ b/src/preview-demo/fixtures.ts @@ -23,6 +23,7 @@ export const USERS: DemoUser[] = [ { id: `@void:${DEMO_SERVER}`, name: 'Void' }, { id: `@nibu:${DEMO_SERVER}`, name: 'Nibu' }, { id: `@visitor:${DEMO_SERVER}`, name: 'Visitor' }, + { id: `@watch:${DEMO_SERVER}`, name: 'Heimdall of the Long Watch, Keeper of the Bridge' }, ]; const user = (localpart: string) => `@${localpart}:${DEMO_SERVER}`; @@ -110,6 +111,8 @@ export const ROOMS: DemoRoom[] = [ pose: 'deadpan', minutesAgo: 25, }, + // A long display name: the name pill has to show all of it on a phone. + { from: user('watch'), body: 'Ok.', pose: 'reading', minutesAgo: 20 }, ], }, {