Add centered workspace bar placement to the right of the notch - #714
henrikhestnes wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughChangesThe workspace bar adds a Workspace Bar Right-of-Notch Mode
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant SettingsStore
participant WorkspaceBarManager
participant WorkspaceBarGeometry
participant WorkspaceBarInstance
SettingsStore->>WorkspaceBarManager: Load rightOfNotch setting
WorkspaceBarManager->>WorkspaceBarGeometry: Resolve workspace bar geometry
WorkspaceBarGeometry->>WorkspaceBarInstance: Provide frame and available width
WorkspaceBarInstance->>WorkspaceBarInstance: Compact scratchpad using available width
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The new placement mode centers correctly on displays without a notch and safely falls back when notch bounds are unavailable. No merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 6 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 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 |
Problem
There is no workspace-bar mode that keeps the entire bar centered on displays without a notch while placing it immediately to the right of the notch on displays with one. Manual horizontal offsets do not adapt to different displays or changing bar widths.
Result
Adds Right of Notch to the global and per-monitor Notch Mode settings (
notchMode = "rightOfNotch"). It centers the bar on displays without a notch and anchors its left edge 8 points beyond the measured notch on displays with one. The anchor stays fixed as content changes, and the bar width and scratchpad compaction use the available space on the right.Configured offsets still apply; zero offsets give automatic placement. If a notch is detected but its bounds are unavailable, the bar falls back below the menu bar. Existing defaults and other notch modes are preserved.
Verification
make verify: passed formatting, lint, and the arm64 build.swift test --filter WorkspaceBar: all 147 tests passed, including placement across display coordinates, changing content widths, offsets, missing notch bounds, settings persistence, and existing notch layouts.swift test: executed 4,054 tests with 31 skipped and two assertion failures inGlobalWindowCornerPreferencesTests.testRadiusFormattingPreservesVisibleFractionPrecision. The local locale produces12,25 ptand12,3457 pt, while the test expects decimal points.Summary by CodeRabbit
New Features
Documentation
Tests