Skip to content

feat(mobile): fold a reply's step rows into one summary line - #656

Merged
huichen merged 1 commit into
mainfrom
claude/mobile-step-group
Sep 16, 2026
Merged

huichen merged 1 commit into
mainfrom
claude/mobile-step-group

Conversation

@huichen

@huichen huichen commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Why

A long exchange on a phone produces a dozen thinking/tool rows, each a full line, and they crowd out the prose between them — the transcript reads as an unbroken column of 思考中 / 已运行 / 思考中 / 已运行. Desktop (with the "show thinking" setting off, its default) does not have this problem: thinking segments render nothing, and consecutive same-kind completed bursts are already folded by the shared projection.

What

Fold consecutive foldable step slices of an assistant reply into one summary line, expanded on tap:

🧠 已思考 2 次 · 已运行 3 次 · 已写入 1 次   ⌄     ← one line instead of six
    ├ 已思考   ⌄                                  ← each row still opens its own detail
    ├ 已运行   ⌄
    └ …
  • Prose splits the reply into separate runs, so step order relative to the text is preserved and never reordered.
  • Nothing that is still changing is hidden: failed calls, running calls, and the tail slice of a streaming reply pass through unfolded — a failure is the one row the user must not have to dig for.
  • Emphasis on the two-tap flow the user asked for: tap the summary to get the rows, then tap a row for its detail (reasoning text / full shell command / a burst's individual commands).

Notes

  • Render-only. buildReplyBlocks is applied in the view; the shared @future-os/thread-projection output is untouched, so the desktop transcript and the wire contract are unaffected.
  • Reuses the existing chat.runCount key for the aggregation — no new locale strings.
  • Also settles a small inconsistency visible in the screenshots: a finished reasoning slice inside a settled reply used to still read "思考中" in the folded region/expanded list; it now reads "已思考".

Tests

Four cases in TimelineCard.test.ts: folding into one summary line, two-tap drill-down to detail, failures never folding, and the streaming tail staying visible.

Local (module-scoped, mobile only): npm run typecheck ✅ · npm run lint ✅ · npm test — 95 suites / 1332 tests ✅

A long exchange produces a dozen thinking/tool rows, each a full line on a
phone-sized transcript, and they crowd out the prose between them. Fold
consecutive foldable step slices into a single summary line ("Thought 2× ·
Ran a command 3×") that opens into the individual rows, each of which still
expands to its own detail.

Prose, compaction dividers, failed calls, and the slice a streaming reply is
still on pass through unfolded — nothing that is still changing is hidden.
Render-only: the shared projection still carries every slice in stream order,
so the desktop transcript is unchanged.
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