Skip to content

Chat turns should be collapsible sections, auto-folded when a new turn starts #34

Description

@dnviti

Problem / Motivation

A long conversation is one very tall wall of text. Every turn the agent takes stays fully expanded forever, so by the tenth exchange the scrollback is dominated by work the user has already read and finished with. Finding the reply from three asks ago, or simply keeping the current exchange in view, means scrolling past thousands of lines of settled history.

Each turn already has a header rule of its own that says which turn you are in and what it cost, and there is a rail for jumping between turns — but neither of them lets you actually put a finished turn away.

Goal

Turns behave like collapsible sections. When a new turn starts, the previous ones fold themselves shut so the conversation stays focused on what is happening now; the user can open or close any turn at any time.

Scope

  • A turn's header acts as a control that folds and unfolds that turn's contents, with a clear open/closed indication.
  • Starting a new turn automatically collapses the turns that came before it.
  • The user can expand any collapsed turn, and can collapse the current one, at will. A turn the user has deliberately opened is not slammed shut again by the next turn starting.
  • A collapsed turn still shows enough to be recognised and chosen from — its number, what was asked, and its outcome summary — so folding history does not mean losing the map of it.
  • Collapsing and expanding does not move the reader: the conversation should not jump to a different position because a turn above changed height.
  • Jumping to a turn from the turn rail, or landing on a result from search, opens that turn if it was collapsed rather than scrolling to something invisible.
  • Per-turn actions that live on the header (copying the turn, branching from it) keep working while the turn is collapsed.
  • The fold state is reachable by keyboard and announced to assistive technology as an expandable section.
  • A way to open or close everything at once, for when the user wants the whole history back.

Non-goals

  • Changing how turns themselves are defined or grouped.
  • Collapsing individual pieces inside a turn (single tool calls, reasoning, diffs) — those already have their own behaviour and are unaffected.
  • Remembering fold state across a page reload or session resume; a freshly opened conversation may start from the default (history folded, latest turn open).
  • Any change to the turn rail, the activity timeline, or the terminal split beyond making them respect a collapsed turn.

Acceptance Criteria

  • Every turn in the conversation can be folded and unfolded from its own header.
  • Sending a new message collapses the preceding turns and leaves the new one open.
  • A user-expanded turn stays expanded when the next turn begins.
  • A collapsed turn shows its number, the ask it started from, and its summary line.
  • Folding or unfolding a turn above the current reading position does not visibly shift the conversation under the reader.
  • Choosing a collapsed turn from the turn rail expands it and brings it into view.
  • A search result inside a collapsed turn expands that turn when opened.
  • Copy-turn and branch-from-turn work from a collapsed turn's header.
  • The fold control is operable by keyboard and exposes its expanded/collapsed state to screen readers.
  • Expand-all / collapse-all is available and applies to the whole conversation.

Open Questions

  • Should the very first turn of a conversation stay open, or fold like the rest once work moves on?
  • When a turn fails, should it resist auto-collapse so the failure stays visible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions