Skip to content

fix(cli-mode): keep steer badges on their own line above the message - #9756

Merged
dwu96 merged 1 commit into
mainfrom
fix/cli-mode-steer-badge-own-line
Sep 10, 2026
Merged

dwu96 merged 1 commit into
mainfrom
fix/cli-mode-steer-badge-own-line

Conversation

@patrigao

@patrigao patrigao commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

In CLI UI mode (data-ui="cli"), the steer badges render on the SAME line as the message text instead of above it. A pending steer shows as ◎ Steering… ? <message text> in one row — the badge reads as a prefix of the message rather than a status indicator.

no linked issue: user-reported directly against a live dashboard running CLI mode; screenshots below.

Why it matters

Anyone using CLI mode who steers a running turn gets a visually broken transcript row for all three steer lifecycle states (pending "Steering…", confirmed "Steered into the running turn", requeued). The badge/InfoTip and the message fuse into one line, which misreads as message content and breaks the indicator-family layout the steer UX (#8069/#9037) established.

What changed (motivation → approach → change)

  • Symptom: badge and bubble share a line in CLI mode only; the normal theme stacks them.
  • Root cause: UserMessage's root is flex flex-col items-end, and the badges are inline-flex boxes that stack because of the column flex. cli-mode.css flattens that root to display: block !important and makes the bubble's .msg-content display: inline-block. Under block layout, an inline-flex badge is an inline-level box, so it flows onto the same line as the inline-block bubble.
  • Change: one CLI-scoped rule in website/src/styles/cli-mode.css promoting direct-child .inline-flex badges of the user-message root to block-level flex, so each keeps its own line. Direct-child scoping (>) leaves the badge's inner animate-pulse span and the InfoTip untouched; the hover footer uses flex (not inline-flex) so it never matches; the edit-mode root has no .msg-content child so the existing :has(.msg-content) guard excludes it. This follows the file's own precedent (the .relative steer-wrapper cap-lift) of repairing CLI-mode layout in the CLI stylesheet rather than adding mode-conditional classes to the component.

Tests

  • website/src/test/cliModeSteerBadge.test.ts (new): guards the rule's presence in cli-mode.css — the CLI user-root scope selecting direct .inline-flex children with display: flex !important. Source-level because jsdom cannot compute the attribute + :has() cascade.
  • src/test/UserMessage.test.tsx (55 tests) and src/test/composerFocus.test.ts (23 tests, includes the cli-mode.css selector ratchet) pass unchanged.

Manual verification

Verified on a live dashboard in CLI mode: before the fix, a pending steer rendered ◎ Steering… ? inline with the message text; after rebuilding with the rule, the badge sits on its own line above the message. Screenshots below are those live captures.

Screenshots / video

Before — badge, InfoTip and message fused on one line:

before: Steering badge inline with message text

After — badge on its own line above the message:

after: Steering badge stacked above the message

Pattern harvest

Not generalizable: no lint/semgrep shape fits — the defect is a layout-mode interaction — a mode stylesheet flattening a flex column to block turns inline-level children into same-line flow. No grep/semgrep shape distinguishes a legitimate inline-flex from one that depends on a parent flex column. The regression test added here guards the one known instance.

@patrigao
patrigao requested review from a team and Zedmor September 9, 2026 19:25
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of 22cf03ac7d7f07743de9ee364d42120ae7171709 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Everything checks out. The ratchet in composerFocus.test.ts guards aria-label selectors only — untouched by this rule. The user root at cli-mode.css:72 is the only display: block flatten in the stylesheet, so there are no sibling flattened roots with the same fused-badge defect. All description claims about the component structure verified against UserMessage.tsx. The temp-screenshots/ directory is an established, tracked convention (dozens of prior PR directories under it).

First-Principles-Verdict: PASS

The only behavioral proof is manual: the test pins the rule's source text, not the rendered cascade — confirm the after-screenshot on a live CLI-mode dashboard.

What this change ships

Inventory (3 items) — 2 justified, 1 harm-free rider

Intent: make steer status badges sit on their own line above the message in CLI UI mode, instead of fusing with the message text — a FIX.

  1. Steer badges (pending, confirmed, requeued) render on their own line above the message in CLI mode — justified
  2. New test pins the CLI badge rule's presence in cli-mode.css — justified
  3. Before/after screenshots committed under temp-screenshots/cli-steer-badge/ — rides along (repo-convention evidence artifacts; harm-free)

Verification notes: root cause chain in the description matches the code (UserMessage.tsx:260 flex-col root, three inline-flex direct-child badges, flex footer, edit root without .msg-content); display: block flatten at cli-mode.css:72 is the only one in the stylesheet (grep display:\s*block, 1 hit), so no unfixed siblings; one class-scoped rule covers all three badge states.

[FIRST-PRINCIPLES-REVIEWED] 22cf03a

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 22cf03ac7d7f07743de9ee364d42120ae7171709 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 22cf03a

Verdict parsed from the review's SHA-scoped output markers for commit 22cf03ac7d7f07743de9ee364d42120ae7171709.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 22cf03ac7d7f07743de9ee364d42120ae7171709: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 22cf03ac7d7f07743de9ee364d42120ae7171709 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Correct ownership — CLI mode caused the flattening, so repairing its consequence in cli-mode.css, tightly scoped, is the right shape.

Suggestions

  • The rule keys on the Tailwind utility .inline-flex, so a component-side class refactor silently regresses CLI mode and the CSS-source regex test won't notice; a stable hook on the badges (e.g. data-steer-badge, per the theming-contract hook pattern already used for data-role) would make the coupling explicit and pinnable from the component side.

[DESIGN-REVIEWED] 22cf03a

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 22cf03ac7d7f07743de9ee364d42120ae7171709 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 22cf03a

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 22cf03ac7d7f07743de9ee364d42120ae7171709: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

UX-level review of 22cf03ac7d7f07743de9ee364d42120ae7171709 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Both screenshots match the PR's claims: shot-02 (before) shows the "Steering…" badge fused inline with the message text, shot-01 (after) shows it stacked on its own line. The diff is a single CLI-scoped CSS rule plus a source-level regression test — no new strings, controls, or states; it restores the pre-existing steer-badge layout (from #8069/#9037) in CLI mode. The blind reader correctly identified the badge as a label attached to the message and the ? as a help affordance; their confusion about the word "Steering" targets pre-existing vocabulary (already carrying an InfoTip), not anything this PR introduces. The before/after pair are branch states, not a runtime transition, so no recording is required.

UX-Verdict: PASS

Layout-only repair of an existing badge; the after screenshot reads exactly as intended — status label on its own line above the message.

[UX-REVIEWED] 22cf03a

CLI mode flattens the UserMessage root to display:block and the bubble's
.msg-content to inline-block, so the steer badges ("Steering…" pending,
"Steered into the running turn" confirmed, requeued) — inline-flex boxes
that stack above the bubble in the normal theme's flex-col root — flowed
onto the SAME line as the message text. Promote direct-child .inline-flex
badges to block-level flex inside the CLI user-root scope; the hover
footer uses flex (not inline-flex) so it never matches, and the edit-mode
root has no .msg-content child so it is excluded by the existing guard.

Source-level regression test: jsdom cannot compute the attribute-scoped
cascade, so the test guards the rule's presence in cli-mode.css.
@patrigao
patrigao force-pushed the fix/cli-mode-steer-badge-own-line branch from 167c302 to 22cf03a Compare September 9, 2026 19:39
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 9, 2026
@dwu96
dwu96 enabled auto-merge (squash) September 9, 2026 21:06

@dwu96 dwu96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: CLI-mode CSS cascade fix — the flattened display:block root let inline-flex steer badges share a line with the message text; a direct-child display:flex rule restores their own line, guarded by a source-level CSS test.

@NicholasRBowers NicholasRBowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: CSS-only steer-badge layout fix with test — clear root cause (badge inline instead of own line in CLI mode), well under the 5-file fix limit.

@dwu96
dwu96 merged commit f6d3874 into main Sep 10, 2026
74 of 81 checks passed
@dwu96
dwu96 deleted the fix/cli-mode-steer-badge-own-line branch September 10, 2026 00:17
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 10, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…irodotdev#9756)

CLI mode flattens the UserMessage root to display:block and the bubble's
.msg-content to inline-block, so the steer badges ("Steering…" pending,
"Steered into the running turn" confirmed, requeued) — inline-flex boxes
that stack above the bubble in the normal theme's flex-col root — flowed
onto the SAME line as the message text. Promote direct-child .inline-flex
badges to block-level flex inside the CLI user-root scope; the hover
footer uses flex (not inline-flex) so it never matches, and the edit-mode
root has no .msg-content child so it is excluded by the existing guard.

Source-level regression test: jsdom cannot compute the attribute-scoped
cascade, so the test guards the rule's presence in cli-mode.css.

Co-authored-by: Patrick Gao <patrigao@amazon.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.

4 participants