Skip to content

fix(mobile): return collapsed step rows to the right rail, targets to their own line - #671

Merged
huichen merged 1 commit into
mainfrom
fix/mobile-step-rail
Sep 16, 2026
Merged

huichen merged 1 commit into
mainfrom
fix/mobile-step-rail

Conversation

@huichen

@huichen huichen commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Device feedback on the folded step rows: the summary line and the lone tool rows read better as apparatus on the right rail, next to the live timer and the settled footer — the left column is for what the agent said.

#668 moved them left because of a real conflict: a revealed target inline beside the label claims the row's leftover width with flex: 1, which resolves to zero once the row shrink-wraps into a right-rail badge — the file name rendered at zero width — so folding and inline targets could not coexist. This takes the other way out.

  • Revealed targets take their own line. File names and shell commands now share the toolDetailText line below the header (shell already did), so the header is a one-liner with nothing to wrap, and the row can shrink-wrap again. Names wrap at full width instead of being clipped, and the chevron stops landing mid-sentence between the label and the path. The separate inlineToolTarget style goes away, along with its flex: 1 / maxHeight / overflow.
  • The rails from feat(mobile): right-align folded steps, generic tool glyph, pinch-zoom image previews #659/fix(mobile): one rail for step rows, revealed file names, self-loading inline images #660 come back. A row is a badge on the right rail while nothing of it is revealed, and falls into the reading column once it — or the run around it — is open. opened is required again, so no call site can silently pick a rail.
  • The run summary keeps its rail when it opens: the line the user just tapped does not move, and the rows it revealed appear below it, indented, on the left.
  • Collapsed reasoning gets its rule back on the right side, mirroring the left rule it has when open.

Not changed: the live timer and the settled footer were already on the right rail (#659/#662) and stay there.

What it looks like

Rendered side-by-side (same transcript, same tokens): collapsed state — 已运行 and 🔧×6 · 🧠×1 sit on the rail with the timer; expanded run — the tapped line stays put, its revealed rows and their targets read on the left; expanded file tool — the long name wraps on its own line, indented under the label.

Validation

  • npm run typecheck — clean
  • npx eslint src/components/TimelineCard.tsx src/components/__tests__/TimelineCard.test.ts — clean
  • npx jest — 105 suites / 1469 tests pass

Regression coverage: the rail assertions from #660 are restored (folded summary and lone rows on the rail; opened rows and their detail off it) alongside #668's no-truncation assertions, plus a new check that a revealed target is a line of its own rather than a cell beside the label. Physical-device visual verification not performed.

… their own line

Two things had to be true at once, and the last change bought the second by
giving up the first: a revealed file name needs the row's leftover width, and a
row that shrinks to a right-rail badge has no leftover width to claim. Inline,
the target's `flex: 1` therefore resolved to zero inside the badge — the file
name was invisible — so #668 parked every row in the left reading column and
left the revealed target inline.

Put the target on its own line below the header and the conflict disappears. The
header goes back to a one-liner with nothing to wrap, so the row can shrink-wrap
again, and the target gets the full width at its own indent: names wrap instead
of being clipped, and the chevron stops landing mid-sentence between the label
and the path. Shell commands already worked this way; file targets now use the
same line, which also removes the separate `inlineToolTarget` style.

With the geometry free again, the rails from #659/#660 come back: a row is a
badge on the right rail while nothing of it is revealed, and falls into the
reading column once it — or the run around it — is open. The run summary keeps
its rail when it opens, so the line under the user's finger does not move while
the rows it revealed appear below it on the left. `opened` is a required prop
again, so no call site can pick a rail by accident.

Tests: the rail assertions from #660 are restored (folded summary and lone rows
on the rail; opened rows and their detail off it), together with #668's
no-truncation assertions, plus a check that the revealed target is a line of its
own rather than a cell beside the label.
@huichen
huichen enabled auto-merge (squash) September 16, 2026 15:32
@huichen
huichen merged commit 5d625a1 into main Sep 16, 2026
12 checks passed
@huichen
huichen deleted the fix/mobile-step-rail branch September 16, 2026 15:34
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