Skip to content

Compact mode: one collapsed work accordion per turn - #371

Open
senxd wants to merge 1 commit into
zeronsh:mainfrom
senxd:compact-mode
Open

senxd wants to merge 1 commit into
zeronsh:mainfrom
senxd:compact-mode

Conversation

@senxd

@senxd senxd commented Sep 15, 2026

Copy link
Copy Markdown

Summary

Compact Mode adds a secondary accordion layer that compacts all agent work in the stream — thinking, tool calls, commands, narration text, and agent/spawn activity — into a single collapsed accordion per turn, reducing work clutter so the transcript reads as just the replies. The full detail stays one click away and remains comprehensible (the same tree, chips, and expandable details as before — just nested one level deeper).

  • Opt-in, persisted setting: Settings → Appearance → "Compact mode" (transcriptCompactMode, default off — existing behavior is untouched when disabled)
  • Each assistant turn renders as: one collapsed work accordion + the final reply. While streaming, nothing expands — in-progress narration folds in as a "Wrote" chip and the header keeps its working shimmer until the turn settles
  • The reply boundary is the trailing run of non-empty text parts, so split/multi-part responses all surface; turns that end on work show only the accordion
  • Input questions and error chips stay outside the fold so a blocking prompt or failure still surfaces
  • Reuses the existing tool-group accordion, fold animations, and detail rendering — no parallel component

Implementation

  • rows_for_entry gains a compact flag: computes the reply boundary, accumulates all foldable parts into one group ({entry}#work, auto_open: false always) emitted at the first foldable position
  • ToolItem.is_thoughtkind: ToolItemKind { Call, Thought, Note }; folded narration becomes a synthesized Note chip ("Wrote · first line", pen icon, expandable detail flattened like a thought's)
  • tool_group_summary names notes too — e.g. "Thought 2 times · wrote a note · Ran 3 commands"
  • Transcript polls the setting each frame; a flip re-syncs rows, with the mode mixed into the row-cache fingerprint's high bit
  • Detail defaults are gated so nothing inside the fold self-opens (including live thought details while streaming)

Test plan

  • cargo check -p zeron-ui, cargo test -p zeron-ui --lib transcript — 83 pass, incl. 4 new tests (merged group, collapsed-during-streaming, reply-run boundary, input/error visibility)
  • cargo fmt clean
  • Manual: toggle Compact mode in Appearance; verify normal mode unchanged, streaming shows only the collapsed accordion, reply appears on settle

Generated with Devin


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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