Skip to content

feat(message): add thinking blocks with live streaming - #5

Open
lovec741 wants to merge 1 commit into
jeffy5:mainfrom
lovec741:feat/thinking-blocks
Open

feat(message): add thinking blocks with live streaming#5
lovec741 wants to merge 1 commit into
jeffy5:mainfrom
lovec741:feat/thinking-blocks

Conversation

@lovec741

Copy link
Copy Markdown

Summary

  • render model reasoning as collapsible thinking blocks: "Thinking…" + spinner while active, "Thought for Xs" when done, muted gray markdown body, tap header to expand/collapse
  • stream reasoning live by applying message.part.delta to reasoning parts (server sends field: "text" regardless of target part type, so the reducer routes deltas by target part type)
  • auto-expand thinking toggle in settings (default off, persisted); toggle is view-only — deltas always accumulate, so flipping it mid-stream reveals the backlog instantly
  • snap reasoning body to full text when the part completes instead of trailing the typewriter into the answer
  • show existing backlog immediately when expanding mid-stream (no replay from zero)
  • follow list auto-scroll while reasoning grows; per-part expand state survives list rebuilds (mirrors tool expansion pattern)
  • add EN/zh l10n strings and tests for reducer, dispatcher, widget, and settings persistence

Verification

  • dart format .
  • flutter analyze --no-pub
  • flutter test --no-pub (184 tests, 6 new)

AI disclosure

This change was co-written by GLM-5.3-Flash.
I read and reviewed all of the code, tried to match it to the codebase conventions, and tested it on Android.

Notes

Thanks for the project! I have been using it for a couple of months and it has been very useful!
I want to add a couple of the features that I have been missing. I am starting with this one and I am considering adding message undo next.

Render reasoning parts as collapsible thinking blocks and apply
message.part.delta events to reasoning parts (deltas use field
"text" regardless of target part type). Streaming behavior is
controlled by an auto-expand toggle in settings.
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