Repository navigation
feat(crewmate-chat): colour the two speakers like iMessage - #17918
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the accent subtree is safe on surfaces this capture doesn't draw: attachments, file chips, image previews and hover controls inside the user bubble. Suggestions
[DESIGN-REVIEWED] 08128b0 Description read[DESCRIPTION-READ] e40b6a3772eb59e08fb7c35592462c4b97986052b0dc414ce8b2124924d8ce3c That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that #17839 records the maintainer's option-A choice. It is the only provenance for deleting the pin "Outlined, never filled… the two speakers must not share a surface." What this change shipsInventory (8 items) — 8 justifiedIntent: in a crewmate DM, a user can tell who said what by colour (accent for the user, gray for the crewmate) instead of by alignment. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 08128b0 Description read[DESCRIPTION-READ] 306020cc4e7ad15a11edf68c9142baa45064386b33a881caf4058e4cedc6df2b That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Check the shipped accent bubble with a quote card and link pill on a light non-Kiro theme. Only Kiro was captured in-product; other themes appear only on comparison sheets. [UX-REVIEWED] 08128b0 Description read[DESCRIPTION-READ] 39d42b455b6c6290fd16e7dec35f9e1061e755b316b4e0785293ad21cb3d7cf1 That sha256 names everything this verdict read: the PR description, plus the 11 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsFINDING -- website/src/components/chat/crewmateBubbles.ts:239 -- Replacing the border with False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
1ca87ba to
903b267
Compare
|
UX Review dispositions (R1
Also in R2: |
903b267 to
19f1b7d
Compare
|
Design Review dispositions (R2
Also in R3: rebased onto |
In a crewmate's chat both bubbles sat on the same neutral surface (the user's filled bg-card, the crewmate's outlined), so the two speakers were told apart by alignment alone. Zezhen chose the iMessage pairing after real-theme screenshots of three options across eight themes (#17839): the user's bubble filled with the theme accent, the crewmate's a neutral gray. User side: a `tone` prop on UserMessage; `accent` swaps the neutral surface for bg-accent / text-accent-fg and adds the `user-bubble-accent` hook. Under that hook index.css redefines the theme tokens for the bubble's subtree (text and strokes as --accent-fg mixes, surfaces as translucent black), so inline code, link pills, the sent quote card and anything user-message rendering gains later inherit readable colours with no per-element rule; links keep an underline as their link signal once their colour is the body colour. The crewmate `user` entry of createTranscriptRenderers turns it on; every other surface keeps the default tone byte-for-byte. Crewmate side: BUBBLE_BASE is now the `.crewmate-bubble` fill with no border, plus a forced-colors border. The fill is --bg-hover rather than --bg-elevated or --card because those equal the page background in kiro-light, highcontrast-light and everforest-light (contrast 1.00, the bubble vanishes), while --bg-hover sits at least 1.09 above the page in every shipped theme. The reply's contents paint with the same tokens (kiro-light's code patch IS var(--bg-hover), as is every hover:bg-bg-hover control), so the rule scopes --bg-hover / --bg-elevated / --card one step off the fill for its subtree. Measured text-on-accent contrast is >= 4.64 in every probed theme. The capture script now compares the computed bubble colours against the theme's own tokens, so the evidence fails on the pre-change tree. Fixes #17839
19f1b7d to
08128b0
Compare
|
Design Review dispositions (R3
Also in R4: rebased onto |
buluoray
left a comment
There was a problem hiding this comment.
Approving at 08128b08ee.
What I checked in source
- The accent tone is reachable only from the crewmate
userentry (transcriptRenderers.tsx:590,tone={crewmate ? 'accent' : 'default'}).ChatPagecallscreateTranscriptRendererswithout a crewmate, so the single-chat bubble keepsbg-card/ the kiro-light--bg-hovertint. The crewmate entry always setshideSteerBadge, soisSteeris false there and the tone branch is the one that applies. - The edit-mode return (
UserMessage.tsx:354-400) is a separate tree with its ownbg-card, so the Send button'sbg-accent text-accent-fgis not inside the redefined--accentscope and does not go accent-fg on accent-fg. - The token redefinition holds for what
renderUserContentcan put inside the bubble: the knowledge badge and mention/folder chips aretext-accent bg-accent/10 border-accent/25, which now resolve to--accent-fgmixes on the fill rather than accent-on-accent. - The fill snapshots (
--bubble-accent,--crewmate-fill) are declared on the parent via:has(> …)and the rules are unlayered, so they win over the layeredbg-accent/bg-cardutilities on the same element.
Upgrade impact: none beyond the intended visual change in a crewmate's chat. tone is optional and defaults to today's classes; no class, attribute or prop that another reader keys on is removed.
Audience fit: scoped to the Members DM, which is what #17839 asked for; the default single-chat experience is unchanged, and forced-colors keeps a border where fills are dropped.
CI: latest run of every check on this head passes (the cancelled rows are superseded duplicates, each with a later success). I did not run the tests locally.
Non-blocking follow-up
- The pinned-prompt banner
ChatPanemounts in the Members DM still draws its ownuser-bubble … bg-card text-card-fgbox (PinnedPrompt.tsx:741). Once a user message scrolls past the fold, the accent bubble is replaced by a neutral gray card, so the colour cue this PR adds flips at the moment of pinning. Passing the tone through toPinnedPrompt(or addinguser-bubble-accentthere) would keep it consistent.
Problem / Motivation
Goal: In a crewmate's chat, the user's bubble is filled with the theme accent and the crewmate's bubble is a neutral gray, so the two speakers are told apart by colour the way iMessage does it.
Today both bubbles sit on the same neutral surface: the user's is the filled
bg-cardone, the crewmate's an outlinedbg-transparentone, and only alignment separates the two. Zezhen asked for the iMessage / Metamuse pairing (#17839) and chose option A (solid theme accent) after real-theme screenshots of three options across eight themes.Why it matters
A crewmate DM is a 1:1 thread the user reads at a glance between other work; two same-coloured bubble columns make the eye re-derive "who said this" from the margin every time. The accent/gray pairing is the convention every messaging app has trained users on, and it carries the theme (amber goes yellow, dracula goes purple) the way the Settings selected state already does.
Not a goal
bg-card, the kiro-light--bg-hovertint) is untouched: thetoneprop defaults todefaultand only the crewmateuserentry setsaccent.bg-accent-subtle) a steer draws WITH its badge on the single-chat page is unchanged and wins over the tone.What changed (motivation → approach → change)
Goal → the two speakers need two surfaces that read as "mine" and "theirs" in every one of the ~30 shipped themes, light and dark, without a per-theme table → tokens the themes already keep readable:
--accent/--accent-fg(the button pair, 4.64:1 or better in every probed theme) for the user, and--bg-hoverfor the crewmate.website/src/pages/chat/UserMessage.tsx: newtone?: 'default' | 'accent'prop.accentswapsbg-card text-card-fgforbg-accent text-accent-fgand adds theuser-bubble-accenthook; theuser-bubbleclass stays (PinnedPrompt and the theme rules key on it).website/src/pages/chat/transcriptRenderers.tsx: the crewmateuserentry passestone={crewmate ? 'accent' : 'default'};hideSteerBadgealone (no crewmate) keeps the neutral surface.website/src/index.css: under.msg-content.user-bubble.user-bubble-accentthe theme TOKENS are redefined for the bubble's subtree —--text/--text-strong/--card-fg=--accent-fg,--muted= 90%--accent-fg,--accent=--accent-fg(a quote bar or chip must not paint accent-on-accent),--border= 45%--accent-fg, and the surfaces--bg/--bg-elevated/--bg-hover/--card/--accent-subtle= translucent black. Utilities compile tovar(--text)etc. (tailwind-theme.css,@theme inline), so inline code, link pills, the sent quote card and whatever user-message rendering gains later inherit readable colours with no per-element rule (Design review R2 suggested exactly this). The fill reads--bubble-accent, snapshotted from the outer accent on the bubble's parent via:has(>…), because a custom property declared in the rule that redefines--accentwould already see the new value. Surfaces are black, not an--accent-fgmix, because a lighter patch pulls the fill toward the text colour where contrast is scarcest (white at 88% on a 14%-white card over kiro's#8e48ffmeasured 3.2:1); darkening moves it away. Three rules stay: Kiro dark's literal purples on code / links (no token reaches them), and the link signal — once a link's colour is the body colour it gets a solid underline, and the two link pills (.mc-md-ref-chip,LinkChip, whosebg-accent/10+border-border/60vanish on an accent fill of the same hue) get their label's underline back. Specificity (0,3,0) beats the kiro-light.user-bubbletint (0,2,0) and the Kiro code rules (0,2,2).website/src/components/chat/crewmateBubbles.ts+index.css:BUBBLE_BASEiscrewmate-bubble forced-colors:border …, no border. The.message-bubble.crewmate-bubblerule fills with the theme's--bg-hover—--bg-hover, not--bg-elevatedor--card, because those equal the page background in kiro-light, highcontrast-light and everforest-light (contrast 1.00, the bubble vanishes), while--bg-hoversits at least 1.09 above the page in all 15 themes probed, the same step iMessage's gray takes (~1.17). The reply's CONTENTS paint with those same tokens (kiro-light's inline-code patch ISvar(--bg-hover), as is everyhover:bg-bg-hovercontrol; cards arebg-card/bg-bg-elevated), so on a bare utility fill they would vanish (Design review R3). The rule therefore scopes--bg-hover/--bg-elevated/--cardone step off the fill for its subtree (color-mix(var(--text) 6–10%, fill)), with the fill itself read from--crewmate-fillsnapshotted on the parent; kiro-dark paints code with the literal#28242e(its--bg-hover), which no token reaches, so one scoped rule gives it the same step. Forced-colors mode drops fills, so a border is drawn there and only there.AssistantMessage.tsx/index.csstable-breakout comment:data-borderednow reads "framed bubble (a fill counts as much as a border)"; the attribute and the rule are unchanged.docs/system-specs/modules/crew-mode.md: the "How it is drawn" paragraph now states the pairing, the token choice and theuser-bubble-accenthook.Measured text-on-accent contrast per theme (WCAG AA is 4.5): kiro-dark 4.64, kiro-light 4.64, solarized-light 5.15, gruvbox-light 6.12, highcontrast-light 6.62, nord-dark 10.5, dracula-dark 11.2, amber-dark 14.5.
Measured inside the accent bubble after the token redefinition (composited over the fill): quote-card excerpt on its card — kiro 4.97, everforest-light 5.31, solarized-light 5.43, gruvbox-light 6.29, highcontrast-light 6.69, nord-dark 7.39, dracula-dark 7.78, amber-dark 9.93; inline code on its patch — everforest-light 5.04, kiro 6.39, solarized-light 6.95, nord-dark 7.10, dracula-dark 7.55, gruvbox-light 8.05, highcontrast-light 8.63, amber-dark 9.64.
Backwards compatibility
Compatible:
toneis optional and defaults to today's classes; no prop, type, key or row kind is renamed or removed.Removes nothing: the change swaps utility classes on two existing elements and adds CSS; every reader of
.user-bubble,.message-bubbleanddata-borderedstill finds them.Tests
website/src/test/UserMessage.accentTone.test.tsx(new):tonedefault keepsbg-card;accentaddsbg-accent text-accent-fg user-bubble-accentand keepsuser-bubble; a steer drawn with its badge keeps the steer tint over the tone; the crewmateuserentry ofcreateTranscriptRenderersturns accent on,hideSteerBadgealone does not; theindex.csshook redefines every token the user-message subtree reads (--text,--muted,--accent,--border,--bg*,--card, …), snapshots the fill on the parent, darkens surfaces (--bg-hover: rgba(0,0,0,.18)), keeps the link underline and pill rules, and sits after the Kiro chip rules.website/src/test/kiroLightShellHooks.test.ts: the source pin on the UserMessage class ternary now spells thetonebranch too; both non-steer tones keepuser-bubbleleading.website/src/components/chat/crewmateBubbles.test.ts:crewmateBubbleClasscarriescrewmate-bubblewithforced-colors:border, noborder, no barebg-*fill utility.UserMessage.accentTone.test.tsxalso pins the.crewmate-bubblescope (--crewmate-fillsnapshot on the parent,--bg-hover/--bg-elevated/--cardre-pointed off the fill, the kiro-dark literal rule).website/scripts/capture-crewmate-run.mjs: the real-browser capture now compares the COMPUTED bubble colours against the theme's own tokens (--accent,--accent-fg,--bg-hover) asserts the crewmate bubble has no border and that inline code in a crewmate reply sits on a patch distinct from the fill, and — the capture page's second user message now carries a quote of the crewmate's reply — asserts the sent quote card's bar is the text colour (not accent-on-accent) and its excerpt and border derive from--accent-fg; run against the pre-change tree it fails all six colour checks (that is how the "before" frames below were taken).Manual verification
Real-theme mockups of A / B / C across 8 themes, then the capture page on dark and light for the final tree. Not covered by a screenshot: forced-colors mode (the
forced-colors:borderutility is pinned by test only).Screenshots / video
Capture page (
website/capture/crewmate-run.html): a user message, a two-bubble crewmate run, a second user message carrying inline code, a URL and a quote of the crewmate's reply, a lone crewmate reply.Option mockups that drove the decision (A / B / C side by side, real theme tokens)
Related Issues
Fixes #17839
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)