Skip to content

Add centered workspace bar placement to the right of the notch - #714

Open
henrikhestnes wants to merge 1 commit into
OmniNull:mainfrom
henrikhestnes:workspace-bar-right-of-notch
Open

henrikhestnes wants to merge 1 commit into
OmniNull:mainfrom
henrikhestnes:workspace-bar-right-of-notch

Conversation

@henrikhestnes

@henrikhestnes henrikhestnes commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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 in GlobalWindowCornerPreferencesTests.testRadiusFormattingPreservesVisibleFractionPrecision. The local locale produces 12,25 pt and 12,3457 pt, while the test expects decimal points.
  • Built, signed, installed, and launched the development app based on upstream 0.7.0; signature verification passed. The requester manually tested the new placement and confirmed it works well.

Summary by CodeRabbit

  • New Features

    • Added a “Right of Notch” Workspace Bar placement option.
    • Positions the bar just to the right of a display notch and centers it on displays without one.
    • Supports existing horizontal and vertical offsets, with automatic placement when offsets are reset.
  • Documentation

    • Updated Workspace Bar settings guidance and help text to explain the new placement option.
  • Tests

    • Added coverage for settings persistence and placement behavior across supported display configurations.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 525b1837-d25c-48d8-9d19-85f0e4233d1d

📥 Commits

Reviewing files that changed from the base of the PR and between cb10f92 and 3d26731.

📒 Files selected for processing (7)
  • README.md
  • Sources/OmniWM/UI/WorkspaceBar/WorkspaceBarGeometry.swift
  • Sources/OmniWM/UI/WorkspaceBar/WorkspaceBarInstance.swift
  • Sources/OmniWM/UI/WorkspaceBar/WorkspaceBarManager.swift
  • Sources/OmniWM/UI/WorkspaceBarSettingsTab.swift
  • Tests/OmniWMTests/WorkspaceBarNotchModeSettingsTests.swift
  • Tests/OmniWMTests/WorkspaceBarSplitGeometryTests.swift

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The workspace bar adds a rightOfNotch mode. On notched displays, the bar starts 8 points right of the notch and clamps to the available width. On displays without notch bounds, it centers and moves below the menu bar. Settings, scratchpad compaction, documentation, and tests were updated.

Workspace Bar Right-of-Notch Mode

Layer / File(s) Summary
Notch mode setting and documentation
Sources/OmniWM/UI/WorkspaceBar/WorkspaceBarManager.swift, Sources/OmniWM/UI/WorkspaceBarSettingsTab.swift, README.md, Tests/OmniWMTests/WorkspaceBarNotchModeSettingsTests.swift
The rightOfNotch setting and display name are defined. Help text and README documentation describe the setting. TOML and settings-store tests verify persistence.
Right-of-notch geometry
Sources/OmniWM/UI/WorkspaceBar/WorkspaceBarGeometry.swift, Tests/OmniWMTests/WorkspaceBarSplitGeometryTests.swift
Geometry anchors the bar after the notch, clamps its width, applies offsets, centers it on plain displays, and falls back below the menu bar when notch bounds are unavailable.
Compaction width integration
Sources/OmniWM/UI/WorkspaceBar/WorkspaceBarInstance.swift
Scratchpad compaction uses the geometry-resolved available width for applicable layouts.

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
Loading

Suggested reviewers: barutsrb

Merge Risk: ⚪ Minimal · up to 3d267

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding workspace-bar placement to the right of the notch. It is concise and directly related to the changeset.
Description check ✅ Passed The description includes complete Problem, Result, and Verification sections. It explains configuration behavior, fallback behavior, test results, known locale-dependent failures, and manual verificat…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@BarutSRB BarutSRB added feature New feature or capability proposal bars Workspace Bar, menu-bar items, and tab-rail presentation display Display geometry, scaling, mixed DPI, topology, and connection changes labels Sep 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bars Workspace Bar, menu-bar items, and tab-rail presentation display Display geometry, scaling, mixed DPI, topology, and connection changes feature New feature or capability proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants