Repository navigation
perf(renderer): gate runtime store projections - #16173
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds memoized selectors for paired runtime parking environments and floating workspace unread state. Terminal cold parking now consumes the paired-runtime selector from application state. Runtime environment synchronization now uses explicit state, a store subscriber, and replay invalidation handling. Tests cover selector reuse, relevant invalidation, runtime transitions, replay recovery, and unrelated store updates. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
(cherry picked from commit a856367)
Problem
Global Zustand writes rebuilt runtime-event host collections and subscription keys even when no runtime input changed. Paired-runtime parking also depended on the full runtime status map, and two always-mounted floating-workspace consumers repeated the same unread scans.
Why
These subscribers and selectors sit on hot, app-wide store paths. Their work scaled with saved runtimes, terminal tabs, and unread maps, so unrelated local terminal, direct SSH, folder-workspace, and settings updates paid remote-host and UI projection costs.
Solution
ELI5
Before, changing almost anything in the app made Orca recount every paired computer and recheck several UI lists. Now it first checks a few labels: if none changed, it stops immediately. If a runtime stream loses messages, Orca still replaces that one subscription even when there was no visible SSH bucket update to wake the store.
Proof
pnpm run typecheck:webpassing.No regression
terminal.paired-parking.v1continues to keep paired PTYs mounted.User tradeoffs
Readiness and security
Readiness verdict
CLEAN — P0: 0, P1: 0, P2: 0.
Residual risk
Residual risk is limited to network timing around runtime replay-gap recovery; generation guards reject stale callbacks, and the focused disconnect/replay/failed-hydration cases pass.