fix(web): compact terminal tool cards by default#601
Conversation
- restore compact terminal-related tool cards by default\n- add a chat setting to switch between compact and detailed display\n- keep detailed mode for the current inline output preview
There was a problem hiding this comment.
Findings
- [Major] Detailed mode still cannot show Bash/shell_command output previews —
shouldShowInlineToolCardBodystill requires!presentationMinimal, butknownToolsmarksBashandshell_commandasminimal: true, so choosing “Detailed (show output preview)” only affects non-minimalCodexBashresults and leaves Claude/Gemini terminal cards compact. Evidence:web/src/components/ToolCard/ToolCard.tsx:40, withBash/shell_commandincluded in the new terminal set. Suggested fix:export function shouldShowInlineToolCardBody( toolName: string, presentationMinimal: boolean, terminalToolDisplayMode: TerminalToolDisplayMode ): boolean { if (isSubagentToolName(toolName)) return false if (TERMINAL_RELATED_TOOL_NAMES.has(toolName)) { return terminalToolDisplayMode === 'detailed' } return !presentationMinimal }
Summary
- Review mode: initial
- One behavior regression found: the new setting advertises detailed terminal previews, but the helper keeps two terminal tool types permanently minimal.
Testing
- Not run:
bunis not installed in this runner (/bin/bash: bun: command not found).
HAPI Bot
| presentationMinimal: boolean, | ||
| terminalToolDisplayMode: TerminalToolDisplayMode | ||
| ): boolean { | ||
| return !presentationMinimal |
There was a problem hiding this comment.
[MAJOR] Detailed mode still cannot show Bash/shell_command output previews. This helper still requires !presentationMinimal, but knownTools marks Bash and shell_command as minimal: true, while this PR adds both names to the terminal-related set. As a result, selecting “Detailed (show output preview)” only restores inline output for non-minimal CodexBash results and leaves Claude/Gemini terminal cards compact.
Suggested fix:
export function shouldShowInlineToolCardBody(
toolName: string,
presentationMinimal: boolean,
terminalToolDisplayMode: TerminalToolDisplayMode
): boolean {
if (isSubagentToolName(toolName)) return false
if (TERMINAL_RELATED_TOOL_NAMES.has(toolName)) {
return terminalToolDisplayMode === 'detailed'
}
return !presentationMinimal
}There was a problem hiding this comment.
Fixed. Detailed mode now bypasses the minimal gate for terminal-related cards, so Bash and shell_command restore inline output previews too instead of only CodexBash.
Added helper coverage for:
Bashdetailed modeshell_commanddetailed mode- non-terminal minimal cards still staying compact
Re-ran:
bun run test -- src/hooks/useTerminalToolDisplayMode.test.ts src/components/ToolCard/ToolCard.test.ts src/routes/settings/index.test.tsxbun run typecheck
- let detailed mode bypass minimal rendering for terminal-related cards\n- cover Bash and shell_command helper behavior in tests
There was a problem hiding this comment.
Findings
No findings.
Summary
Review mode: follow-up after new commits
No issues found in the latest full diff. The prior bot finding about detailed Bash / shell_command previews is addressed in this head. Residual risk: local validation could not run because bun is unavailable in this runner.
Testing
Not run (automation): bun is not installed in this runner (/bin/bash: bun: command not found).
HAPI Bot
- add current mobile screenshot for terminal tool card overflow\n- reference it from the PR description for reviewer context
There was a problem hiding this comment.
Findings
- [Major]
run_shell_commandremains outside the compact terminal-tool set, so the new compact default and detailed toggle do not apply to Gemini ACP shell cards. The repo already treatsrun_shell_commandas a shell tool with acommandsubtitle inweb/src/components/ToolCard/knownTools.test.tsx:49, butTERMINAL_RELATED_TOOL_NAMESonly includesBash,CodexBash, andshell_commandatweb/src/components/ToolCard/ToolCard.tsx:29.
Suggested fix:const TERMINAL_RELATED_TOOL_NAMES = new Set(['Bash', 'CodexBash', 'shell_command', 'run_shell_command'])
Summary
Review mode: follow-up after new commits
One issue remains in the full current diff: compact/detailed terminal-card behavior misses the Gemini shell tool path. No other high-confidence regressions found.
Testing
Not run (review-only automation).
HAPI Bot
| import { isSubagentToolName } from '@/chat/subagentTool' | ||
|
|
||
| const ELAPSED_INTERVAL_MS = 1000 | ||
| const TERMINAL_RELATED_TOOL_NAMES = new Set(['Bash', 'CodexBash', 'shell_command']) |
There was a problem hiding this comment.
[Major] run_shell_command is already exercised as a shell-like tool in the web tests (knownTools.test.tsx expects it to surface a command subtitle), but it is not included here. That means Gemini ACP shell cards keep bypassing the new compact/detailed terminal-card setting, leaving a real terminal path with the old behavior.
Suggested fix:
const TERMINAL_RELATED_TOOL_NAMES = new Set(['Bash', 'CodexBash', 'shell_command', 'run_shell_command'])Add a matching regression expectation too:
expect(shouldUseCompactTerminalToolCard('run_shell_command', 'compact')).toBe(true)There was a problem hiding this comment.
Fixed. run_shell_command is now treated as a terminal-related card too, so the compact default and detailed toggle cover the Gemini shell path instead of only Bash / CodexBash / shell_command.
Added regression coverage for:
shouldUseCompactTerminalToolCard('run_shell_command', 'compact')shouldShowInlineToolCardBody('run_shell_command', true, 'detailed')
Re-ran:
bun run test -- src/components/ToolCard/ToolCard.test.ts src/routes/settings/index.test.tsx src/hooks/useTerminalToolDisplayMode.test.tsbun run typecheck
- add run_shell_command to terminal-related tool cards\n- cover compact and detailed helper behavior for that path
There was a problem hiding this comment.
Findings
- No high-confidence findings.
Summary
Review mode: follow-up after new commits
No issues found in the current full diff. The previous bot finding about run_shell_command is addressed in the current head; residual risk is limited to UI behavior that was not exercised here because this review did not run the untrusted PR code.
Testing
Not run (review-only automation).
HAPI Bot
Summary
Reason
The mobile regression comes from #544 (
e76738aa,fix(codex): improve web rendering for Codex events), which changedCodexBashcards from always-minimal to showing inlinestdout/stderrwhenever output exists. That makes terminal-related cards much taller on narrow screens.This PR keeps the useful detailed preview, but moves it behind an explicit setting and restores the compact default.
Scope
Bash,CodexBash,shell_commandTest
bun run test -- src/hooks/useTerminalToolDisplayMode.test.ts src/components/ToolCard/ToolCard.test.ts src/routes/settings/index.test.tsxbun run typecheckRisk / Rollback
Release Request
This issue is especially visible on mobile screens and directly hurts chat readability in active versions. If review passes, please publish a patch release as soon as practical so users can get the compact default back quickly.
Screenshot
Current mobile issue before this fix:
Reviewer Notes