Skip to content

fix(chat): the seen gutter only on the message with faces beside its text, as wide as its stack - #673

Merged
rafavalls merged 1 commit into
mainfrom
fix/seen-gutter-only-when-faces
Nov 30, 2026
Merged

rafavalls merged 1 commit into
mainfrom
fix/seen-gutter-only-when-faces

Conversation

@rafavalls

@rafavalls rafavalls commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Regression

#671 kept a fixed right gutter on every message's text (88px, 60px on a phone), so the faces of a faces-only message could sit beside the last line. Every message's text wrapped early for nothing, leaving an empty column on the right, worst in narrow panes.

Fix

  • Only the message whose faces sit beside its text keeps a gutter. That's a faces-only message whose faces row follows the text directly, so the last message of a run.
  • The gutter is sized to that message's stack + 12px (facesGutter, web/features/chat/model.ts):
    • the button's 4px each side, 20px for the first face, 14px for each next face or "+N", 13px for the ✓
    • rounded up to the 4px scale: 40px for one face, up to 96px for 3 faces + "+N" + ✓
    • phone: 1 face + "+N", so at most 68px
  • It's a class table, not an inline style (style policy).
  • footerFaceCount shares the footer's dedupe, so the gutter and the stack can't disagree.
  • Every other message's text has the full width.

Why not a gutter on the last line only (float/spacer): it only works when the text ends in a paragraph or list, not with code blocks, tables, quotes or chips. It's also what produced the "faces squeezed against the text" look that was rejected before #671. The per-message rule works for any content.

Numbers (DOM measurement, local dev, same seed)

Text column width:

main (a2200e97) this PR
room 1440, message without faces 487px (88px gutter) 575px (no gutter)
room 1440, faces-only, one face 487px 535px (40px gutter)
room 1440, faces-only, 1 face + ✓ 487px 519px (56px)
room 1440, faces-only, 3 faces + "+2" 487px 491px (84px)
thread 1440, message without faces 487px 575px
thread 1440, faces-only, 2 faces + ✓ 487px 507px (68px)
phone 390, message without faces 218px (60px gutter) 278px
phone 390, faces-only 218px 222–238px
  • Space from the text column to the faces: 16–19px everywhere. Main had 9px for 2 faces + ✓ on a phone.
  • No overlap: the faces cover no glyph.
  • Spacing unchanged: 24px between groups (after nothing, choices, faces or a chips row) and 6px in runs, at 1440 and 390.
  • Hover: no message moves.

Screens

before (main) after

Thread on a phone: before · after

Tests

  • scripts/chat.test.ts: facesGutter widths (none, one face, ✓, five faces desktop/phone) and footerFaceCount dedupe.
  • scripts/ui-panels.test.ts: only the faces-only messages get a gutter, of their size; the others don't.
  • bun run check passes (includes the chat DOM tests). bun run test:design-system passes.

🤖 Generated with Claude Code


Summary by cubic

Fixes the regression from #671 where every message's text kept a fixed right gutter (88px on desktop, 60px on phone), forcing unnecessary early text wrapping and leaving an empty column in narrow panes. Now only a faces-only message whose faces sit beside its text keeps a gutter, sized to its face stack plus 12px; all other messages' text gets the full width.

  • facesGutter in web/features/chat/model.ts returns Tailwind classes for gutter widths (40px for one face, up to 96px for three faces, "+N", and the ✓; one face and "+N" on a phone), as a class table rather than inline styles.
  • footerFaceCount dedupes readers who also passed, so the gutter width always matches the stack drawn.
  • Updated chat and ui-panels tests to verify gutters appear only on faces-only messages and are sized to their stacks.

Written for commit d138313. Summary will update on new commits.

View guided diff Turn on auto-fix

…text, as wide as its stack

#671 kept an 88px right gutter on every message's text (60px on a phone), so
text wrapped early everywhere and left an empty column on the right, worst in
narrow panes. Now only the message whose faces sit beside its text (faces only,
the last of a run) keeps one, sized to its stack and 12px (40px for one face,
up to 96px for three, "+N" and the ✓; one face and "+N" on a phone), from a
class table (no inline styles). Every other message's text has the full width.
The faces stay on the last line, 24px between groups and 6px in a run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rafavalls
rafavalls enabled auto-merge (squash) November 30, 2026 14:55
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-seen-gutter-only-when-faces-chat.deco-cx.workers.dev (commit d138313)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://f633b733-chat.deco-cx.workers.dev d138313 2026-11-30T14:55:44.124Z Visit the dashboard ↗

@rafavalls
rafavalls merged commit 22cb295 into main Nov 30, 2026
6 checks passed
rafavalls added a commit that referenced this pull request Nov 30, 2026
…#675)

Proposal (Valls): the faces of who saw a message go back under it, and the gap
between messages stays the same with or without them. A faces-only row hangs
under the message body (absolute, top-full, right-aligned), 24px high in the
24px group gap, with 16px faces (AvatarStack xs; the ✓ level with the last
face) centered in it: 4px clear above and below, so it never touches the next
message's quote, name or avatar. It takes no height. With reaction chips the
faces stay at the end of that row. A run's faces are on its last message, which
a group gap follows; a notice, a day divider, a call line or the "working" bar
after a faces message gets the same 24px, and the timeline ends with 24px.

Removes the text gutter of #671/#673 (facesGutter and its class table): every
message's text has the full width. Phone: one face and "+N".

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant