Skip to content

fix(panel): keep the settings orb off the event's time range - #58

Merged
Periicles merged 1 commit into
mainfrom
fix/settings-orb-overlap
Aug 31, 2026
Merged

fix(panel): keep the settings orb off the event's time range#58
Periicles merged 1 commit into
mainfrom
fix/settings-orb-overlap

Conversation

@Periicles

Copy link
Copy Markdown
Owner

The settings gear covers the end of the event's time range on the in-progress layout.

Cause

The orb is an .overlay(alignment: .topTrailing), so it paints over whatever the content puts in that corner — and nothing inset the content out of its way. At a 480pt panel:

content trailing edge 480 - 28 = 452
orb (32pt, .padding(.trailing, 20)) 428 → 448

24pt of overlap. 14:00 - 15:00 measures 109.2pt at its font, so most of the end time sat under the gear. SecondaryContent already dodged the orb with a hardcoded .padding(.trailing, 46); InProgressContent never got one, which is why only this layout shows the bug.

Why not just shrink the orb

At 26pt the orb starts at 434, still 18pt inside the content. Size alone does not resolve it — the row has to inset too. So this does both.

What changes

  • New NotchPanelMetrics: orb diameter, icon size, paddings, and a contentTrailingClearance derived from them rather than hardcoded. Retuning the orb now moves the clearance with it instead of silently reintroducing the overlap.
  • Orb 32pt → 26pt, glyph 14pt → 12pt.
  • The title row insets by the clearance. Only that row — the progress bar and the elapsed/remaining labels keep the full content width.

Verification

Measured with AppKit at the real font (monospacedDigitSystemFont(ofSize: 15, weight: .semibold)):

before  orb 32pt  timeRange 109.2pt @ x 342.8...452.0  orb starts 428.0  -> overlap 24.0pt
after   orb 26pt  timeRange 109.2pt @ x 316.8...426.0  orb starts 434.0  -> overlap  0.0pt

The 8pt gap is structural, not text-dependent: both edges are measured from the trailing edge, so it holds for any time string and any panel width.

4 tests added on that invariant (106 total, all passing), swiftlint clean, and the app was smoke-run from swift run.

Note

SecondaryContent's .padding(.trailing, 46) is now the odd one out — it predates the constant and is more generous than needed. Left alone deliberately: that layout is not broken, and its centred text would shift if I changed it. Worth a separate pass if you want the two unified.

The orb is drawn in a top-trailing overlay, so it paints over whatever the
content puts in that corner. On the in-progress layout that corner holds the
event's time range, and nothing inset it out of the way: the orb covered the
last 24pt of it, which for `14:00 - 15:00` (109pt at its font) swallowed most
of the end time. `SecondaryContent` already dodged the orb with a hardcoded
trailing padding; the in-progress row never got one.

Shrinking the orb alone does not fix it — at 26pt it would still overlap by
18pt — so the row now insets itself as well. Both values come from
`NotchPanelMetrics`, which derives the content's clearance from the orb's own
size and padding, so retuning either keeps the gap intact instead of silently
reintroducing the overlap.

The clearance applies to the title row only; the progress bar and the
elapsed/remaining labels keep the full content width.
@Periicles Periicles self-assigned this Aug 31, 2026
@Periicles
Periicles merged commit 54d47b6 into main Aug 31, 2026
4 checks passed
@Periicles
Periicles deleted the fix/settings-orb-overlap branch August 31, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant