cmux NEXT: no blink on native pane resize

Closed
TE
3d ago
+159830-17983

HOLD: base red web / react-apps-check hides webview test signal on feat-cmux-next (owner nx-ci); this PR touches webviews/ and lands once that check is green again.

P0: native right-pane open/close no longer blinks the chat

Leo's report:

"You know, there's some nonsense where, like, okay, the right pane, the browser, or whatever terminal, I open up the right pane, right? Starting from the main pane of the agent chat. It plays the opening on the right animation. Okay, I still feel like it's fing sluggish. It's not slick. It's annoying. ... But the agent chat, that section, it, like, okay, it successfully moves over, and then it disappears and reappears. So why the f would it be redrawing itself after it successfully redrew itself in that position? Why is it disappearing? Likewise, the sort of closing. I mean, why is there even an animation for closing? Like, fine, we can keep it, but it's, like, at the very least we need to remove that disappear-reappear thing, because that appears when it closes as well. That's not acceptable."

This PR is stacked on #25649. It replaces the earlier artifact-only beside gate with the native-pane resize fix; #25649 remains unchanged for review.

Root cause and fix

The native browser/terminal pane changes the agent shell's width, while the webview's ResizeObserver recomputes Session Info's floating shift. The existing translate transition then animates that second shift from stale geometry, while the native split is already moving, producing a second motion and a blank-looking redraw.

The observer now marks only shell-width changes as native pane resizing. In that same layout turn it writes the final Session Info shift and a temporary data-inspector-chat-resizing marker; CSS disables the webview shift transition for that resize. Artifact-only side-width changes keep the normal Session Info transition. The live chat DOM remains mounted and visible throughout open and close.

Chromium regression (red then green)

Command:

TMPDIR=$HOME/.cache/rail-opus-onepush-tmp CMUX_BROWSER_TESTS=1 bun test test/chat-inspector-artifact-motion.test.ts

Red on stacked base at 86ced6354888cb18855ec174bc387d2da649ac9b (test commit 808feb01851004):

open  [460.23, 285.23, 268.59, 253.28, 239.02, 225.80, 213.69, 202.80, 193.25, 185.28, 179.15, 174.23, ...]
close [174.23, 349.23, 349.23, 349.23, 365.88, 381.19, 395.45, 408.67, 420.77, 431.67, 441.21, 449.19, 455.32, 459.18, 460.23, ...]

The failing recording had active webview animations during resize and the close path showed a pause followed by a second movement phase.

Green on 9577254f3dd52127a96c91e61f56160a8add24a7:

open  [460.23, 174.23, 174.23, 174.23, 174.23]
close [174.23, 460.23, 460.23, 460.23, 460.23]

Every recorded frame stayed visible; the movement phase count is exactly one for both open and close, and the webview shift animation count is zero during the native resize.

Cleanup and bounded work

  • The existing ResizeObserver disconnects on effect cleanup.
  • The one-frame transition suppression clears via requestAnimationFrame; its effect cleanup cancels that frame.
  • The Chromium recorder stops after three stable samples or 120 painted frames.
  • No native build ran on huge-blue.
  • No changes were made to the lines touched by PR #25641.

Native capture

A fleet build and real-app open/close capture are required for final frame-time evidence. The capture will use a browser/terminal pane so the privacy check does not see the cmux-capture runner name in chat content. If the fleet capture remains blocked, the exact job and blocker will be recorded here.

Risk

The webview transition is suppressed only while the shell's own width changes. Normal Session Info opening, closing, artifact side-width changes, and non-resize overlay motion retain their existing transitions. The native split animation remains enabled and the chat stays live throughout it.

Agent session: agent session


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.