Repository navigation
Fix #2210: coalesce portal sync to latest geometry - #2214
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
To use Codex here, create a Codex account and connect to github. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIntroduced per-portal and global "latest-request-wins" generation-based coalescing for external geometry synchronization. Added generation counters to Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Portal as WindowTerminalPortal
participant AsyncQueue as Async Queue
participant SyncOp as Sync Operation
Caller->>Portal: scheduleExternalGeometrySynchronize() [Gen=1]
Portal->>Portal: externalGeometrySyncGeneration = 1
Portal->>AsyncQueue: Queue performSync(Gen=1)
Caller->>Portal: scheduleExternalGeometrySynchronize() [Gen=2]
Portal->>Portal: externalGeometrySyncGeneration = 2
Portal->>AsyncQueue: Queue performSync(Gen=2)
AsyncQueue->>Portal: Execute performSync(Gen=1)
Portal->>Portal: Check: Gen=1 < current Gen=2?
rect rgba(255, 100, 100, 0.5)
Portal->>Portal: STALE - clear flag
Portal->>AsyncQueue: Reschedule with Gen=2
end
AsyncQueue->>Portal: Execute performSync(Gen=2)
Portal->>Portal: Check: Gen=2 == current Gen=2?
rect rgba(100, 200, 100, 0.5)
Portal->>SyncOp: Execute synchronizeAllEntries()
SyncOp->>SyncOp: Sync geometry
end
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Greptile SummaryThis PR fixes issue #2210 by introducing a generation counter to implement "latest-request-wins" coalescing for external terminal portal geometry syncs. Previously, when multiple rapid geometry change events fired (e.g., during sidebar toggle), the first pending async request would win — meaning the PTY could be resized to a stale intermediate width. The fix applies the same generation-counter pattern to both the per-portal Confidence Score: 5/5This PR is safe to merge — it is a focused, correct coalescing fix with no regressions risk. The change is minimal (two symmetrical generation-counter additions, one per coalescing site), all code runs exclusively on the main queue so there are no concurrency concerns, wrapping arithmetic prevents any UInt64 overflow edge case, and the re-schedule path correctly re-evaluates isDragEvent / requiresSettledLayout with fresh state. The logic mirrors a well-understood generation stamp pattern used in AppKit coalescing. No public APIs change, and the author verified behavior in a tagged Debug build. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Fix #2210: coalesce portal sync to lates..." | Re-trigger Greptile |
Summary
Testing
CMUX_SKIP_ZIG_BUILD=1 ./scripts/reload.sh --tag sidebar-resize-fix --launchDemo Video
For UI or behavior changes, include a short demo video (GitHub upload, Loom, or other direct link).
Review Trigger (Copy/Paste as PR comment)
Checklist
Summary by CodeRabbit
Summary by cubic
Coalesces terminal portal geometry syncs so the latest size wins. Fixes #2210 by preventing sidebar toggles from applying stale widths and cutting extra PTY redraws.
scheduleExternalGeometrySynchronizeandscheduleExternalGeometrySynchronizeForAllWindows.Written for commit 9087fc5. Summary will update on new commits.