Skip to content

feat(ui): Add thinking/reasoning block visibility toggle#9139

Open
sauerdaniel wants to merge 2 commits intoanomalyco:devfrom
sauerdaniel:pr/thinking-toggle
Open

feat(ui): Add thinking/reasoning block visibility toggle#9139
sauerdaniel wants to merge 2 commits intoanomalyco:devfrom
sauerdaniel:pr/thinking-toggle

Conversation

@sauerdaniel
Copy link
Contributor

@sauerdaniel sauerdaniel commented Jan 17, 2026

Summary

Add a keyboard shortcut Ctrl+i to toggle thinking/reasoning block visibility in the TUI.

Fixes #13789

Problem

No quick way to toggle thinking block visibility while using the TUI — users must navigate through menus.

Solution

Add Ctrl+i keybinding that toggles thinking mode visibility in the session turn component, consistent with other TUI quick-settings shortcuts.

Changes

  • packages/ui/src/components/session-turn.tsx — Add Ctrl+i toggle for thinking block visibility with proper mouse event typing

Testing

  • TypeScript compilation passes (bun turbo typecheck)
  • Unit tests pass

AI-Assisted

Yes

Design review note

This touches TUI UI behavior; per CONTRIBUTING.md, maintainer design review is requested before merge.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found

PR #7868: feat(app): add /thinking command to toggle reasoning visibility

Why it's related: Both PRs address the same core feature - toggling thinking/reasoning block visibility. However, PR #7868 uses a /thinking command approach while PR #9139 (current) adds a UI toggle button. These may be complementary approaches or duplicative depending on the intended implementation strategy.

Also related (but older/different scope):

@sauerdaniel
Copy link
Contributor Author

Rebased onto latest dev and resolved merge conflicts.\n\nNo functional change beyond the thinking-visibility toggle; also typed mouse event handlers to satisfy TS.\n\nPlease re-run checks / re-review when convenient.

@sauerdaniel sauerdaniel force-pushed the pr/thinking-toggle branch 5 times, most recently from 33464c8 to 546aa0b Compare February 15, 2026 09:29
@sauerdaniel
Copy link
Contributor Author

Re: potential overlap with #7868 — different approach. #7868 adds a /thinking slash command (requires session.tsx changes), while this PR adds a UI toggle directly in the thinking block component (session-turn.tsx only). They're complementary features (command vs inline toggle) that happen to touch the same file.

Add toggle button to show/hide thinking blocks after response completion.
Currently, reasoning blocks are only visible during streaming and disappear
once the response is complete.

Changes:
- Add showReasoning state to session turn store
- Add hasReasoningParts() memo to detect if turn has reasoning content
- Show toggle button in response header when reasoning parts exist
- Add reasoning section at bottom of response when toggled on
- Keep reasoning visible during streaming (existing behavior)

Fixes anomalyco#7866
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.

TUI lacks quick keyboard toggle for thinking/reasoning block visibility

1 participant