Skip to content

fix(studio): keep the running chat's Stop inside the phone header - #2233

Merged
kantord merged 3 commits into
mainfrom
fix/studio-chat-stop-mobile-2231
Oct 14, 2026
Merged

kantord merged 3 commits into
mainfrom
fix/studio-chat-stop-mobile-2231

Conversation

@peppescg

@peppescg peppescg commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Stack: part of gh stack #2227 (… ← #2230 ← this PR ← settings and chat PRs). It moved into the stack because the chat port (#2207) builds on this header. The rebase was conflict-free and the gates were rerun on the rebased head: server 195, web 980, browser 66.

Summary

On a phone, the running chat's header row overflowed and clipped Stop at the right edge. At 320px, Stop ended 150px past the viewport, and the chat title had collapsed to nothing. This change follows the prototype's mobile chat header (stack-08, features/chat/chat-view.tsx) below 500px, so Stop is always fully visible and at least 44×44 from 320px up. Desktop is unchanged.

Stop's behaviour and accessible name ("Stop") stay the same, and so do the integration tests that click it.

What changed

All changes are in the chat header in apps/web/src/features/chat/chat-workspace.tsx. They apply below 500px only (max-[499px] / min-[500px], plus the existing useIsMobile hook, which uses the same pivot):

  • Status pill: collapses to a spinner, as in the prototype's header. The pill's text ("Mecatl is working", "Reconnected to run" or "Waiting for authorization") stays in the page as screen-reader-only text, so the accessible tree doesn't change.
  • Stop: becomes a 44×44 icon control (size-11, which renders at 49.5px at the 18px mobile root size). Its "Stop" label stays as screen-reader-only text, so its accessible name doesn't change. The click handler, disabled state and Escape behaviour are untouched.
  • "Esc to Stop" hint: hidden, because phones have no Escape key.
  • Canvas: in an open chat, Canvas moves from the header into Chat options as "Open local canvas". This is the same accessible name as the header button, and the prototype has the same item ("Open canvas"). A new chat has no Chat options menu, so it keeps the header button. When the menu opens Canvas, it waits for the menu to close and return focus to its trigger. The panel then takes focus as usual, and closing the panel returns focus to Chat options.
  • Row spacing: 8px gaps and 12px side padding, as in the prototype's mobile header. Before, they were 12px and 16px.

The chat title now gets room on a phone too: "A running cha…" at 390px, where it used to collapse to zero width.

user-docs/operating/studio.md says where Canvas is on a phone.

Visible change

  • Phones (below 500px), while a run is active: a spinner instead of the status pill, a round 44px Stop icon at the end of the row instead of a clipped "Stop" button, and no "Esc to Stop" hint. Canvas moves into Chat options, the gaps are tighter, and the chat title is visible.
  • Phones, Chat options menu: gains "Open local canvas" after "Clear conversation".
  • Desktop and from 500px: pixel-identical, including the Chat options menu. The header, page and menu shots at 1280px match before and after pixel for pixel.

Differences from the prototype

  • Stop stays in the header. The prototype moves Stop into the composer's send slot. That belongs with the chat UI port (Studio alignment: chat UI from the prototype on Studio's chat logic #2207). This change keeps Stop where Studio has it, with its name and behaviour unchanged.
  • Stop is 44px. The prototype's header and composer controls are size-8 (36px at the 18px phone root). Studio keeps its 44px touch-target minimum.
  • Activity stays in the header. The prototype's header has no Activity control (it shows a fleet status chip). Studio keeps Activity as an icon button.
  • Canvas on desktop. The prototype has Canvas only in the ··· menu, at every width. Studio keeps its labelled desktop header button so desktop doesn't change. The menu item appears only on phones.
  • Spinner colour: the prototype's text-brand spinner, which is low-contrast on the dark theme. It's decorative (aria-hidden), and the status text stays available to screen readers.
  • The 499px edge: Tailwind compiles max-[499px] to width < 499px and min-[500px] to width >= 500px. At exactly 499px neither applies, so the desktop pill, a labelled Stop and a spinner all show. Stop still fits there (it ends at 442px), and this matches the existing convention elsewhere in Studio.

No regression

New browser journey

apps/web/e2e/chat-header-stop.spec.ts runs in desktop and mobile Chromium. It uses offline BFF fixtures and a loopback activity stream that leaves the run live, which gives a "Reconnected to run" status pill.

  1. Stop on phones: at 320, 360, 390 and 430px, with the status pill in the page, it checks that Stop (exact name "Stop") lies inside the viewport, is at least 44×44, and is the hit target at its own centre. It also checks that the page doesn't scroll sideways.
  2. Moved action: at 390px, the header has no Canvas button. Chat options > Open local canvas opens the Local canvas panel with Close panel focused, and closing it returns focus to Chat options. Activity stays a visible header button.
  3. Desktop pin: at 1280px, Stop shows the text "Stop", and the status pill and "Esc to Stop" are visible. Activity and Canvas keep their labels, and the Chat options menu doesn't list "Open local canvas".

On the base (e9c216aa1), journeys 1 and 2 fail ("Stop ends inside the viewport at 320px: received 470", and the header Canvas button is present). Journey 3 passes. On the head, all three pass in both projects.

Existing tests

No test was modified or deleted. The integration tests that find or click Stop pass unchanged: chat-workspace.integration.test.tsx, session-inspection.test.tsx and delegation-workspace.test.tsx, 83 tests in all. So does e2e/side-panel-shell.spec.ts, which opens Canvas from a new chat's header at 320px. e2e/session-inspection.spec.ts asserts that inspect-only sessions have no Stop, and it also passes.

Gates

Gate Base e9c216aa1 Head 3b36fb577
task studio:check, web 114 files, 724 tests 114 files, 724 tests
task studio:check, server 24 files, 187 tests 24 files, 187 tests
task studio:browser 54 passed 60 passed (+6: 3 journeys × 2 projects)

Lint, typecheck and the generated-artifact check pass on both. task docs passes on the head. The base counts come from the same commit's gate run for #2224.

Screenshots

Captured with a throwaway Playwright journey (Chromium, not committed). It uses offline BFF fixtures, a live run that shows "Reconnected to run", a fixed clock (2026-09-25 12:30 UTC), Europe/Rome and en-US. The header was shot at 320, 360, 390 and 430px (mobile emulation) and at 1280×800, in light and dark. The full page and the open Chat options menu were shot at 390×844 and 1280×800. Before is main (e9c216aa1), and after is this PR's code commit (3b36fb577). Each tree was captured twice. The runs matched pixel for pixel, apart from 220 anti-aliasing pixels (maximum channel delta 2) in the composer area of one dark mobile page. Every pair was pixel-compared, and red boxes mark the regions that differ. Phone header strips are upscaled, and desktop composites are downscaled to 1600px wide.

Running chat header, desktop 1280px

Unchanged: pixel-identical before and after.

Running chat header at 1280px, light

Dark

Running chat header at 1280px, dark

Running chat header on phones

Intended change. Before, Stop is clipped, or entirely off-screen at 320px and 360px, and the title is gone. After, the spinner and a 44px Stop fit at every width, and the title truncates instead.

320px

Running chat header at 320px, light

Dark

Running chat header at 320px, dark

360px

Running chat header at 360px, light

Dark

Running chat header at 360px, dark

390px

Running chat header at 390px, light

Dark

Running chat header at 390px, dark

430px

Running chat header at 430px, light

Dark

Running chat header at 430px, dark

Full page

Mobile 390px: only the header differs. The small boxes in the dark composer area are anti-aliasing noise that also differs between two captures of the same tree. Desktop: pixel-identical.

Full page, mobile light

Dark and desktop

Mobile, dark:

Full page, mobile, dark

Desktop, light:

Full page, desktop, light

Desktop, dark:

Full page, desktop, dark

Chat options menu

Mobile: the menu gains "Open local canvas" after "Clear conversation", and it anchors further right because the ··· trigger moved. Desktop: pixel-identical.

Chat options menu, mobile light

Dark and desktop

Mobile, dark:

Chat options menu, mobile, dark

Desktop, light:

Chat options menu, desktop, light

Desktop, dark:

Chat options menu, desktop, dark

Part of #2210.

Review fixes

Fixes from the final regression and security review of the stack (stack #2227). Each one comes with a test that fails without the fix.

  • Phones lost the "Waiting for authorization" cue (minor, a11y/UX). Below 500px the run status pill's text is visible only to screen readers, and a spinner stands in for it. A run parked on authorization got the same spinner as a working run, so a phone user couldn't see that the run was waiting for them to act. (56733636d)
    • Fix: while authorization is pending, the phone header shows a still amber key instead of the spinner. Screen readers still get the pill's text, and the desktop header is unchanged. Both icons carry data-slot="run-status-cue", with data-cue naming the state.
    • Test: a browser journey parks a run on authorization at 320, 390, and 430px. It checks that no spinner shows, that the key is visible inside the viewport, that the page doesn't scroll horizontally, and that desktop keeps the labelled pill. On the previous header it fails with "no spinner at 320px".
    • Docs: the Studio operating page describes the cue.
    • Difference from the prototype: the prototype keeps its spinner while it waits on the user. Studio distinguishes the two states deliberately, because phones hide the label.
Gate Result
task studio:check passed: web 980, server 195 (no unit-test change)
task studio:browser 68 passed (+2: the new journey on desktop and mobile projects)
task docs:check passed, 0 broken links

Screenshots: Before is b7ca46bbe and After is 19c4a039b. Each tree was captured twice. The only change is the phone header icon during authorization, about 218 changed pixels. The working-run header and every desktop header are pixel-identical before and after. The working-run phone page differs by about 150 pixels between repeat captures of the same tree, which is spinner-frame noise.

Phone header while waiting for authorization (spinner before, amber key after):

Phone header waiting for authorization, light

Dark, full page with prototype, and unchanged headers

Phone header waiting for authorization, dark
Phone page waiting for authorization with prototype, light
Phone page waiting for authorization with prototype, dark
Phone header for a working run (unchanged)
Desktop header waiting for authorization (unchanged)

Re-verification (2026-10-11)

Re-verified at this head: no change needed. The authorization cue survives #2254's fleet chip and #2256's header container query at 320–430px.

Gates on the restacked head 56733636d: studio:check passes (web 1,042, server 210 tests). At the stack top (#2256): studio:browser 118 passed, 30 skipped; the mecated --mock integration suite 8 passed. The browser suite takes 5.3 minutes on a CI runner.

Commit hashes cited earlier in this body predate the restacks; the current commits keep the same subjects. Hashes in Review fixes are updated.

Closes #2231

🤖 Generated with Claude Code

@peppescg
peppescg force-pushed the fix/studio-chat-stop-mobile-2231 branch from 8fa29da to b7ca46b Compare October 10, 2026 09:24
@peppescg
peppescg changed the base branch from main to fix/studio-approval-destructive-2224 October 10, 2026 09:24
@peppescg
peppescg added this pull request to stack #2227 October 10, 2026 09:24
@peppescg
peppescg force-pushed the fix/studio-chat-stop-mobile-2231 branch from b7ca46b to 011db9f Compare October 11, 2026 14:57
@peppescg
peppescg force-pushed the fix/studio-chat-stop-mobile-2231 branch from 011db9f to 2dbc86c Compare October 11, 2026 15:48
@peppescg
peppescg force-pushed the fix/studio-chat-stop-mobile-2231 branch from 2dbc86c to 4b29623 Compare October 13, 2026 13:29
@peppescg
peppescg force-pushed the fix/studio-chat-stop-mobile-2231 branch from 4b29623 to 5673363 Compare October 14, 2026 08:45
@kantord
kantord force-pushed the fix/studio-chat-stop-mobile-2231 branch from 5673363 to f556578 Compare October 14, 2026 08:59
@kantord
kantord force-pushed the fix/studio-chat-stop-mobile-2231 branch from f556578 to 6b21342 Compare October 14, 2026 08:59
@kantord
kantord force-pushed the fix/studio-chat-stop-mobile-2231 branch from 6b21342 to 6ca181e Compare October 14, 2026 09:00
Base automatically changed from fix/studio-approval-destructive-2224 to main October 14, 2026 09:40
Below 500px the running chat header no longer overflows and clips Stop.
Following the prototype's mobile chat header, the row tightens its gap and
padding, the run status pill collapses to a spinner (its text stays for
screen readers), the "Esc to Stop" keyboard hint is hidden, Canvas moves
into the chat options menu as "Open local canvas", and Stop becomes a
44x44 icon control that keeps its "Stop" accessible name. Desktop is
unchanged.

A browser journey pins Stop inside the viewport and at least 44x44 at
320, 360, 390 and 430px with the status pill present, keeps Canvas
reachable from the menu with focus returning to its trigger, and pins the
unchanged desktop header.

Closes #2231

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
peppescg and others added 2 commits October 14, 2026 12:41
On a phone, an open chat moves Canvas from the header into
Chat options as "Open local canvas".

Refs #2231

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Below 500px the run status pill keeps its text for screen readers only
and a spinner stands in for it. "Waiting for authorization" got the same
spinner as a working run, so a phone user lost the cue that the run is
parked until they act.

While authorization is pending, the phone header now shows a still,
amber key in place of the spinner; the pill's text stays available to
screen readers and desktop is unchanged. Both icons carry
data-slot="run-status-cue" with data-cue naming the state.

A browser journey parks a run on authorization and checks, at 320, 390,
and 430px, that no spinner shows, that the key is visible inside the
viewport without horizontal scroll, and that desktop keeps the labelled
pill. It fails on the previous header ("no spinner at 320px").

The Studio operating page describes the cue.

Refs #2231

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@kantord
kantord force-pushed the fix/studio-chat-stop-mobile-2231 branch from 6ca181e to 05a4331 Compare October 14, 2026 09:41
@kantord
kantord merged commit d03529e into main Oct 14, 2026
29 of 30 checks passed
@kantord
kantord deleted the fix/studio-chat-stop-mobile-2231 branch October 14, 2026 09:41
@kantord kantord mentioned this pull request Oct 14, 2026
41 tasks done
@kantord

kantord commented Oct 14, 2026

Copy link
Copy Markdown
Member

Post-merge review follow-ups for this PR. No blockers or regressions found. Items worth tracking were filed here:

  • Large batch of tiny follow-up fixes #2303 (tiny follow-up fixes), section D: the user docs say the chat header shows "Waiting for authorization", but the header cue disappears once the run parks and the stream closes. The e2e test also keeps the stream open, so it does not cover that.

Other candidate findings were checked and dropped as not worth tracking.

Fully or partially written by an AI agent.

This branch was successfully deployed

1 active deployment
Preview — 05a4331f Deployed Oct 14, 2026 by vercel[bot]
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.

Studio chat: the running chat's Stop button is clipped in the header on phones

2 participants