Skip to content

fix(ui): collapse thinking blocks by default for reasoning models#4467

Open
VedantMadane wants to merge 1 commit into
TabbyML:mainfrom
VedantMadane:fix/collapse-think-block
Open

fix(ui): collapse thinking blocks by default for reasoning models#4467
VedantMadane wants to merge 1 commit into
TabbyML:mainfrom
VedantMadane:fix/collapse-think-block

Conversation

@VedantMadane
Copy link
Copy Markdown

@VedantMadane VedantMadane commented Mar 26, 2026

Fixes #3977

Removes the \open\ attribute from the \ThinkBlock\ <details>\ element so that <think>\ content from reasoning models (DeepSeek R1, etc.) is collapsed by default. Users can still expand to view the full thinking process by clicking the summary.

Change

One-line change in ^[e/tabby-ui/components/message-markdown/index.tsx:

\\diff

  • Details
  • Details

\\

The existing <think>\ tag pipeline (CUSTOM_HTML_BLOCK_TAGS, formatCustomHTMLBlockTags, rehypeSanitize, ThinkBlock component) already handles parsing correctly. The only issue was the default visibility.

Remove the `open` attribute from the ThinkBlock `<details>` element
so that `<think>` content from reasoning models like DeepSeek R1 is
collapsed by default. Users can still expand to view the thinking
process by clicking the summary.

Fixes TabbyML#3977

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
@mellon-builds
Copy link
Copy Markdown

Collapsing <think> blocks by default is the right UX call — the raw chain-of-thought from reasoning models is useful for debugging but distracting as the default view. The fix is minimal and correct. One follow-up worth considering: should the collapse state persist across page reloads, or reset to collapsed each time? Persisting the user's preference per conversation could be useful for workflows where reviewers want to see the reasoning consistently.

@VedantMadane
Copy link
Copy Markdown
Author

Thanks for the feedback. I agree that persisting the preference would be a great UX addition. However, to keep this PR atomic and minimal, I propose keeping it as a default-collapsed state for now. We can definitely explore persistence in a follow-up PR.

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.

Support serve model DeepSeek R1 and disable thinking process in Answer ouput

2 participants