Skip to content

Session Info: native panel close reaches the page on every host, so the header toggle clears - #32673

Merged
teamleaderleo merged 2 commits into
feat-cmux-nextfrom
lane/si-native-toggle
Nov 2, 2026
Merged

teamleaderleo merged 2 commits into
feat-cmux-nextfrom
lane/si-native-toggle

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

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:

  • The page-side state already drives both the toggle and the native model from one value (shown in useSessionInfo), so the toggle follows the panel's open state through the toggle, the panel's own close (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.
  • A real bug on the old page host (no page host: a dev-server page, agent.pageHost off): AgentPaneSessionInfo.actionScript emitted window.cmuxAcpmuxSessionInfo?.action?(…). That is a JavaScript syntax error, so every native panel action there, including its Esc close, 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 AgentPaneNativeSessionInfoTests via 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

  • Observed: the web test passes locally; web-lint passes (the type-aware lint is left to CI on this host); the prepush gate reports no new violations.
  • Not run here: Swift build and tests (fleet only, results posted as comments). No capture: the visible state (the lit toggle) was already right on the page-host path, as the capture scene's header_toggle_pressed readiness 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


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with 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.

  • Adds a jsdom test pinning the toggle to the panel's open state through the toggle, the panel's own Esc close, Esc on the page, and per-chat switches.
  • Adds a Swift test running the old-host action and host scripts in JavaScriptCore.

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.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits November 2, 2026 23:39
…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
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 2f0817a: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr32673 -f ref=lane/si-native-toggle -f platform=macos -f backend_mode=local

Unclear: web / react-apps-base-check (4) failed: no known signature; failed step: Run base reds and compare. This PR merged before its CI finished: fix forward on main.

CI failed on 2f0817a972 (run 41547369684 attempt 1): 2 unknown.
macOS jobs did not run: compile and app tests were skipped: Fast static checks skipped.

Job Verdict Why
web / react-apps-base-check (4) unknown no known signature; failed step: Run base reds and compare
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Not re-run automatically: web / react-apps-base-check (4), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

red: web / Web status; a job it gathers is red on this change (its line here); do not merge until green; see lane-rules
red: web / react-apps-base-check (4); NEW webview test reds: test/ui-a11y.test.ts > ui a11y (chromium) > markdown: toolbar keys and tooltips, link popover, link bubble on the caret and on a click, axe; do not merge until green; see lane-rules
red: web / react-apps-check; a job it gathers is red on this change (its line here); do not merge until green; see lane-rules

Default changes

This pull request changes 1 default at 2f0817a972f1 (what everyone gets without configuring anything):

  • tunable-source.CmuxNextAgentPane/AgentPaneSessionInfo.swift:actionScript: "24ee23c1e5c14af0625a46ab42ceb85b80e097bd7755b3b8d5f90a0a6f7eef53" -> "dc695126886faa5494bdc061adf49f13486d7ce138b1f259f3287a42f29bbeaa"

Signed off on this commit by review (claude-opus-5-5).

Merge receipt: merged as 0f0ebe5bcf0e with these defaults changed, signed off by review (claude-opus-5-5).

Regenerate the snapshot with python3 scripts/ci/defaults_guard.py snapshot.

Shipped in:

@teamleaderleo teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
@teamleaderleo teamleaderleo added the leo-named-fix An obvious fix to something Leo named: lands on push, review runs in parallel label Nov 2, 2026
@teamleaderleo
teamleaderleo merged commit 0f0ebe5 into feat-cmux-next Nov 2, 2026
192 of 207 checks passed
@teamleaderleo
teamleaderleo deleted the lane/si-native-toggle branch November 2, 2026 23:52
teamleaderleo added a commit that referenced this pull request Nov 3, 2026
… 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>
lawrencecchen added a commit that referenced this pull request Nov 3, 2026
… 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.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 2f0817a9 Deployed Nov 2, 2026 by teamleaderleo via namespace autofix #12754
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

leo-named-fix An obvious fix to something Leo named: lands on push, review runs in parallel risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant