Skip to content

Commit ee1ec45

Browse files
authored
improve(ui): one primary composer button, Enter-steer, Esc-stop, quiet mic, no transcript focus ring (#124799)
* fix(ui): drop the transcript keyboard-focus ring The .chat-thread:focus-visible 2px inset outline (added in #120693) boxed the entire main content whenever the transcript took keyboard focus (Shift+Tab, closing transcript search) and read as a broken border that stopped above the composer. The transcript stays keyboard-focusable for scroll keys; it just paints no focus box. Accepted tradeoff: no visible focus indicator on the scroll container. * feat(ui): single primary composer button with Enter-steer and Esc-stop The composer now renders exactly one primary action, always rightmost: - draft or attachments present: one send-shaped button whose label follows the session follow-up mode (Send / Queue / Steer); the stop button no longer renders beside it - empty while a run is active: Stop (tooltip "Stop (Esc)"); Escape in the composer aborts the run, deferring to reply-clear and menu precedence - empty while idle: disabled send labeled "Write a message to send." Enter on an empty composer while a run is active steers the oldest steerable queued message — Enter queues, Enter again steers — using the same eligibility predicate as the queue chip's Steer action (shared steerableQueuedMessage helper). The mic/dictation control is now always a compact secondary control left of the primary instead of morphing into the primary when the composer is empty. Dead ChatRunControlsProps fields (hasMessages, onExport, onNewSession, showPrimary, showSecondary) and the composer exportMarkdown wrapper are removed; the assertion-safety baseline entry for chat-composer.ts shrinks 8 -> 7. * refactor(ui): quiet the idle composer mic The idle mic was an accent-tinted two-segment pill (mic + permanently visible device-picker chevron) that outweighed the primary action. It now matches the attach button's ghost weight: transparent idle, subtle hover, and the accent treatment is reserved for the recording and talk-active states so the idle -> recording escalation reads stronger. The device picker chevron collapses at idle and reveals on hover/focus-within (kept always visible on coarse pointers, where dictation matters most; reveal transition disabled under prefers-reduced-motion). The idle tooltip now teaches the gesture split — "Tap to talk · Hold to dictate" — while the aria-label stays "Start voice input". * refactor(ui): split composer keydown and oversized composer test files chat-composer.ts crossed the 700-line oxlint budget after the keyboard additions; the keydown handling (menu routing, history keys, Escape-stop, Enter steer/send) moves to chat-composer-keydown.ts behind a typed deps factory. The composer unit tests split their primary-action/keyboard coverage into chat-composer-actions.test.ts over a shared chat-composer.test-support.ts, and the catalog/model-discovery e2e cases move to chat-composer-catalog.e2e.test.ts. Pure moves, no behavior change; no max-lines suppressions or baseline entries added. * chore(ui): keep composer test-support ComposerProps internal The split exported a type nothing imports; the dead-export scan is a merge gate. * fix(ui): narrow composer keydown target and adapt keyboard tab-order proof The keydown split moved two bare textarea assertions into a zero-baseline file; a single instanceof narrowing at the handler entry replaces both (the handler only binds to the composer textarea). chat-composer.ts's own assertion baseline ratchets 7 -> 5. The pointer-activation e2e now walks the real post-redesign tab order (mic, focus-revealed picker trigger, then primary send) instead of assuming one Tab. * fix(ui): gate Enter-steer on the queue chip's visible availability ClawSweeper P1: the Enter path only required an abortable run, so offline Enter swallowed the keypress and invoked a steer lifecycle that returns at !connected with no visible outcome, while the queue chip's Steer button was correctly hidden behind connected && canCompose. The keydown path now mirrors the chip's exact boundary (connected, canSend, abortable, visible queue surface including sessionKey-less pending rows).
1 parent 046a9ff commit ee1ec45

17 files changed

Lines changed: 1333 additions & 1004 deletions

‎config/assertion-safety-baseline.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4214,7 +4214,7 @@ ui/src/pages/chat/components/chat-audio-player.ts 1
42144214
ui/src/pages/chat/components/chat-composer-plus-menu.ts 1
42154215
ui/src/pages/chat/components/chat-composer-slash-menu.ts 1
42164216
ui/src/pages/chat/components/chat-composer-view.ts 1
4217-
ui/src/pages/chat/components/chat-composer.ts 8
4217+
ui/src/pages/chat/components/chat-composer.ts 5
42184218
ui/src/pages/chat/components/chat-effort-picker.ts 6
42194219
ui/src/pages/chat/components/chat-header-session-menu.ts 3
42204220
ui/src/pages/chat/components/chat-message-attachment-availability.ts 1

‎ui/src/e2e/app-chrome-interaction.e2e.test.ts‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,9 @@ async function dragAcross(page: Page, locator: Locator): Promise<string> {
3838
async function readFocusOutline(locator: Locator) {
3939
return locator.evaluate((element) => {
4040
const styles = getComputedStyle(element);
41-
const colorProbe = document.createElement("span");
42-
colorProbe.style.color = "var(--muted-strong)";
43-
document.body.append(colorProbe);
44-
const mutedStrongColor = getComputedStyle(colorProbe).color;
45-
colorProbe.remove();
4641
return {
4742
focusVisible: element.matches(":focus-visible"),
48-
mutedStrongColor,
49-
outlineColor: styles.outlineColor,
50-
outlineOffset: styles.outlineOffset,
5143
outlineStyle: styles.outlineStyle,
52-
outlineWidth: styles.outlineWidth,
5344
};
5445
});
5546
}
@@ -155,11 +146,8 @@ suite.define(() => {
155146
const focusedOutline = await readFocusOutline(thread);
156147
expect(focusedOutline).toMatchObject({
157148
focusVisible: true,
158-
outlineOffset: "-2px",
159-
outlineStyle: "solid",
160-
outlineWidth: "2px",
149+
outlineStyle: "none",
161150
});
162-
expect(focusedOutline.outlineColor).toBe(focusedOutline.mutedStrongColor);
163151
await captureUiProof(page, "02-chat-thread-keyboard-focus.png");
164152

165153
await page.setViewportSize({ height: 650, width: 1440 });

0 commit comments

Comments
 (0)