fix(desktop): align notifications inbox row timestamps and action buttons - #1835
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Notifications inbox row's trailing action
Buttonsized 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..topalignment 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:
Solution
In
InboxRow(apps/desktop/Sources/StimDesktop/Views/InboxView.swift):OversightTarget's six possible labels (Notices.swift's newactionTitles) via aZStackof hiddenTextviews in the button's own font/padding, so it tracks the app's font instead of a hardcoded point width.HStackinto 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.HStackswitched from.topto.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:
After, light:
After, dark:
After, 700 pt width (title/subtitle truncation):
swift buildandswift test(includingInboxTests) pass.Fixes #1831