Skip to content

feat(frontend): add collapsed thinking step preview setting#2942

Open
LittleChenLiya wants to merge 6 commits into
bytedance:mainfrom
LittleChenLiya:feat/collapsed-thinking-step-preview
Open

feat(frontend): add collapsed thinking step preview setting#2942
LittleChenLiya wants to merge 6 commits into
bytedance:mainfrom
LittleChenLiya:feat/collapsed-thinking-step-preview

Conversation

@LittleChenLiya
Copy link
Copy Markdown
Collaborator

@LittleChenLiya LittleChenLiya commented May 14, 2026

问题原因

思考过程折叠后只显示标题,用户无法在不展开的情况下快速判断当前思考步骤内容;同时旧的外观设置没有对应开关,无法让用户按偏好控制该行为。

修改内容

  • 在外观设置中新增“折叠时预览思考步骤”开关,默认关闭,保持现有折叠态行为不变。
  • 开启后,思考过程折叠时在“思考”标题旁展示一行当前思考内容摘要。
  • 为该设置补充中英文说明、预览 UI、本地设置默认值和旧设置合并逻辑。

测试

  • 前端:pnpm formatpnpm lintpnpm typecheckpnpm buildpnpm testpnpm exec playwright test 通过。

关联 issue

close #2909


Problem Cause

After the thinking process is collapsed, only the title is shown, so users cannot quickly understand the current thinking step without expanding it. The existing appearance settings also lacked a switch for controlling this behavior by preference.

Changes

  • Added a “Preview thinking step when collapsed” switch in appearance settings. It is off by default, preserving the existing collapsed behavior.
  • When enabled, the collapsed thinking process shows a one-line summary of the current thinking content next to the “Thinking” title.
  • Added Chinese and English copy, preview UI, local setting defaults, and legacy setting merge logic for this setting.

Tests

  • Frontend: pnpm format, pnpm lint, pnpm typecheck, pnpm build, pnpm test, and pnpm exec playwright test passed.

Related Issue

Closes #2909

@LittleChenLiya LittleChenLiya marked this pull request as ready for review May 14, 2026 04:48
@LittleChenLiya LittleChenLiya requested a review from Copilot May 26, 2026 02:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a user-configurable appearance preference to preview the current “thinking step” when the thinking block is collapsed, including UI controls and localized copy.

Changes:

  • Extend LocalSettings with an appearance.showCollapsedThinkingStep flag and merge defaults.
  • Add i18n strings (en-US, zh-CN) and types for the new settings section + preview labels.
  • Update settings UI and message rendering to optionally show a summarized collapsed-thinking preview.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
frontend/src/core/settings/local.ts Adds persisted local appearance preference and default/merge behavior.
frontend/src/core/i18n/locales/en-US.ts Adds English strings for the new appearance preferences section and preview.
frontend/src/core/i18n/locales/zh-CN.ts Adds Chinese strings for the new appearance preferences section and preview.
frontend/src/core/i18n/locales/types.ts Extends translation types to include the new appearance preference keys.
frontend/src/components/workspace/settings/appearance-settings-page.tsx Adds settings UI (switch + help hover card) and preview component.
frontend/src/components/workspace/messages/message-group.tsx Computes and renders collapsed thinking-step summary based on the new setting.

Comment thread frontend/src/components/workspace/messages/message-group.tsx Outdated
Comment thread frontend/src/components/workspace/messages/message-group.tsx
Comment thread frontend/src/components/workspace/messages/message-group.tsx Outdated
@LittleChenLiya LittleChenLiya requested a review from Copilot May 26, 2026 02:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread frontend/src/components/workspace/messages/message-group.tsx Outdated
Comment thread frontend/src/components/workspace/messages/message-group.tsx Outdated
@LittleChenLiya LittleChenLiya requested review from Copilot and removed request for Copilot May 27, 2026 04:23
@LittleChenLiya LittleChenLiya requested review from Copilot and removed request for Copilot May 27, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants