Skip to content

fix(desktop): put attached spine rows on the same leading grid as loose ones - #12773

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/activity-screenshot-left-padding
Sep 5, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/activity-screenshot-left-padding

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

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 SpineRowView added SpineMetrics.attachmentIndent to 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 attachedGap above 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 at gutter + gutterGap. Doc comments that described the indent now describe the one leading grid.

Product invariants affected

none

How it was verified

  • Reproduced the user-visible geometry on a named bundle built from this branch (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, exactly attachmentIndent.
  • ./scripts/agent-logic-harness.sh --cross-surface-smoke green.
  • ./scripts/swift-format-wrapper.sh lint clean on changed files.

Tests

New Desktop/Tests/SpineRowLeadingGridTests.swift mounts SpineRowView in a real NSHostingView (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

Review in cubic

…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).

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 7 files

Confidence score: 4/5

  • SpineRowLeadingGridTests.swift does 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 expected gutterWidth + gutterGap value directly.
  • SpineRowViews.swift leaves SpineRowView.showsIndent controlling 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.swift documents 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Comment on lines +48 to +51
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; "

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
// 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

@Git-on-my-level
Git-on-my-level merged commit 6e53bbd into main Sep 5, 2026
31 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/activity-screenshot-left-padding branch September 5, 2026 05:24
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