Skip to content

#1118 Open the live thought from the Thinking pill - #1127

Merged
ivanfenenko merged 3 commits into
mainfrom
feature/1118-live-thought-sheet
Nov 27, 2026
Merged

ivanfenenko merged 3 commits into
mainfrom
feature/1118-live-thought-sheet

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • While a thought streams at the end of the turn, the bottom-left turn pill reads Thinking instead of Working, and tapping it opens the thought in a sheet. Compacting, Retrying, Sending, requests and failures keep priority, as before.
  • The sheet follows the thought you opened. Its text keeps streaming in under "Thinking…", and when the thought ends the sheet stays open and settles to "Thought" with its duration.
  • The timeline still never prints a live thought (no new row), so Show one turn indicator across every timeline style #1098's single turn indicator stays.
  • Same behaviour on iOS and Android:
    • A pure resolver (SessionChatLiveThought) picks the live thought. It must be the newest visible part of the current turn; a following tool, text or file ends it.
    • The Screen Model owns liveThoughtPartId and presentedThought, resolved from the loaded messages on every publish, with openLiveThought / closeThought actions.
    • The sheet reuses the existing thought sheet layout.
  • Android: the tool result sheet's pinned header (eyebrow and subline, such as "Thought / Thinking…") now takes the sheet content inset, as on iOS. It sat flush against the sheet edge for every tool result sheet, including settled thoughts.
  • New string: session_chat.activity.action.show_thought ("Show thought"), read after "Thinking" by VoiceOver and TalkBack.

Checks

  • iOS: full OpenCode MobileTests suite passed (3769 tests). New SessionChatLiveThoughtTests (resolver, sheet, turn pill) and two Screen Model tests (open → stream → settle → close; idle session shows no Thinking pill).
  • Android: full :app:testDebugUnitTest passed. New SessionChatLiveThoughtTest and two SessionChatViewModelTest cases mirror the iOS ones.
  • node scripts/check-string-keys.mjs passed. ktlintCheck reports nothing in the changed files. gitleaks: no leaks.
  • Both apps run against the scenario harness (v2, released opencode 2.2.5 binary, reasoning-then-text at 20× pacing). Pill, live sheet, settle in place and close all verified on both.

Evidence

Screenshots in the evidence comment.

Issue

Fixes #1118

Risks / Follow-ups

  • Live-checked on v2 only: no v1 (1.x) opencode binary was available on the test machine. The rule reads the shared message model, which both protocols feed, and the unit tests cover it, but v1 streaming was not exercised in the app.
  • On v2 the server ends a thought only when the answer starts, so the sheet says "Thinking…" through the pause before the answer.
  • The sheet does not auto-scroll to follow new text, so a long thought grows below the fold. The prototype followed the end; this could be a follow-up.

While a thought streams at the end of the turn, the turn pill reads
Thinking and opens a sheet that follows that thought. The Screen Model
resolves the sheet from the loaded messages on every publish, so the text
streams in and settles in place as Thought with its duration. The
timeline still never prints a live thought.
@ivanfenenko

ivanfenenko commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

iOS (iPhone 18 Pro simulator) and Android (Pixel 9a emulator), protocol v2, scenario harness reasoning-then-text at 20× pacing. Harness data only.

Step iOS Android
1. Thought streaming: the turn pill reads Thinking, nothing new in the timeline iOS Thinking pill Android Thinking pill
2. Tap the pill: the thought streams into the sheet under "Thinking…" iOS live thought sheet Android live thought sheet
3. The thought ends: the open sheet settles in place with its duration iOS settled sheet Android settled sheet
4. Closed: the usual Thought row and the answer iOS after close Android after close

@ivanfenenko
ivanfenenko marked this pull request as ready for review November 27, 2026 15:09
The pinned header (eyebrow and subline, such as Thought / Thinking…) sat
flush with the sheet edge. Pinned content takes the sheet content inset,
as on iOS.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: no finding that 2+ of 3 passes agreed on.

2 finding(s) from a single pass, not posted
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/SessionChatLiveThought.kt:40 low: Whitespace-only text wrongly ends the live thought (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/SessionChatLiveThought.swift:27 low: Whitespace-only text wrongly ends the live thought (muse-spark-1.3-contributor)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.123 · 1 pass(es) stopped early

@ivanfenenko
ivanfenenko added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 883b4c2 Nov 27, 2026
18 checks passed
@ivanfenenko
ivanfenenko deleted the feature/1118-live-thought-sheet branch November 27, 2026 17:32
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.

[FEATURE] Can we increase the display of the thought chain?

1 participant