Skip to content

feat(reader): keep narration visible and summarise folded process between body blocks - #68

Closed
Adamaik wants to merge 3 commits into
aa2246740:cursor/better-display-021-rc2-ce8ffrom
Adamaik:feat/narration-process-seams
Closed

Adamaik wants to merge 3 commits into
aa2246740:cursor/better-display-021-rc2-ce8ffrom
Adamaik:feat/narration-process-seams

Conversation

@Adamaik

@Adamaik Adamaik commented Oct 20, 2026

Copy link
Copy Markdown

Problem

Collapsing a turn's process also folded assistant narration (the body text a step emits between reasoning and tool calls). Once a long intermediate report scrolled past, it could not be read again: after the turn closed, isEarlierNarration() classified those body steps as process content, and the Reader rendered them inside ProcessFragment / RetiringContent disclosures. During a live turn the same text was also swallowed by the live fold (思考×N · 输出×M · 工具×K).

The reader also needs an explicit boundary between two narration blocks: previously nothing showed that a folded process run sat between them, so consecutive reports read as one block (or, in an earlier local iteration, body text was styled like annotation chrome).

Change

  • Narration is always visible. Assistant body segments (text / image / other blocks) render as ordinary 16px primary body prose. They never enter a process disclosure, keep no annotation colour/indent/left rule, and only the final answer keeps copy/fork actions.
  • The process rail moves out of the text. When collapsed reasoning/tool rows sat between two body blocks, the gap now carries a compact process-chain summary: a 1px --reader-rail rule plus the familiar 思考×N · 工具×K · 记录×M label and chevron. It counts only the rows folded between those two body blocks and expands the real rows in place when clicked (same disclosure language as the turn's folded-process row).
  • hasProcessContent only advertises literal reasoning. Body-only steps no longer create an empty thinking disclosure; earlier narration is no longer foldable process content.
  • Live fold chains break at narration. A new reasoning step may collapse the reasoning/tool run on its side of the narration, never the narration itself; fold summaries never count narration as 输出×N.
  • Failure / interruption / blocked / unknown terminals and auto-fold-off behavior are unchanged.

Verification

  • pnpm exec tsc -p tsconfig.json --noEmit — passes.
  • node --import tsx/esm --test tests/*.test.ts — 188 tests, 187 pass, 0 fail, 1 skipped (the skip is pre-existing).
  • Real-Reader browser fixture tests/browser-commentary.tsx via node scripts/verify-commentary-visible.mjs --mode=green — 11/11 checks pass, including:
    • completed/collapsed: report body visible without expanding, not inside any fold, final answer intact;
    • top disclosure expands reasoning/tool rows in source order between body blocks and collapses back without hiding the body;
    • open turn: narration not hidden by the live fold;
    • auto-fold off / failed / interrupted turns;
    • between-paragraph seam: 1px rail, 思考×N label, geometry strictly between adjacent body blocks, click expands reasoning and collapses back to seams.
  • --mode=red reproduces the old behavior on both the 0.3.4 and 0.3.9 baselines (body absent from the DOM while collapsed, report text inside [data-reader-process], live fold counting it as 输出×1).

Stacking

This branch is stacked on #67 (cursor/better-display-021-rc2-ce8f), the still-draft Harness 0.2.1-rc.2 adaptation. Retarget to main once #67 merges; the commit diff here is only the narration/seam work on top of that branch.

wangzi045 added 3 commits October 20, 2026 11:53
Narration (assistant body segments) is display content, not process detail.
It now stays visible as ordinary body prose when the process folds, and the
folded reasoning/tool run between two body blocks becomes a compact
process-chain summary in the gap: 1px --reader-rail rule plus the familiar
思考×N · 工具×K label with a chevron that expands the real rows in place.

- projection: hasProcessContent only advertises literal reasoning; earlier body
  steps no longer count as foldable process content.
- Reader: body segments render with normal answer typography (no annotation
  colour, indent or per-block left rule); only the final answer keeps
  copy/fork actions. A per-turn seam plan counts the rows folded between
  consecutive body blocks and renders the process-chain summary seam.
- live-turn: body narration is a fold-chain boundary; fold boxes contain only
  reasoning/tool/record steps and summaries never count narration as 输出×N.
- tests: projection/live-turn/fold-choreography contracts updated; a real-Reader
  browser fixture verifies red (both 0.3.4 and 0.3.9 baselines hide narration)
  and green (always-visible body, seam geometry, expand/collapse interaction,
  auto-fold off, failed and interrupted turns).
Live folding used to break its chain at every narration block, so any turn
that alternated thinking and report text left every past reasoning card
expanded while it ran (only folding again after the turn closed).

presentLiveTurn now splits at user inserts and, once a later reasoning step
exists, folds each earlier reasoning/tool run at its own source position. The
latest reasoning and everything after it stay open; narration continues to
render in place and never enters a fold box.

- live-turn: replace splitChain with the per-segment run folding described
  above (fold keys remain live-fold:<first step key> so rows keep identity).
- tests: live-turn/fold-choreography/fold-intensity contracts updated for
  cross-narration folding and user-insert chain resets.
- fixture: open-turn check now requires exactly one 思考×1 fold, the earlier
  reasoning hidden, and narration visible between the folds and latest reasoning.
- docs: lifecycle wording updated.
aa2246740 added a commit that referenced this pull request Oct 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aa2246740 added a commit that referenced this pull request Oct 26, 2026
, #74 and CI lint

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aa2246740

Copy link
Copy Markdown
Owner

Thanks! The feature commits from this PR (32b046a, 3e0119d, with your authorship) are on main through #76 (merge commit 5f77e6f). They were rebased onto current main without the Harness 0.2.1-rc.2 adaptation and lib/ rebuild commits, which are out of scope here, so GitHub won't mark this PR merged and I'm closing it by hand.

On top of your work we added:

Real-host acceptance with real model turns passed: 4 reasoning runs and 3 tool calls, no duplicate seam in 9 live samples, and the closed seams expand in place. This ships in the next release.

@aa2246740 aa2246740 closed this Oct 26, 2026
LingMoe404 pushed a commit to LingMoe404/dsh-better-display that referenced this pull request Oct 29, 2026
An open turn folds an earlier reasoning/tool run in place. The narration
seam counted that same run again and, via data-reader-seam-after, dropped
the previous body's bottom spacing. Skip the seam only when every folded
step is already inside a live-fold cell. Closed turns still show the seam.

DESIGN.md now matches per-run live folds, and the Unreleased notes credit
@Adamaik (aa2246740#68) and @sugar-syl (aa2246740#73).

Also clear unused bindings that already failed eslint on main, including
the unused toolSummary helper, so npm run lint exits 0.
LingMoe404 pushed a commit to LingMoe404/dsh-better-display that referenced this pull request Oct 29, 2026
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.

2 participants