Skip to content

feat(app): add /thinking command to toggle reasoning display in Web/desktop - #45247

Open
abh3po wants to merge 2 commits into
anomalyco:devfrom
abh3po:feat/thinking-toggle
Open

abh3po wants to merge 2 commits into
anomalyco:devfrom
abh3po:feat/thinking-toggle

Conversation

@abh3po

@abh3po abh3po commented Aug 26, 2026

Copy link
Copy Markdown

Adds a client-side /thinking slash command to the opencode web app that toggles the showReasoningSummaries setting, controlling whether the model's reasoning is surfaced in the timeline. Mirrors the TUI's /thinking command; it is NOT a server command, so the prompt-input submit path also intercepts "/thinking". Supports an optional "on"/"off" argument to force a state, and persists across sessions via the settings store.

  • Register the command under the existing "Session" category in use-composer-commands (matching the TUI's category)
  • Intercept "/thinking" (with optional on/off arg) in createPromptSubmit
  • Add i18n strings for the command + on/off toasts across all locales

Issue for this PR

Closes #44809

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

Manually tested to see that this is working

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

Adds a client-side /thinking slash command to the opencode web app that
toggles the showReasoningSummaries setting, controlling whether the
model's reasoning is surfaced in the timeline. Mirrors the TUI's
/thinking command; it is NOT a server command, so the prompt-input
submit path also intercepts "/thinking". Supports an optional "on"/"off"
argument to force a state, and persists across sessions via the
settings store.

- Register the command under the existing "Session" category in
  use-composer-commands (matching the TUI's category)
- Intercept "/thinking" (with optional on/off arg) in createPromptSubmit
- Add i18n strings for the command + on/off toasts across all locales

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@abh3po abh3po changed the title feat(app): add /thinking command to toggle reasoning display feat(app): add /thinking command to toggle reasoning display in Web/desktop Aug 26, 2026
4ebuRushka added a commit to 4ebuRushka/opencode that referenced this pull request Sep 8, 2026
Add collapsibleReasoning setting (default true) with persisted store,
i18n (62 locales) and UI toggles in both settings-general variants.
Render reasoning parts as collapsible cards in the style of tool calls
(brain icon, 80-char subtitle, TextShimmer only on active block,
max-height:320px scrollable body, copy button). Each reasoning part is
its own card with open/userInteracted state.

- Auto-collapse previous blocks in a chain: isLastPart via
  data.store.part[message.id].at(-1) — previous collapses immediately
  when next reasoning part appears, not at end of chain. Shimmer and
  PacedMarkdown streaming only on active (streaming && isLastPart).
- Auto-scroll inside card: scrollRef/innerRef signals, autoFollow flag
  (pause >40px from bottom, resume at bottom), ResizeObserver +
  MutationObserver + continuous RAF tick while open && streaming &&
  autoFollow — keeps tail visible during PacedMarkdown pacing and
  large gaps.
- Wire collapsibleReasoning through MessagePartProps -> Part ->
  message-timeline (settings.general.collapsibleReasoning()).

Complements anomalyco#45247 (/thinking toggle). Closes anomalyco#8789, anomalyco#14340, anomalyco#37115, anomalyco#21548,
partially anomalyco#28322. Refs anomalyco#7866, anomalyco#33906.

Co-authored-by: 4ebuRushka
4ebuRushka added a commit to 4ebuRushka/opencode that referenced this pull request Sep 17, 2026
Add collapsibleReasoning setting (default true) with persisted store,
i18n (62 locales) and UI toggles in both settings-general variants.
Render reasoning parts as collapsible cards in the style of tool calls
(brain icon, 80-char subtitle, TextShimmer only on active block,
max-height:320px scrollable body, copy button). Each reasoning part is
its own card with open/userInteracted state.

- Auto-collapse previous blocks in a chain: isLastPart via
  data.store.part[message.id].at(-1) — previous collapses immediately
  when next reasoning part appears, not at end of chain. Shimmer and
  PacedMarkdown streaming only on active (streaming && isLastPart).
- Auto-scroll inside card: scrollRef/innerRef signals, autoFollow flag
  (pause >40px from bottom, resume at bottom), ResizeObserver +
  MutationObserver + continuous RAF tick while open && streaming &&
  autoFollow — keeps tail visible during PacedMarkdown pacing and
  large gaps.
- Wire collapsibleReasoning through MessagePartProps -> Part ->
  message-timeline (settings.general.collapsibleReasoning()).

Complements anomalyco#45247 (/thinking toggle). Closes anomalyco#8789, anomalyco#14340, anomalyco#37115, anomalyco#21548,
partially anomalyco#28322. Refs anomalyco#7866, anomalyco#33906.

Co-authored-by: 4ebuRushka
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]: Desktop - Toggle to show thinking

1 participant