Skip to content

fix(desktop,mobile): keep a long reply whole instead of folding its notes away - #1627

Merged
huichen merged 1 commit into
mainfrom
pr/huichen
Nov 16, 2026
Merged

huichen merged 1 commit into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

A settled reply was folded onto its last paragraph, hiding everything before it behind the fold toggle. Measured on this machine's Agent store (4,713 replies with prose), that fold hid a median of 10 prose blocks and ~15 KB per reply, and in 78% of replies more than half of the prose — so a long run that narrates its work between tool calls read as a single line (one reported reply showed 59 characters of 7,221). This PR puts a ceiling on the fold: a reply that would hide more than two prose blocks or more than 800 characters is returned whole, on both the desktop and the phone.

Commits

  • fix(desktop,mobile): keep a long reply whole instead of folding its notes away — the same ceiling and the same tests on the desktop (replyBlocks.ts) and the phone (ReplyBlocks.tsx); 5.5% of replies still fold, hiding a median 26% of their prose.

Verification

Local, at 5bd6e5e97, Node 26.3.0, ulimit -n 8192:

  • desktop: npx tsc --noEmit clean; npx eslint src/features/agent/replyBlocks.ts src/features/agent/replyBlocks.test.ts clean; npx vitest run src/features/agent/replyBlocks.test.ts → 23 passed
  • mobile: npx tsc --noEmit clean; npx jest --runInBand src/features/chat/__tests__/replyBlocks.test.ts → 12 passed
  • No Rust crate is touched by this branch, so no cargo checks were run.

User-visible changes

  • Folding of a settled reply. Before: any reply with intermediate notes folded to its last paragraph, hiding a median of 10 prose blocks / ~15 KB (78% of replies lost more than half their prose). After: a reply that would hide more than two prose blocks or more than 800 characters is shown whole; 5.5% of replies still fold, hiding a median 26% of their prose. Applies to desktop and mobile alike. Revert: commit 5bd6e5e97.

…otes away

A settled reply was folded onto its last paragraph, hiding everything
before it behind "查看过程". Measured on this machine's Agent store
(4,713 replies with prose): the fold hid a median of 10 prose blocks and
~15 KB per reply, and in 78% of replies more than half of all the prose.
A long run that narrates its work between tool calls therefore read as a
single line — one reported reply showed 59 characters of 7,221.

The fold only helps the commonplace shape: one answer with a couple of
notes on the way there. Past a ceiling of two hidden prose blocks or 800
hidden characters the reply is now returned whole. That leaves 5.5% of
replies folding, hiding a median 26% of their prose, so short replies keep
the convenience while a narrated run keeps its reasoning.

The desktop and the phone each carry this rule and must agree; both get
the same ceiling and the same tests.
@huichen
huichen enabled auto-merge (squash) November 16, 2026 02:18
@huichen
huichen merged commit c40584d into main Nov 16, 2026
12 checks passed
@huichen
huichen deleted the pr/huichen branch November 16, 2026 02:34
huichen added a commit that referenced this pull request Nov 16, 2026
#1627 put a ceiling on the fold — a reply stayed whole once it would hide
more than two prose blocks or 800 characters — so a completed reply that
narrated its work between calls came back as five paragraphs with its tool
rows interleaved, the shape the `detailed` display level exists for. The
fold is not a judgement to make reply by reply: a settled reply is its
answer plus the work that produced it, and that work belongs behind one
row the reader can open, however much of it there is. A reader who wants
the work in place picks `detailed` once, in settings.

Streaming is unchanged and was never part of the ceiling: while the reply
is being written nothing is folded away.

Drops FOLD_PROSE_BLOCKS / FOLD_PROSE_CHARS from both clients and the tests
that pinned them; the tests now pin the opposite — a reply narrating ten
notes, or thousands of characters of them, still folds onto its last
prose. Both clients keep the same rule and the same cases.
huichen added a commit that referenced this pull request Nov 16, 2026
…1632)

#1627 put a ceiling on the fold — a reply stayed whole once it would hide
more than two prose blocks or 800 characters — so a completed reply that
narrated its work between calls came back as five paragraphs with its tool
rows interleaved, the shape the `detailed` display level exists for. The
fold is not a judgement to make reply by reply: a settled reply is its
answer plus the work that produced it, and that work belongs behind one
row the reader can open, however much of it there is. A reader who wants
the work in place picks `detailed` once, in settings.

Streaming is unchanged and was never part of the ceiling: while the reply
is being written nothing is folded away.

Drops FOLD_PROSE_BLOCKS / FOLD_PROSE_CHARS from both clients and the tests
that pinned them; the tests now pin the opposite — a reply narrating ten
notes, or thousands of characters of them, still folds onto its last
prose. Both clients keep the same rule and the same cases.
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