To-Do: align triaged rows into a table via fixed-width label column
When the inbox is triaged, badge widths varied with label length, so titles and subtexts didn't line up. Wrap the badge in TriageLabelCell, a fixed-width column whose width tracks the widest level label (hidden per-level sizer badges). Every row's title/subtext now starts at the same x; the visible pill stays snug and leading-aligned so the colored dots line up down the left edge. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
@@ -320,9 +320,11 @@ private struct TodoRow: View {
|
||||
// group (home screen) to reassign it. The trailing buttons stay tappable.
|
||||
HStack(spacing: 10) {
|
||||
// The triage badge replaces the lightbulb once the inbox is triaged, so
|
||||
// the impact level reads at a glance down the left edge.
|
||||
// the impact level reads at a glance down the left edge. When triaged the
|
||||
// badge sits in a fixed-width column (see TriageLabelCell) so every row's
|
||||
// title and subtext line up like a table, regardless of label length.
|
||||
if store.triageSortEnabled, let item = store.triageItem(for: todo.id) {
|
||||
TriageBadge(item: item)
|
||||
TriageLabelCell(item: item)
|
||||
} else {
|
||||
Image(systemName: "lightbulb")
|
||||
.foregroundStyle(.secondary)
|
||||
@@ -464,6 +466,25 @@ private struct TriageButton: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// The triage badge sized into a fixed-width column so every triaged row's title and
|
||||
/// subtext start at the same x — the inbox reads like a table. The column width tracks
|
||||
/// the widest level label automatically (hidden sizer badges, one per level), so it
|
||||
/// stays correct if the labels change. The visible badge is leading-aligned and snug,
|
||||
/// keeping the colored dots aligned down the left edge.
|
||||
private struct TriageLabelCell: View {
|
||||
let item: TriageItem
|
||||
|
||||
var body: some View {
|
||||
ZStack(alignment: .leading) {
|
||||
ForEach(TriageLevel.allCases, id: \.self) { level in
|
||||
TriageBadge(item: TriageItem(id: item.id, level: level, rank: item.rank))
|
||||
.hidden()
|
||||
}
|
||||
TriageBadge(item: item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A small colored badge showing an idea's triage level. The dot carries the hue (so
|
||||
/// any level reads clearly, even on light backgrounds); the reason shows on hover.
|
||||
private struct TriageBadge: View {
|
||||
|
||||
Reference in New Issue
Block a user