Repository navigation
perf: split BrowserPanelView's modifier chain so it type-checks quickly - #13130
Conversation
The chain of preference, notification, appear and onChange modifiers on BrowserPanelView's body was one expression that took about 7-8 s to type-check. Split it into three computed views applied in the same order. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe browser panel lifecycle view is decomposed into three nested private computed properties. The existing preference, notification, lifecycle, and change modifiers remain in the same order with the same handlers. ChangesBrowser panel lifecycle decomposition
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Refactor Suggested reviewers: 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
34ecef4 perf: coalesce concurrent process snapshots across diagnostics and restore (manaflow-ai#13014) 150d7fa Add app-host test failure census (manaflow-ai#13124) 04ac7a4 Merge pull request manaflow-ai#12735 from manaflow-ai/feat-ios-connectivity-soak c022438 fix: update Ghostty environment lifetime fix (manaflow-ai#13191) eb18207 Fix mobile devices dashboard WebSocket failures and naming (manaflow-ai#13156) c7d961d perf: split BrowserPanelView's modifier chain so it type-checks quickly (manaflow-ai#13130) e188035 refactor: move the Computer Use runtime out of the app module into a package (manaflow-ai#13132) cf2b850 Bound terminal markers and verify restored selection 2d7fc1c Measure terminal latency separately after reconnect 44dcd1e Reconcile iOS monitor stack with main 70034bc Merge pull request manaflow-ai#13116 from manaflow-ai/feat-ios-monitor-e2e-repair deafe6e Skip release gate text scans without a probe a1be46b Release terminal ownership from reader teardown 96d6574 Restore transport target after UI evidence 31ff358 Schedule terminal owner cleanup from deinit e82f6f6 Keep bounded terminal text evidence reliable ccbc4b2 Bound frame evidence scans and handshake setup 301dbad Make terminal evidence capture causal 6b50e3a Finish bounded release gate cleanup 14f2cd9 Stop stale release gate probes and bound frame inspection cd64e8c Bound pairing bootstrap loading 035fd37 Harden release gate evidence and readiness b6ca6e9 Close release gate review races 389026e Make release gate readiness and dismissal causal aa2bb02 Restore main translations for the pairing preparation error 46bbfc9 Restore the pairing preparation handling already present on main 1bcbf60 Give the soak one owned terminal reader across steady-state commands 9d700f9 Test soak terminal consumer lifetime across commands and reconnects 1dd9f69 Fix existing Cloud test imports and nested macro compilation bd5fee0 Give launch-request samples a distinct statistics key bc68fbf Measure UI readiness from the actual simulator launch request e5772e8 Test launch request timing across app initialization 8006ba9 Clear prior UI evidence before each retained-simulator launch d8e1b4c Reuse isolated monitor devices while cold-launching the app 0968fcf Test the dedicated monitor simulator plan boundary e7da214 Wait for the published pairing identity and inject screenshot capture 0af38fe Avoid the Swift task-group isolation checker defect in refresh test 48a0eb9 Own UI measurements per launch and capture composited terminal evidence 7e28e4e Mint pairing tickets with the active v2 device identity f498caf Test pairing tickets against the current transport identity 95f931d Correct the foreground suspension entrypoint in the test f5d5b2b Use the public foreground lifecycle for regression-test cleanup 0eded5a End the UI exercise only after terminal consumer ownership is released c0a61bb Keep UI state on its actor across the task-group boundary 30000a5 Drive and measure the real workspace UI before each soak; decouple background discovery 0d896f5 test: foreground refresh must finish while secondary discovery is blocked 4e739bb test: require real UI selection and stable first-frame measurements aeb554a Measure real iOS UI readiness timings (manaflow-ai#12887) 6a2c896 Record per-operation iOS soak latencies (manaflow-ai#12883) 39d7669 test: advertise workspace actions in the soak reconnect fixture 7e9a676 fix: disconnect the soak session before testing reconnect c51a096 test: require stress reconnect to replace a healthy connection e1a2767 fix: import the workspace model from its owning module e6a6ba4 fix: import mobile workspace preview module 3361141 Merge remote-tracking branch 'origin/main' into feat-ios-connectivity-soak dbfebac Merge remote-tracking branch 'origin/main' into feat-ios-connectivity-soak 3f8ceec fix: forward connection snapshots through deferred Iroh transport d8f30dc test: require deferred transports to forward native path snapshots 3dce84c fix: observe soak path and identity on the native RPC connection 38ee330 test: require native connection path evidence throughout soak 055880c test: cover final soak deadline and name failed usage actions b27046c fix: bound stalled soak cycles with an independent deadline 7f1f748 test: require stalled soak operations to report promptly e116e6b Use accepted boolean spelling for the Mac relay setting aa3dc13 Exercise relay setup command arguments in both modes db17d3d Constrain current Iroh endpoints to relays in app gates 245b55e Reproduce release gate missing current Iroh relay policy c9289ed Add focused Iroh soak harness test plan aec8291 Support an isolated agent account for unattended soaks 915c080 Add deterministic iOS Iroh connectivity soak workloads # Conflicts: # .github/workflows/ci.yml # .github/workflows/iroh-v2.yml
Moved from #13105 with the same commits.
Summary
BrowserPanelView's body ended in one chain of 20 modifiers (coordinateSpace, threeonPreferenceChange, twoonReceive,onAppear/onDisappear, twelveonChange). The compiler type-checks that chain as a single expression, and it was the slowest expression in the app module.browserPanelLifecyclePreferencesView->browserPanelLifecycleNotificationsView-> theonChangegroup). The modifiers, their closures and their order are unchanged; nothing else in the file is touched.Testing
Measured on one machine (MacBook Air M5, Xcode 27.0) with
-Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200:Sources/Panels/BrowserPanelView.swift:1073)xcodebuild -scheme cmux -configuration Debug buildon this branch:BUILD SUCCEEDED.Sources/Surfaces/SurfaceCatalog+CloudPorts.swift:37(2.7 s).Demo Video
Not applicable: no behaviour change.
Checklist
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Speeds up type-checking of
BrowserPanelViewby splitting its 20-modifier chain into three computed views. Modifiers, closures, and order are unchanged, so there is no behavior change.Testing
Sources/Panels/BrowserPanelView.swiftdrops from ~8 s to under 200 ms.xcodebuild -scheme cmux -configuration Debug buildsucceeds.Written for commit 31ddfd6. Summary will update on new commits.
Summary by CodeRabbit