Files
pipelines/app/notes/chat-reasoning-chip.md

1.7 KiB

Chat reasoning chip

User request: reasoning expanded differently from tools; make it the same as tools.

  • Reasoning is now ChatReasoningChip (lib/features/chat/ui/transcript/chat_reasoning_chip.dart), built on the shared ChatTurnChip: lightbulb icon, Reasoning / Reasoning · N steps, chevron, accessible name ... , expand for details. It opens the same native sheet (Material bottom sheet / Cupertino popup) listing every step as plain selectable text (STEP n headings when there are several), as the old inline disclosure did (no markdown).
  • Footer order: reasoning, tools, permissions, model label (chat-message-footer Wrap). The inline disclosure (chat_reasoning_disclosure.dart) is removed; this supersedes the inline layout in per-message-reasoning-footer.md.
  • The chip spins while the turn streams and reasoning is its newest part; once an answer or tool call follows, it shows its icon (a running tool spins its own chip).
  • An open sheet follows live deltas: the chip state owns a notifier the sheet listens to, updated after each rebuild of the turn (one frame later, since the sheet is another route). If the row leaves the tree, the open sheet keeps its last steps and closes cleanly.
  • Behaviour change: a newly streaming reply no longer shows its reasoning inline without a tap; the operator opens the chip (a modal must not pop up by itself).

Evidence: full flutter test passes (1,865), flutter analyze clean. Browser probe tool/chat_message_probe.{dart,mjs} now also has a live turn whose step grows every 0.5 s; both hosts passed, including OCR that the open sheet's tick advanced (Material 36 -> 42, Cupertino 38 -> 45). Captures: build/reasoning-chip-{material,cupertino}/. No device verification.