Skip to content

fix(wework): keep thinking row visible in tool preview - #2071

Merged
qdaxb merged 2 commits into
mainfrom
fix/tool-block-thinking-scroll
Jul 20, 2026
Merged

qdaxb merged 2 commits into
mainfrom
fix/tool-block-thinking-scroll

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Scroll the live tool activity preview when the bottom thinking row appears or disappears, even when the tool row count is unchanged.
  • Add regression coverage for the running-tool to thinking transition.
  • Document the tool preview auto-scroll contract in Chinese and English.

Root cause

The inner tool preview only synchronized scrollTop when rows.length changed. Completing a tool and rendering the thinking row can keep the same row count, so that new row was rendered below the visible viewport without updating the inner scrollbar.

Impact

During long-running Wework tasks, the current thinking status remains visible after a tool finishes instead of being hidden below the compact three-row tool preview.

Validation

  • pnpm --filter wework test (183 files, 1840 tests)
  • pnpm --filter wework exec vitest run src/components/chat/blocks/ToolBlocksDisplay.test.tsx (50 tests)
  • Wework pre-push ESLint, TypeScript, and unit-test checks
  • Prettier and ESLint on changed Wework files
  • Isolated real-Tauri verification with 8 sequential tool calls, covering running, thinking-after-tool, stable-thinking, and completed states

Summary by CodeRabbit

  • Bug Fixes

    • Improved live tool activity previews so scrolling keeps the current “Thinking” status visible as activity changes.
    • Preserved the reader’s scroll position when expanded tool details are viewed.
  • Tests

    • Added coverage for scrolling when the “Thinking” row appears without additional tool activity.
  • Documentation

    • Documented collapsed preview limits and scrolling behavior in English and Chinese developer guides.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ca72cdb4-15f8-456d-8488-3178fec572df

📥 Commits

Reviewing files that changed from the base of the PR and between 55e7ad8 and 9d8fa27.

📒 Files selected for processing (4)
  • docs/en/developer-guide/wework-chat-state-sources.md
  • docs/zh/developer-guide/wework-chat-state-sources.md
  • wework/src/components/chat/blocks/ToolBlocksDisplay.test.tsx
  • wework/src/components/chat/blocks/ToolBlocksDisplay.tsx

📝 Walkthrough

Walkthrough

The live tool activity preview now re-evaluates bottom scrolling when the Thinking row appears or disappears. A regression test covers this transition, and English and Chinese developer guides document the resulting scrolling rules.

Changes

Tool Preview Scrolling

Layer / File(s) Summary
Scrolling behavior contract
docs/en/developer-guide/wework-chat-state-sources.md, docs/zh/developer-guide/wework-chat-state-sources.md
Documents the three-row collapsed preview limit, Thinking row scroll triggers, and preservation of reading position when details are expanded.
Thinking row scroll synchronization
wework/src/components/chat/blocks/ToolBlocksDisplay.tsx, wework/src/components/chat/blocks/ToolBlocksDisplay.test.tsx
Adds showThinking to the layout effect dependencies and verifies that the preview scrolls to reveal the Thinking row after tool completion.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: icycrystal4

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tool-block-thinking-scroll

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qdaxb
qdaxb marked this pull request as ready for review July 20, 2026 06:34
@qdaxb
qdaxb merged commit 3a8eabb into main Jul 20, 2026
21 of 22 checks passed
@qdaxb
qdaxb deleted the fix/tool-block-thinking-scroll branch July 20, 2026 06:34
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.

1 participant