Skip to content

fix(desktop): align notifications inbox row timestamps and action buttons - #1835

Merged
janicduplessis merged 1 commit into
mainfrom
fix/1831-inbox-row-alignment
Sep 28, 2026
Merged

janicduplessis merged 1 commit into
mainfrom
fix/1831-inbox-row-alignment

Conversation

@janicduplessis

Copy link
Copy Markdown
Collaborator

Description

The Notifications inbox row's trailing action Button sized to its own label ("Open workspace" vs "Show device" vs "Open pull request"), so the timestamp next to the title shifted horizontally row to row. .top alignment also left the button reading as vertically centered against the top-pinned dot and icon, while the timestamp sat flush with the title line. Maintainer report: "Can we have better alignment here."

Before:

before

Solution

In InboxRow (apps/desktop/Sources/StimDesktop/Views/InboxView.swift):

  • Fixed-width action-button column, sized to the widest of OversightTarget's six possible labels (Notices.swift's new actionTitles) via a ZStack of hidden Text views in the button's own font/padding, so it tracks the app's font instead of a hardcoded point width.
  • Timestamp moved out of the title HStack into its own trailing group, right before the button. With the button now fixed-width and nothing following it, the timestamp's trailing edge lands at a constant x for free, no explicit frame needed.
  • Row HStack switched from .top to .center, dropping the .padding(.top, ...) hacks that had approximated baseline alignment. Dot, icon, timestamp, and button now all center on the row's two-line text block.

Test plan

Built and ran a Stim Desktop test copy on the Mac mini, seeded with entries covering all six action labels, read/unread rows, and a quiet-hours entry (longer "9:45 AM · Quiet hours" detail text). Verified:

  • Timestamps and buttons line up across rows regardless of label or detail-text length, light and dark.
  • Clicking a button still opens its target and marks the row read; a live notification that arrived mid-test slotted into the same aligned layout.
  • At 700 pt window width, titles and subtitles truncate with an ellipsis while the timestamp and button columns hold their position.

After, light:

after light

After, dark:

after dark

After, 700 pt width (title/subtitle truncation):

after narrow

swift build and swift test (including InboxTests) pass.

Fixes #1831

…tons

The trailing action button sized to its own label ("Open workspace" vs
"Show device" vs "Open pull request"), so the timestamp before it, and the
outer HStack was top-aligned while the button read as vertically centered.

Move the timestamp out of the title line into its own trailing group, and
give the action button a column reserved to the widest of OversightTarget's
six possible labels (a ZStack of hidden labels sizes it, so it tracks the
button's own font). The button's fixed width also pins the timestamp's
trailing edge at a constant x across rows. Center everything -- icon, dot,
time, and button -- on the row's two-line text block.

Fixes #1831
@janicduplessis
janicduplessis marked this pull request as ready for review September 28, 2026 21:28
@janicduplessis
janicduplessis merged commit cd33764 into main Sep 28, 2026
1 check passed
@janicduplessis
janicduplessis deleted the fix/1831-inbox-row-alignment branch September 28, 2026 21:36
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.

desktop: polish tracking - notifications inbox row alignment

1 participant