Repository navigation
Clamp Settings window away from display edge - #3436
Conversation
|
The latest updates on your projects. Learn more about Vercel for 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)
📝 WalkthroughWalkthroughRemoves per-window traffic-light button repositioning and related state; adds clamping to keep the Settings window origin inside the active screen's visibleFrame with an 18pt inset, applied during configure and focus. ChangesTraffic-Light Button Repositioning Cleanup
Settings Window Visible Area Clamping
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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. Review rate limit: 6/8 reviews remaining, refill in 11 minutes and 18 seconds.Comment |
Greptile SummaryThis PR clamps the Settings window inside the visible display area (18 px inset) on both initial configuration and every re-focus, disables window restoration to prevent stale off-screen positions from persisting across launches, and removes the dead traffic-light offset code path that was caching button frames only to reapply a zero offset. The clamping logic correctly guards against nil screens, handles windows wider than the available area, and is a no-op when the window is already in-bounds. Confidence Score: 5/5Safe to merge — changes are well-scoped, logic is correct, and dead code removal has no behavioral impact. No P0 or P1 issues found. The clamping arithmetic is sound, nil-screen fallback is handled, and the No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[show] --> B{existingWindow?}
B -- No --> C[openWindow]
C --> D[configure window]
D --> E[isRestorable = false]
E --> F[clampToVisibleAreaIfNeeded]
B -- Yes --> N[focus window]
N --> O{isMiniaturized?}
O -- Yes --> P[deminiaturize]
P --> F
O -- No --> F
F --> G{screen available?}
G -- nil --> H[fallback NSScreen.main]
G -- present --> I[use window.screen]
H --> J[compute clamped origin]
I --> J
J --> K{origin changed?}
K -- No --> L[no-op]
K -- Yes --> M[setFrame display true]
M --> Q[makeKeyAndOrderFront]
L --> Q
Reviews (1): Last reviewed commit: "Clamp Settings window away from display ..." | Re-trigger Greptile |
Summary
Verification
Summary by cubic
Clamp the Settings window to the visible screen with an 18px inset and disable restoration to prevent reopening flush against the display. Also remove the unused traffic-light reframe path that was reapplying zero-offset button frames.
Bug Fixes
isRestorable = falseto avoid restoring stale edge positions.Refactors
WindowDecorationsController.Written for commit 7c1da75. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes