Repository navigation
cmux-next agent pane: apply a render-rate change to the live page - #16517
Conversation
WebKit reads PreferPageRenderingUpdatesNear60FPSEnabled only when the page's visibility changes, so setting the rate on a live pane did nothing (60 Hz stayed 60 Hz on a 120 Hz virtual display after a toggle). The test expects the pane to hide and re-show its web view under a snapshot cover. Stubs only, so it fails on behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
#expect cannot wrap allSatisfy with a key path (the macro treats it as throwing), so the red test did not compile. Still stubs only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
… changes WebKit reads the 60 fps preference only when the page's visibility changes. Setting rendersAtFullRate now lays a snapshot of the page over the web view, hides the web view for 33 ms and shows it again, then removes the snapshot 50 ms later. Without a snapshot the change waits for the next visibility change rather than blink the page. Red at 2894973: aLiveRateChangeReShowsThePageUnderASnapshot, (steps.first?.hidden -> nil) == true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
Hiding the web view to re-apply the rate hands focus to the next key view, and showing it again does not take it back, so the composer loses its caret after a settled scroll. Found in review at 2221e87. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Hiding the web view handed focus to the window, so the composer lost its caret after a settled scroll. The re-apply now gives focus back to the page when it held it and the user hasn't moved it since. A WebKit without the 60 fps feature no longer re-shows the page for a rate it cannot set. Red at e1ed3e1: aLiveRateChangeKeepsKeyboardFocusOnThePage, (window.firstResponder -> <NSWindow>) === (pane.webView -> <WKWebView>). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
|
Subagent review at 9a9dc96: APPROVE. The two findings from the review at 2221e87 are fixed:
Gap, not blocking: no test covers the case where the user moves focus during the 33 ms hide. |
Summary
Follows #16487. The agent pane's render rate can now change on a live page. Before this, changing it with the adaptive governor or the
full_ratedebug action did nothing (measured). WebKit readsPreferPageRenderingUpdatesNear60FPSEnabledonly when the page's visibility changes, so a pane kept the rate it was created with.Change. When
rendersAtFullRatechanges, the pane briefly hides its web view and shows it again, which makes WebKit re-read the rate:If there's no snapshot, it skips this rather than blink.
The adaptive governor only changes the rate once a scroll has settled (250 ms after the last scroll), so the switch happens on an idle page and the snapshot matches what's on screen.
Testing
Unit test.
AgentPaneRenderingTests.aLiveRateChangeReShowsThePageUnderASnapshotchecks the sequence and that setting the current rate does nothing.ddbcef0fe88(stubs only): no hide happens.Live, on cmux-mac-mini (M4) with a 120 Hz virtual display (
fleet vdisplay, cmuxterm-hq#1121), using an experiment build of the same mechanism. The pane launched capped, then each variant toggled the rate on and off with a fling after each toggle.Flicker. I recorded the virtual display during the toggles and checked the brightness of the pane's header in each frame.
Not built locally (no local app builds on this Mac). The Swift test runs in CI.
Changelog
none
Red and green
aLiveRateChangeReShowsThePageUnderASnapshot:(steps.first?.hidden → nil) == true. The first red commit, ddbcef0, didn't compile.aLiveRateChangeKeepsKeyboardFocusOnThePagecovers a review finding: hiding the web view moved keyboard focus to the window.(window.firstResponder → <NSWindow>) === (pane.webView → <WKWebView>).🤖 Generated with Claude Code
https://claude.ai/code/session_01RYQHfug1ZVQDp4eWgwVUtD
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes the agent pane's render rate so changing it via the adaptive governor or
full_ratetakes effect on a live page. WebKit only readsPreferPageRenderingUpdatesNear60FPSEnabledon a page visibility change, so a pane kept the rate it was created with; the pane now briefly hides and re-shows its web view under a snapshot of the page, so nothing visibly blinks.Written for commit 9a9dc96. Summary will update on new commits.