Repository navigation
Session Info: native panel close reaches the page on every host, so the header toggle clears - #32673
Conversation
…ost action scripts run The web test pins aria-pressed to the App's open state through the toggle, the panel's own close, Esc on the toggle and per-chat switches. The Swift test runs the old host's action and host scripts in JavaScriptCore; actionScript's `?.action?(` is a syntax error on base, so it fails there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-7a7568197607c3cdfb81
…ld host actionScript emitted `window.cmuxAcpmuxSessionInfo?.action?(…)`, a JavaScript syntax error, so on the old host (no page host) every native panel action, its Esc close included, was dropped: the page kept Session Info open and its header toggle lit after the panel was closed. Now `?.action?.(…)`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-7a7568197607c3cdfb81
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Unclear: CI failed on
Not re-run automatically: Written by red: web / Web status; a job it gathers is red on this change (its line here); do not merge until green; see lane-rules Default changesThis pull request changes 1 default at
Signed off on this commit by Merge receipt: merged as Regenerate the snapshot with Shipped in:
|
teamleaderleo
left a comment
There was a problem hiding this comment.
Review (claude-opus-5-5): SHIP at 2f0817a
Review (subagent claude-opus-5-5): SHIP at 2f0817a. Visual verdict: unchanged by this diff. Checked: the actionScript fix is right (?( parsed as a ternary, a syntax error; it now matches hostScript's ?.host?.(); the JavaScriptCore test is valid under Swift 6 and would fail on the old script; the bun test passes (4/4) and compares aria-pressed with the native model's open state. Follow-ups: the bun test pins current behaviour and does not reproduce the script bug; assert sent.length > 0 after mount.
… closes native Session Info after a click in it (#32704) * test(agent-pane): a pressed header toggle requires its filled square; Esc after a click in native Session Info closes it chat-header-plain-icons (red on base since #32687 added the pressed and hover pill) now refuses a fill at rest and requires one on a pressed tool in the chat header, tab row and floating chat; the gallery's plain-icons play follows, and session-info-open[-accentless] check the open toggle's square and lit ink and nothing behind the other tools, in the default and an accentless dark theme. The bun toggle test asserts the page posted on mount and runs the old host's close script from the Swift template (a SyntaxError in its pre-#32673 form). AgentPaneNativeSessionInfoTests gains the native Esc case: red here, the panel never takes the keyboard on a click. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-7a7568197607c3cdfb81 * fix(session-info): a click in the native panel gives it the keyboard, so Esc closes it The page's Esc handler closes Session Info only from its toggle or panel; after a click in the App's panel the keyboard stayed in the page (the composer, say), so Esc never reached the panel's cancelOperation. A press on a line, a button, the edge or empty glass now makes the panel first responder (no ring), as a click in the page's panel focused it; when it closes with the keyboard in it, the chat takes the keyboard back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-7a7568197607c3cdfb81 * fix(agent-header): hovering an on toggle keeps its filled square; the lint splits selectors at the top level Review follow-up: the hover pill rule (0,4,0) outranked the pressed and menu-open square (0,3,0), so an on toggle under the pointer showed the lighter hover tint, which chat-header-tab-row-surface's pressed-hover case already expects not to happen. The hover pill now excludes [aria-pressed=true] and [data-popup-open]. chat-header-plain-icons splits selector lists at top-level commas (not inside :is or :not), ignores lit states inside :not(...), and asserts the hover fill excludes the pressed state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-7a7568197607c3cdfb81 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… with node:vm, not the Function constructor (#32760) Oxlint typescript(no-implied-eval) refused the two `new Function(...)` calls that 419a87a (#32704) added to webviews/test/native-session-info-toggle.test.tsx, so `vp lint` and `vp check` in webviews `bun run check` are red on the feat-cmux-next tip. The test keeps its intent: `new vm.Script` still throws SyntaxError for the pre-#32673 `?.action?(` form, and the real script runs in a new context whose `window` holds the page bridge, as gallery-web-theme-bootstrap.test.ts already does. With `window: {}` instead of the bridge the test fails. bun test test/native-session-info-toggle.test.tsx: 5 pass. bun run check (webviews): exit 1 on the base, exit 0 on this commit.
Summary
Native Session Info's header toggle must read as on exactly while the App's panel shows, and off once it closes, as it does for the web panel. Leo (2026-11-02, softened): "the entire point was to have it look good work good HAVE THE TOGGLED HIGHLIGHT".
Spec (
design/session-info.md): "Its header toggle and Esc (from inside it) close it." and "The header's tools stay where they are, open or closed."What I found:
showninuseSessionInfo), so the toggle follows the panel's open state through the toggle, the panel's ownclose(AppKit Esc), Esc on the toggle and per-chat switches. A new jsdom test pins all four with the native host on (webviews/test/native-session-info-toggle.test.tsx), so this coupling can't drift.agent.pageHostoff):AgentPaneSessionInfo.actionScriptemittedwindow.cmuxAcpmuxSessionInfo?.action?(…). That is a JavaScript syntax error, so every native panel action there, including its Escclose, folds, drags and row clicks, never reached the page. The panel stayed open with its toggle lit after a close. It now emits?.action?.(…). A Swift test runs the scripts in JavaScriptCore and checks that they reach the page bridge (AgentPaneNativeSessionInfoTests.oldHostActionScriptsRunAndReachThePage).The script bug came in with the native panel (#31930).
Only touches the action script and tests; no panel background, header/grip or column layout changes (sibling items).
Test plan
cd webviews && bun test test/native-session-info-toggle.test.tsx: 4 pass (head).swift test --filter AgentPaneNativeSessionInfoTestsvia cmux-ci (fleet), red on the test commit (bdc2b4d) and green on the fix: results in a comment below.cmux-ci compile-check --ref <head> --package CmuxNext: result in a comment below.Observed / Not run
header_toggle_pressedreadiness check shows; the fix is on the old-host script path, which capture slots don't use.Follow-up (not in this PR): Esc after clicking inside the native panel leaves first responder on the web view, so the page's Esc handler (which needs focus on the toggle or panel) does not see it. The web panel takes focus on a click, so it closes there.
Changelog
Fixed: closing native Session Info from the panel itself now clears the header toggle's highlight on every page host.
Agent session: agent session
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes the native Session Info header toggle so closing the panel clears its highlight on every page host.
On the old page host, the panel's action script was invalid JavaScript (
?.action?(…)is a syntax error), so closing the panel with Esc never reached the page and the toggle stayed lit. The script now emits valid?.action?.(…)and the close always reaches the page.Only touches the action script and tests; no panel background, header, or column layout changes.
Written for commit 2f0817a. Summary will update on new commits.