cmux-next: right-side panels slide in without lag or overflow; directional enter and exit in the agent pane
Merged
TE
15d ago+539+539+012345678901234567890123456789-24-24-01234567890123456789
Leo (2026-10-20): opening anything on the right side of a chat pane (the Summary from the list icon, the in-chat Browser from the globe, a New Tab column) animated slowly, lagged and drew the panel past the window's right edge. Things that appear should come in from where they belong and leave the way they came.
What changes
Native: right-side panels
- Past the window edge. A Chromium page is a child window.
CEFClipShapeonly handed the fork rounded clips and the strip mask, so a page that a layout spring carried past the screen's edge drew past the window. That is the band beside the Summary in Leo's screenshot. Square-clipping ancestors (the screen, the pane clip) and the window now form a visible region, which is added as a clip when the page reaches past it. At rest it adds nothing. - Lag. While a pane is on a layout spring (split, close, zoom),
PaneHostViewholds its content at the larger of its size when the spring started and its size at rest. The content is pinned to the edge nearer its rest and laid out once when the spring lands. The chat keeps its width under an opening panel instead of reflowing on every frame, and the panel lays out at its final size and slides in with its right edge. Terminals already held their grid; now pages do too. Debug togglemotion.pane.holdContent(on).
Webview: directional enter and exit
ui/presence.tsaddsusePresence(shown, edge). It keeps a closing surface mounted until its exit plays and marks it withdata-enteranddata-presence.ui/popupSurface.cssdraws the motion with transitions:- A reopen during an exit reverses it in place, and a second open changes nothing.
- Timing comes from the host's
--agent-motion-in/-out, so the Motion switches (#22628) andui.animationSpeedgovern it. - Under Reduce Motion a panel with presence keeps its fade and drops the travel, and an enter-only surface appears at once. Motion off removes it at once.
- Applied to (only the Summary card uses
usePresenceand plays an exit; the others animate in and close at once):- From the right: the Summary card (the inline column travels its own width inside the pane, so the chat lays out once; the popover travels a few points), the session rail, the side preview, Changes and the inspector.
- From the top: quick open and the find pill.
- From the left: the narrow pane's sidebar drawer.
- Rising out of the composer: questions, notices, the PR dock, the agents pill and queued prompts.
- Popups: they travel a few points out of their trigger by side; the composer's menus rise from it.
- Gallery:
agent-pane.summary-motion(open, and open then close).
Popover anchoring and layout stay with the summary-panel lane; this PR only adds motion and the native clip.
Changelog
- Fixed: Panels that open on the right of a chat (Summary, Browser, New Tab) slide in from the right without lag and no longer draw past the window's edge.
- Changed: Panels, cards, bars and drawers in the agent pane enter from the edge they belong to and leave the way they came.
Tests
Red-then-green tests are in the first commit:
Tests/CmuxNextAppTests/PaneMotionContentHoldTests.swift: a page past the screen's edge is cut there; a shrinking pane keeps its content width until the spring lands; a pane opening on the right lays out at its rest size and rides its right edge.webviews/test/presence.test.tsx: enter, exit on transitionend, reopen mid-exit reverses the same node, motion off unmounts at once.
Observed / Not run
- Observed locally:
bun test test/presence.test.tsxpasses (3 tests).test/summary-card-geometry.test.ts, gallery coverage and manifest tests, and the 44 webview test files about summary, popups, motion, rail, find, bottom stack and inspector all pass. Oxfmt and Oxlint pass on the changed files, and tsc shows no errors in them. The fullbun run checkfails only on Oxfmt in four settings files this PR does not touch (base). - Observed on b318d915 (base merge of 2e38ac16): the fleet app compile and link (
cmux-ci compile-check --app) passes. CI'scmux-next swift testbuilt the package and tests; its one red test,AgentPaneImageActionsTests.swift:72followed by an index-out-of-range crash, fails the same way on the unrelated #22990 (base). Webview shards: after one rerun, the reds are only the base ones (composer+glyph, gallery coverage, Oxfmt inApp.tsx);agent-pane-stream-jitter,thread-minimap-feelandbare-pr-refspassed on the rerun.cmux-next checks: only base reds (Tier routing onCmuxNextHomeEngineTests); "Pushed commits add no violations". Capture:media-tour. - Not run: CI's own Release compile and Debug scheme compile stayed queued for over three hours (fleet backlog); the fleet app compile above stands in for them. No native before/after recording beyond the media tour.
Agent session: cosmic-gray
🤖 Generated with Claude Code