Skip to content

feat(chat): add compact tool UI mode for executed tool blocks (#322)#327

Open
proyectoauraorg wants to merge 3 commits into
Zoo-Code-Org:mainfrom
proyectoauraorg:feat/322-compact-tool-ui
Open

feat(chat): add compact tool UI mode for executed tool blocks (#322)#327
proyectoauraorg wants to merge 3 commits into
Zoo-Code-Org:mainfrom
proyectoauraorg:feat/322-compact-tool-ui

Conversation

@proyectoauraorg
Copy link
Copy Markdown
Contributor

@proyectoauraorg proyectoauraorg commented May 25, 2026

Related GitHub Issue

Closes #322

Description

Adds an opt-in Compact tool display setting (compactToolUI, off by default) that collapses executed (say) tool blocks in the chat history to a single, clickable line — hiding long descriptions and JSON payloads until the user clicks to expand.

This directly addresses the issue's complaint: verbose tool blocks (especially MCP tools like firecrawl with long descriptions) push the actual conversation out of view and make history tedious to scroll.

Design decision: approval prompts (ask tool messages) are never compacted — only completed/history (say) tool rows are — so users always see the parameters they are approving before acting.

How it works

  • New global boolean compactToolUI in globalSettingsSchema + ExtensionState.
  • Toggle in Context Management settings (compact-tool-ui-checkbox).
  • In ChatRow, the say tool branch renders a single line (chevron + 🔧 + Tool: <name/path>) when compactToolUI && !isExpanded; clicking toggles expansion and falls through to the normal full render.
  • New i18n keys (settings:contextManagement.compactToolUI.*, chat:compactTool.*) added across all 18 locales.

Testing

  • New unit tests in ContextManagementSettings.spec.tsx (toggle renders + fires setCachedStateField("compactToolUI", …)). 28 passing.
  • tsc -b (webview) and tsc --noEmit (src) clean; eslint clean; find-missing-translations reports complete parity.

Summary by CodeRabbit

  • New Features

    • Added a "Compact Tool UI" mode that collapses executed tool outputs into a single-line, clickable summary (expandable); approval prompts remain fully visible.
  • Settings

    • Added a Context Management toggle to enable/disable the compact tool display (defaults to off).
  • Localization

    • Added translations for the new setting and compact tool labels across 20+ languages.
  • Tests

    • Added tests to verify the checkbox renders and updates cached state.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ac0ab3f2-ffad-4097-b1e3-37b28bbbc730

📥 Commits

Reviewing files that changed from the base of the PR and between d356ab6 and e9068ea.

📒 Files selected for processing (1)
  • src/core/webview/ClineProvider.ts

📝 Walkthrough

Walkthrough

Adds an optional compactToolUI setting and implements a compact single-line rendering for executed say tool blocks in chat, wired through extension/provider state, SettingsView/ContextManagementSettings, ChatRow rendering, tests, and translations across locale files.

Changes

Compact Tool UI Feature

Layer / File(s) Summary
Schema, types, provider and context state
packages/types/src/global-settings.ts, packages/types/src/vscode-extension-host.ts, webview-ui/src/context/ExtensionStateContext.tsx, src/core/webview/ClineProvider.ts
Adds compactToolUI to globalSettingsSchema and ExtensionState, initializes compactToolUI: false in ExtensionStateContext provider, and wires compactToolUI into ClineProvider state posted to the webview.
Settings UI and state wiring
webview-ui/src/components/settings/ContextManagementSettings.tsx, webview-ui/src/components/settings/SettingsView.tsx
ContextManagementSettings accepts a compactToolUI prop, renders a checkbox that calls setCachedStateField("compactToolUI", ...); SettingsView reads compactToolUI from cachedState, includes it in update payloads, and forwards it to ContextManagementSettings.
Chat row compact rendering
webview-ui/src/components/chat/ChatRow.tsx
ChatRow imports ChevronRight, reads compactToolUI from extension state, and returns an early single-line clickable summary (chevron + tool label) for executed say tool rows when compact mode is enabled and the row is collapsed.
Tests and internationalization
webview-ui/src/components/settings/__tests__/ContextManagementSettings.spec.tsx, webview-ui/src/i18n/locales/*/chat.json, webview-ui/src/i18n/locales/*/settings.json
Adds unit tests verifying the compact-tool checkbox renders and toggles cached state; adds compactTool chat strings and contextManagement.compactToolUI settings translations across many locale files.

Sequence Diagram

sequenceDiagram
  participant SettingsView
  participant ClineProvider
  participant ExtensionStateContext
  participant ChatRow
  participant User
  SettingsView->>ClineProvider: set cached compactToolUI (toggle)
  ClineProvider->>ExtensionStateContext: include compactToolUI in posted state
  ExtensionStateContext->>ChatRow: provide compactToolUI via context
  ChatRow->>User: render compact single-line summary when enabled
  User->>ChatRow: click summary to expand tool details
  ChatRow->>User: render full tool UI
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • taltas
  • navedmerchant
  • hannesrudolph
  • JamesRobert20

Poem

🐰 I nibble code and tidy threads,
A chevron tucks away long spreads.
One slim line, a click to show—
Quiet chat, then details grow.
Hop, reveal, compact and neat.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly summarizes the main feature: adding a compact tool UI mode for executed tool blocks in the chat interface.
Description check ✅ Passed The PR description provides a clear explanation of the feature, design decisions (never compact approval prompts), implementation details, testing approach, and validation results.
Linked Issues check ✅ Passed The PR implements all core requirements from issue #322: opt-in compact mode setting, single-line rendering for executed tools, clickable expansion, preservation of approval prompts, and global settings toggle.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the compact tool UI feature: schema updates, UI components, settings integration, i18n translations, and supporting tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/core/webview/ClineProvider.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
webview-ui/src/components/settings/SettingsView.tsx (1)

366-426: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

compactToolUI is not persisted on Save.

Line 366 builds updatedSettings, but compactToolUI is missing, so the new toggle won’t survive save/reload.

💡 Suggested fix
 				updatedSettings: {
 					language,
@@
 					showRooIgnoredFiles: showRooIgnoredFiles ?? true,
+					compactToolUI: compactToolUI ?? false,
 					enableSubfolderRules: enableSubfolderRules ?? false,

As per coding guidelines, “For SettingsView, preserve the cached-state pattern: inputs should operate on local cachedState until the user saves…”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webview-ui/src/components/settings/SettingsView.tsx` around lines 366 - 426,
The updatedSettings object built in SettingsView omits compactToolUI so the
toggle in cachedState never gets persisted; add compactToolUI: compactToolUI ??
/* default value or cachedState.compactToolUI */ to the updatedSettings payload
(keeping the same null/undefined handling pattern as other fields) so the local
cachedState value for compactToolUI is saved on Save and survives reload.
🧹 Nitpick comments (1)
webview-ui/src/components/settings/__tests__/ContextManagementSettings.spec.tsx (1)

154-169: ⚡ Quick win

Add one SettingsView save-path regression test for compactToolUI.

These tests validate checkbox wiring, but not persistence through updateSettings. A SettingsView test asserting vscode.postMessage({ type: "updateSettings", updatedSettings: { compactToolUI: ... } }) would catch the current integration bug.

As per coding guidelines, “Prefer local webview-ui tests for React/webview behavior such as component rendering, local state, hooks, form dirty-state, validation, or prop wiring.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@webview-ui/src/components/settings/__tests__/ContextManagementSettings.spec.tsx`
around lines 154 - 169, Tests for ContextManagementSettings only check checkbox
wiring but do not assert that toggling persists via SettingsView's
updateSettings message; add a new test in the SettingsView test suite that
mounts the SettingsView (or renders the component that wires
ContextManagementSettings into the webview messaging layer), simulates toggling
the compactToolUI checkbox, and asserts that vscode.postMessage was called with
{ type: "updateSettings", updatedSettings: { compactToolUI: true/false } };
locate the integration wiring around SettingsView (where
ContextManagementSettings is used and updateSettings is invoked) and mock/spy on
vscode.postMessage to validate the exact payload for compactToolUI.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webview-ui/src/components/chat/ChatRow.tsx`:
- Around line 1423-1434: Replace the clickable div used for compact-row
expansion with a semantic <button type="button"> so keyboard users can activate
it; move the onClick={handleToggleExpand} to the button, keep the className and
children (ChevronRight, PocketKnife, span), add an aria-expanded attribute bound
to the component's expanded state (e.g., aria-expanded={isExpanded} or the
appropriate state variable) and preserve data-testid="compact-tool-row"; ensure
the button does not submit forms (type="button") and that any focus/hover styles
remain intact so keyboard users can tab and press Enter/Space to toggle the
compact tool row.

---

Outside diff comments:
In `@webview-ui/src/components/settings/SettingsView.tsx`:
- Around line 366-426: The updatedSettings object built in SettingsView omits
compactToolUI so the toggle in cachedState never gets persisted; add
compactToolUI: compactToolUI ?? /* default value or cachedState.compactToolUI */
to the updatedSettings payload (keeping the same null/undefined handling pattern
as other fields) so the local cachedState value for compactToolUI is saved on
Save and survives reload.

---

Nitpick comments:
In
`@webview-ui/src/components/settings/__tests__/ContextManagementSettings.spec.tsx`:
- Around line 154-169: Tests for ContextManagementSettings only check checkbox
wiring but do not assert that toggling persists via SettingsView's
updateSettings message; add a new test in the SettingsView test suite that
mounts the SettingsView (or renders the component that wires
ContextManagementSettings into the webview messaging layer), simulates toggling
the compactToolUI checkbox, and asserts that vscode.postMessage was called with
{ type: "updateSettings", updatedSettings: { compactToolUI: true/false } };
locate the integration wiring around SettingsView (where
ContextManagementSettings is used and updateSettings is invoked) and mock/spy on
vscode.postMessage to validate the exact payload for compactToolUI.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 24ee0f03-114c-47e8-8ef6-5328ecd340a5

📥 Commits

Reviewing files that changed from the base of the PR and between 9d022d4 and d5ae590.

📒 Files selected for processing (43)
  • packages/types/src/global-settings.ts
  • packages/types/src/vscode-extension-host.ts
  • webview-ui/src/components/chat/ChatRow.tsx
  • webview-ui/src/components/settings/ContextManagementSettings.tsx
  • webview-ui/src/components/settings/SettingsView.tsx
  • webview-ui/src/components/settings/__tests__/ContextManagementSettings.spec.tsx
  • webview-ui/src/context/ExtensionStateContext.tsx
  • webview-ui/src/i18n/locales/ca/chat.json
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/de/chat.json
  • webview-ui/src/i18n/locales/de/settings.json
  • webview-ui/src/i18n/locales/en/chat.json
  • webview-ui/src/i18n/locales/en/settings.json
  • webview-ui/src/i18n/locales/es/chat.json
  • webview-ui/src/i18n/locales/es/settings.json
  • webview-ui/src/i18n/locales/fr/chat.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/i18n/locales/hi/chat.json
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/i18n/locales/id/chat.json
  • webview-ui/src/i18n/locales/id/settings.json
  • webview-ui/src/i18n/locales/it/chat.json
  • webview-ui/src/i18n/locales/it/settings.json
  • webview-ui/src/i18n/locales/ja/chat.json
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/ko/chat.json
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/nl/chat.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/pl/chat.json
  • webview-ui/src/i18n/locales/pl/settings.json
  • webview-ui/src/i18n/locales/pt-BR/chat.json
  • webview-ui/src/i18n/locales/pt-BR/settings.json
  • webview-ui/src/i18n/locales/ru/chat.json
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/tr/chat.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • webview-ui/src/i18n/locales/vi/chat.json
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/zh-CN/chat.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/zh-TW/chat.json
  • webview-ui/src/i18n/locales/zh-TW/settings.json

Comment thread webview-ui/src/components/chat/ChatRow.tsx Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 98.36066% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/core/webview/ClineProvider.ts 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…de-Org#322)

Adds an opt-in global setting (compactToolUI, off by default) that collapses
executed (say) tool blocks in the chat history to a single clickable line,
hiding verbose descriptions and JSON payloads until the user expands them.

Approval prompts (ask) are never compacted, so users always see the parameters
they are approving. Toggle lives in Context Management settings; new i18n keys
added across all 18 locales. Closes Zoo-Code-Org#322.
@proyectoauraorg proyectoauraorg force-pushed the feat/322-compact-tool-ui branch from d5ae590 to fd5ecdd Compare May 26, 2026 04:50
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webview-ui/src/components/settings/SettingsView.tsx`:
- Around line 838-839: The save payload omits the compactToolUI field so
toggling it is not persisted; update the handleSubmit function to include
compactToolUI (the same state/prop used when rendering) in the updatedSettings
object before sending/saving, e.g. add compactToolUI: compactToolUI (or
compactToolUI ?? false) to updatedSettings so the toggle is persisted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 932d5575-a57a-49f6-b31c-0dc5f5e739cc

📥 Commits

Reviewing files that changed from the base of the PR and between d5ae590 and fd5ecdd.

📒 Files selected for processing (43)
  • packages/types/src/global-settings.ts
  • packages/types/src/vscode-extension-host.ts
  • webview-ui/src/components/chat/ChatRow.tsx
  • webview-ui/src/components/settings/ContextManagementSettings.tsx
  • webview-ui/src/components/settings/SettingsView.tsx
  • webview-ui/src/components/settings/__tests__/ContextManagementSettings.spec.tsx
  • webview-ui/src/context/ExtensionStateContext.tsx
  • webview-ui/src/i18n/locales/ca/chat.json
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/de/chat.json
  • webview-ui/src/i18n/locales/de/settings.json
  • webview-ui/src/i18n/locales/en/chat.json
  • webview-ui/src/i18n/locales/en/settings.json
  • webview-ui/src/i18n/locales/es/chat.json
  • webview-ui/src/i18n/locales/es/settings.json
  • webview-ui/src/i18n/locales/fr/chat.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/i18n/locales/hi/chat.json
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/i18n/locales/id/chat.json
  • webview-ui/src/i18n/locales/id/settings.json
  • webview-ui/src/i18n/locales/it/chat.json
  • webview-ui/src/i18n/locales/it/settings.json
  • webview-ui/src/i18n/locales/ja/chat.json
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/ko/chat.json
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/nl/chat.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/pl/chat.json
  • webview-ui/src/i18n/locales/pl/settings.json
  • webview-ui/src/i18n/locales/pt-BR/chat.json
  • webview-ui/src/i18n/locales/pt-BR/settings.json
  • webview-ui/src/i18n/locales/ru/chat.json
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/tr/chat.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • webview-ui/src/i18n/locales/vi/chat.json
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/zh-CN/chat.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/zh-TW/chat.json
  • webview-ui/src/i18n/locales/zh-TW/settings.json
✅ Files skipped from review due to trivial changes (21)
  • webview-ui/src/i18n/locales/hi/chat.json
  • webview-ui/src/i18n/locales/de/settings.json
  • webview-ui/src/i18n/locales/es/chat.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/en/chat.json
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • webview-ui/src/i18n/locales/zh-TW/chat.json
  • webview-ui/src/i18n/locales/en/settings.json
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/ru/chat.json
  • webview-ui/src/i18n/locales/ko/chat.json
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/fr/chat.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/ja/chat.json
  • webview-ui/src/i18n/locales/pt-BR/settings.json

Comment thread webview-ui/src/components/settings/SettingsView.tsx
- Add compactToolUI to updatedSettings in handleSubmit so the preference persists when saving
- Change <div onClick> to <button> for keyboard accessibility and proper semantics
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
webview-ui/src/components/chat/ChatRow.tsx (1)

1423-1434: ⚡ Quick win

Add aria-expanded attribute for screen reader support.

The button correctly uses semantic HTML and supports keyboard interaction, but adding aria-expanded={isExpanded} would help screen readers announce whether the compact tool row is currently expanded or collapsed.

♿ Proposed accessibility enhancement
 							<button
 								type="button"
 								onClick={handleToggleExpand}
+								aria-expanded={isExpanded}
 								className="flex items-center gap-2 py-0.5 cursor-pointer text-vscode-descriptionForeground hover:text-vscode-foreground bg-transparent border-none text-inherit w-full text-left"
 								data-testid="compact-tool-row"
 								title={t("chat:compactTool.expandHint")}>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webview-ui/src/components/chat/ChatRow.tsx` around lines 1423 - 1434, The
compact tool toggle button in ChatRow.tsx lacks an aria-expanded attribute;
update the button rendered alongside <ChevronRight /> and <PocketKnife /> (the
element that calls handleToggleExpand and uses compactLabel) to include
aria-expanded={isExpanded} so screen readers can detect expanded/collapsed
state, keeping the existing props like data-testid and title unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@webview-ui/src/components/chat/ChatRow.tsx`:
- Around line 1423-1434: The compact tool toggle button in ChatRow.tsx lacks an
aria-expanded attribute; update the button rendered alongside <ChevronRight />
and <PocketKnife /> (the element that calls handleToggleExpand and uses
compactLabel) to include aria-expanded={isExpanded} so screen readers can detect
expanded/collapsed state, keeping the existing props like data-testid and title
unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0afb8605-c6b1-4de5-8573-86a528b7da68

📥 Commits

Reviewing files that changed from the base of the PR and between fd5ecdd and d356ab6.

📒 Files selected for processing (2)
  • webview-ui/src/components/chat/ChatRow.tsx
  • webview-ui/src/components/settings/SettingsView.tsx

Comment thread webview-ui/src/context/ExtensionStateContext.tsx
Comment thread webview-ui/src/components/chat/ChatRow.tsx
getState() read compactToolUI from storage but never returned it, so
getStateToPostToWebview() never sent the persisted value to the webview and the
`false` default always won on reload. Wire it through both getState() returns
following the showRooIgnoredFiles pattern. Addresses PR Zoo-Code-Org#327 review (edelauna).
@proyectoauraorg
Copy link
Copy Markdown
Contributor Author

Thanks for the review @edelauna!

  1. Reload bug fixedcompactToolUI is now wired through both getState() returns (following the showRooIgnoredFiles pattern), so the persisted value reaches the webview instead of the false default always winning on reload.
  2. On the use_mcp_server branch: it renders as an ask (approval prompt), and the feature intentionally never compacts approvals so you can always see what you're authorizing before acting. Compacting MCP rows only makes sense once they're answered/in history — happy to do that as a follow-up if you'd like, otherwise I'll tighten the PR description to scope it to executed file-op tool blocks. Which do you prefer? 🦓

Copy link
Copy Markdown
Contributor

@edelauna edelauna left a comment

Choose a reason for hiding this comment

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

Ok - lets just update the PR description, we can handle MCP history compaction in another issue/pr.

Had some minor questions.

onClick={handleToggleExpand}
className="flex items-center gap-2 py-0.5 cursor-pointer text-vscode-descriptionForeground hover:text-vscode-foreground bg-transparent border-none text-inherit w-full text-left"
data-testid="compact-tool-row"
title={t("chat:compactTool.expandHint")}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would adding aria-expanded={false} here round out the a11y fix? Since this button only renders in the collapsed state, the value is always false, but it signals to screen readers that this is an expandable control.

Suggested change
title={t("chat:compactTool.expandHint")}>
title={t("chat:compactTool.expandHint")}
aria-expanded={false}>

await waitFor(() => {
expect(setCachedStateField).toHaveBeenCalledWith("compactToolUI", true)
})
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These cover the settings toggle nicely. Would it be worth also adding a test that mounts ChatRowContent with compactToolUI=true and a say tool message, to verify the compact row renders (and that clicking it calls onToggleExpand)? That would give a regression guard on the actual chat-side behaviour.

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.

[ENHANCEMENT] Add a strict "Compact Mode" for tool usage UI to save vertical space

2 participants