Skip to content

tui: sweep reasoning-fragment interactions for per-delta flush - #660

Merged
glemsom merged 2 commits into
mainfrom
658-reasoning-fragment-interaction-sweep
Aug 29, 2026
Merged

tui: sweep reasoning-fragment interactions for per-delta flush#660
glemsom merged 2 commits into
mainfrom
658-reasoning-fragment-interaction-sweep

Conversation

@glemsom

@glemsom glemsom commented Aug 29, 2026

Copy link
Copy Markdown
Owner

What

Follow-up to #657 (live reasoning per delta): with a turn splitting into many reasoning fragments, every per-block interaction over those fragments must stay correct — Tab focus, per-block Enter expand/collapse, the expand-all / collapse-all modes, and follow.

Changes

  • collapsibleBlocks enumerates every emitted live fragment (AC1): a live turn's flow flushes one reasoning fragment per delta (issue Live reasoning streams per-delta in the merged transcript flow #657), so the block focus now owns one block per emitted fragment in emission order — fragments on both sides of a tool entry included. Previously the enumeration merged consecutive deltas per tool-boundary run, so Tab could never reach most of a per-delta burst. Gated (thinking-off) live turns enumerate no phantom blocks.
  • Per-fragment Enter pins are independent and durable (AC2): toggling a focused per-delta fragment collapses exactly that fragment; pins are keyed on the render-time fragment index, so a user's choice survives the continuing stream burst. Turn-commit cleanup (existing) still folds the turn's reasoning to one snapshot block.
  • Collapse-all now covers live fragments too (AC3): the streaming auto-expand yields to the hide-every-body mode, so E collapses every fragment of a live burst; a focused fragment's Enter pin still re-expands just it against the mode, and ctrl+e covers every fragment again.
  • Follow regression-locked (AC4): a test pins the viewport to the newest output through a 40-delta reasoning burst.
  • Emission-order rendering (AC5): the with-tool fixture locks that fragments on both sides of a tool entry stay focusable in the order the flow renders them.

Tests

New internal/tui/fragment_sweep_test.go covers each AC at the transcript and model level (7 tests). Full internal/tui suite green; go vet clean. (Pre-existing bwrap-dependent failures in internal/engine/internal/app are environmental and unrelated.)

Docs

CONTEXT.md: the "Expansion / collapse" glossary entry now states the per-delta block unit.

Fixes #658

A live turn's flow now flushes one reasoning fragment per delta, so the
per-block interactions over those fragments must enumerate every emitted
fragment rather than the tool-boundary runs the pre-per-delta focus owned.

- collapsibleBlocks enumerates one focusable block per emitted live
  fragment, in emission order, fragments on both sides of a tool entry
  included; gated (thinking-off) live turns enumerate none
- Enter on a focused fragment pins exactly that fragment, so per-fragment
  collapse survives a continuing stream burst
- collapse-all (E) now covers every live fragment too; the live auto-expand
  yields to the hide-every-body mode, and a focused fragment's Enter pin
  still re-expands against it
- follow stays pinned through per-delta bursts (regression-locked)

Fixes #658
- thinkingExpandedForBlock doc comment no longer claims live blocks stay
  open regardless of mode; it names the collapse-all exception
- modernize the new burst loop to Go 1.26 integer range
- simplify the Tab-cycle assertion to explicit expected blocks
@glemsom
glemsom merged commit 6bbed7e into main Aug 29, 2026
1 check passed
@glemsom
glemsom deleted the 658-reasoning-fragment-interaction-sweep branch August 29, 2026 10:25
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.

Reasoning-fragment interaction sweep: focus, expand/collapse, follow

1 participant