Repository navigation
fix(desktop): put attached spine rows on the same leading grid as loose ones - #12773
Conversation
…se ones A strip of screen moments under its conversation sat 12pt right of the same strip standing on its own, because SpineRowView added SpineMetrics.attachmentIndent to the leading padding of attached rows. The offset made the same kind of row read as two different grids a group apart — a screenshot row's left edge moved depending on whether its group held a conversation. Attachment is still legible without the offset: the tighter attachedGap above the row, the conversation's timestamp speaking for it, and no rail node. So the indent is gone and every row — conversation card, memories, tasks, strips — starts at gutter + gutterGap. Doc comments that described the indent are updated to describe the grid. The invariant is held by a mounted-view test: an attached strip and a loose strip must report the same leading x (it fails at 96 vs 84 with the indent restored).
There was a problem hiding this comment.
3 issues found across 7 files
Confidence score: 4/5
SpineRowLeadingGridTests.swiftdoes not verify the claimed 84 pt leading grid, so a future regression could preserve equality between attached and loose rows while shifting both to the wrong position — assert the expectedgutterWidth + gutterGapvalue directly.SpineRowViews.swiftleavesSpineRowView.showsIndentcontrolling only vertical spacing, which could mislead maintainers or callers expecting horizontal indentation behavior — rename, remove, or document the flag and add coverage for its intended effect.SpineStream.swiftdocuments memories and frames but not attached task rows, leaving the stream contract incomplete — update the documentation to include conversation-produced attached tasks.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/Desktop/Sources/MainWindow/Spine/SpineRowViews.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Spine/SpineRowViews.swift:93">
P3: `SpineRowView.showsIndent` no longer controls any horizontal indent after this change — the `.leading` padding is now always `gutterGap`, and `attachmentIndent` is gone. The flag now only controls vertical air (`isNested` → `attachedGap` vs `rowGap`) and suppressing per-row timestamps, both with the parameter passed from `SpineStream.show` as `store.kind == .everything`. The name reads as if it still offsets the row's leading edge, which contradicts the new "one leading grid" intent. Rename it (e.g. `showsAttachment` or `showsNestedLayout`) in `SpineRowView` and at the call site in `SpineStream.swift` so the identifier matches what it actually does.</violation>
</file>
<file name="desktop/macos/Desktop/Tests/SpineRowLeadingGridTests.swift">
<violation number="1" location="desktop/macos/Desktop/Tests/SpineRowLeadingGridTests.swift:48">
P3: The test only asserts that the attached strip's leading x equals the loose strip's leading x, but the fix (and the PR's own verification) claims every row starts at `gutterWidth + gutterGap` (84 pt). If a future change shifts the whole leading grid for every row together — for example by re-adding a leading offset inside `SpineRowView`'s own HStack rather than to attached rows alone — both `attached` and `loose` move together and this test still passes, silently letting the strip leave the documented grid. Pin the absolute value as well as the relative equality.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Spine/SpineStream.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Spine/SpineStream.swift:10">
P3: The stream documentation still omits attached task rows. `SpineComposer` marks conversation-produced tasks as attached too, so mention tasks alongside memories and frames to keep this contract accurate.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| let row: SpineRow | ||
| /// True while the whole spine is shown, so attached rows indent. Soloed rows pass `false` and | ||
| /// state their own time instead. | ||
| /// True while the whole spine is shown, so an attached row tucks in close under the conversation |
There was a problem hiding this comment.
P3: SpineRowView.showsIndent no longer controls any horizontal indent after this change — the .leading padding is now always gutterGap, and attachmentIndent is gone. The flag now only controls vertical air (isNested → attachedGap vs rowGap) and suppressing per-row timestamps, both with the parameter passed from SpineStream.show as store.kind == .everything. The name reads as if it still offsets the row's leading edge, which contradicts the new "one leading grid" intent. Rename it (e.g. showsAttachment or showsNestedLayout) in SpineRowView and at the call site in SpineStream.swift so the identifier matches what it actually does.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Spine/SpineRowViews.swift, line 93:
<comment>`SpineRowView.showsIndent` no longer controls any horizontal indent after this change — the `.leading` padding is now always `gutterGap`, and `attachmentIndent` is gone. The flag now only controls vertical air (`isNested` → `attachedGap` vs `rowGap`) and suppressing per-row timestamps, both with the parameter passed from `SpineStream.show` as `store.kind == .everything`. The name reads as if it still offsets the row's leading edge, which contradicts the new "one leading grid" intent. Rename it (e.g. `showsAttachment` or `showsNestedLayout`) in `SpineRowView` and at the call site in `SpineStream.swift` so the identifier matches what it actually does.</comment>
<file context>
@@ -93,8 +90,8 @@ enum SpineMetrics {
let row: SpineRow
- /// True while the whole spine is shown, so attached rows indent. Soloed rows pass `false` and
- /// state their own time instead.
+ /// True while the whole spine is shown, so an attached row tucks in close under the conversation
+ /// above it. Soloed rows pass `false` and state their own time instead.
let showsIndent: Bool
</file context>
| XCTAssertGreaterThan(loose, 0, "the strip should sit past the gutter") | ||
| XCTAssertEqual( | ||
| attached, loose, accuracy: 0.5, | ||
| "a strip attached to the conversation above it must share the leading grid of a loose strip; " |
There was a problem hiding this comment.
P3: The test only asserts that the attached strip's leading x equals the loose strip's leading x, but the fix (and the PR's own verification) claims every row starts at gutterWidth + gutterGap (84 pt). If a future change shifts the whole leading grid for every row together — for example by re-adding a leading offset inside SpineRowView's own HStack rather than to attached rows alone — both attached and loose move together and this test still passes, silently letting the strip leave the documented grid. Pin the absolute value as well as the relative equality.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Tests/SpineRowLeadingGridTests.swift, line 48:
<comment>The test only asserts that the attached strip's leading x equals the loose strip's leading x, but the fix (and the PR's own verification) claims every row starts at `gutterWidth + gutterGap` (84 pt). If a future change shifts the whole leading grid for every row together — for example by re-adding a leading offset inside `SpineRowView`'s own HStack rather than to attached rows alone — both `attached` and `loose` move together and this test still passes, silently letting the strip leave the documented grid. Pin the absolute value as well as the relative equality.</comment>
<file context>
@@ -0,0 +1,105 @@
+ let loose = try stripLeadingX(row: momentsRow(isAttached: false))
+ let attached = try stripLeadingX(row: momentsRow(isAttached: true))
+
+ XCTAssertGreaterThan(loose, 0, "the strip should sit past the gutter")
+ XCTAssertEqual(
+ attached, loose, accuracy: 0.5,
</file context>
| XCTAssertGreaterThan(loose, 0, "the strip should sit past the gutter") | |
| XCTAssertEqual( | |
| attached, loose, accuracy: 0.5, | |
| "a strip attached to the conversation above it must share the leading grid of a loose strip; " | |
| XCTAssertGreaterThan(loose, 0, "the strip should sit past the gutter") | |
| XCTAssertEqual( | |
| attached, loose, accuracy: 0.5, | |
| "a strip attached to the conversation above it must share the leading grid of a loose strip; " | |
| + "attachment is air and the rail, not a horizontal offset") | |
| XCTAssertEqual( | |
| loose, SpineMetrics.gutterWidth + SpineMetrics.gutterGap, accuracy: 0.5, | |
| "every row — attached or loose — starts at gutter + gutterGap") |
| // | ||
| // **What it owns is the reading order.** One merged reverse-chronological stream grouped by day, with | ||
| // the conversation dominant and the memories and frames it produced indented beneath it — and an hour | ||
| // the conversation dominant and the memories and frames it produced attached beneath it — and an hour |
There was a problem hiding this comment.
P3: The stream documentation still omits attached task rows. SpineComposer marks conversation-produced tasks as attached too, so mention tasks alongside memories and frames to keep this contract accurate.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Spine/SpineStream.swift, line 10:
<comment>The stream documentation still omits attached task rows. `SpineComposer` marks conversation-produced tasks as attached too, so mention tasks alongside memories and frames to keep this contract accurate.</comment>
<file context>
@@ -7,7 +7,7 @@
//
// **What it owns is the reading order.** One merged reverse-chronological stream grouped by day, with
-// the conversation dominant and the memories and frames it produced indented beneath it — and an hour
+// the conversation dominant and the memories and frames it produced attached beneath it — and an hour
// rail beside it running the same direction the list does.
//
</file context>
| // the conversation dominant and the memories and frames it produced attached beneath it — and an hour | |
| // the conversation dominant and the memories, tasks, and frames it produced attached beneath it — and an hour |
What changed and why
On the Activity spine, a strip of screen moments hanging under its conversation sat 12 pt right of the same strip standing on its own, because
SpineRowViewaddedSpineMetrics.attachmentIndentto the leading padding of attached rows. The same kind of row read as two different grids a group apart — a screenshot row's left edge moved depending on whether its group held a conversation. The same offset applied to attached memories and tasks.Attachment stays legible without the offset: the tighter
attachedGapabove the row, the conversation's timestamp speaking for it, and no rail node. The indent is gone, so every row — conversation card, memories, tasks, strips — starts atgutter + gutterGap. Doc comments that described the indent now describe the one leading grid.Product invariants affected
none
How it was verified
omi-activity-alignment, macOS 26, 2× display): seeded one strip inside a conversation's window (renders attached, subtitle "2 screen moments") and one outside all windows (renders standalone with its own timestamp). In-process window capture: the loose strip's tile left edge measures 582 px and the attached strip's tile left edge 582 px — Δ 0.0 pt. On the pre-fix build the same comparison measures 24 px = 12.0 pt, exactlyattachmentIndent../scripts/agent-logic-harness.sh --cross-surface-smokegreen../scripts/swift-format-wrapper.sh lintclean on changed files.Tests
New
Desktop/Tests/SpineRowLeadingGridTests.swiftmountsSpineRowViewin a realNSHostingView(ordered, parked window) and asserts an attached moments strip and a loose moments strip report the same leading x. With the indent restored the test fails at 96.0 vs 84.0; with this fix it passes at 84.0/84.0. Full spine scope:xcrun swift test --filter Spine— 60 tests, 0 failures.Failure class (fixes)
Failure-Class: none