fix(frontend): show the full shell command in the expanded tool card / 终端工具卡展开后显示完整指令 - #9860
Open
Linearl wants to merge 1 commit into
Open
fix(frontend): show the full shell command in the expanded tool card / 终端工具卡展开后显示完整指令#9860Linearl wants to merge 1 commit into
Linearl wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new “Command” section uses the standard code block styling (white-space: pre) so long commands won’t wrap as described/required, reducing the usability of the fix for the reported issue.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an expanded-body “Command” section for shell (bash) tool cards so users can review the full executed command (not just truncated header text and output), aligning shell cards with other tools’ expanded argument visibility and improving auditability.
Changes:
- Render a “Command” block in
ToolCardfor shell cards, showing the fullsubjectOf("bash", args)command above the output viewer. - Add
tool.commandi18n strings (en/zh/zh-TW) and minimal styling for the new section. - Ratchet bundle budget thresholds to account for the added UI.
File summaries
| File | Description |
|---|---|
| desktop/frontend/src/components/ToolCard.tsx | Adds expanded shell-card “Command” section rendered via subject. |
| desktop/frontend/src/styles.css | Adds .tool__command and .tool__command-label styling for the new section. |
| desktop/frontend/src/locales/en.ts | Adds tool.command label (“Command”). |
| desktop/frontend/src/locales/zh.ts | Adds tool.command label (“命令”). |
| desktop/frontend/src/locales/zh-TW.ts | Adds tool.command label (“命令”). |
| desktop/frontend/src/tests/tool-card-shell-execution.test.tsx | Adds test coverage asserting the command section appears after expand and includes full command tail. |
| desktop/frontend/scripts/check-bundle-budget.mjs | Updates initial bundle budgets to the next ratchet step. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+5054
to
+5064
| .tool__command { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 4px; | ||
| } | ||
|
|
||
| .tool__command-label { | ||
| color: var(--fg-faint); | ||
| font-size: var(--text-sm); | ||
| } | ||
|
|
…sengine#9858) Long bash commands are truncated to a one-line ellipsis in the tool card header, and the expanded body renders only the command output — the full command is visible nowhere, so users cannot audit what the agent actually ran. Non-shell tools already render pretty(effectiveArgs) when expanded; the shell card's output branch simply never shows the command. - render a Command section (CodeViewer, bash-highlighted) at the top of the shell card body, fed by the same subjectOf command the header uses - add tool.command labels (en/zh/zh-TW) and .tool__command styles - ratchet the bundle budgets for the added section (458.3 gzip initial, 2455.2 raw initial) per the in-file convention Fixes esengine#9858
Linearl
force-pushed
the
fix/shell-card-command-display
branch
from
September 6, 2026 13:05
e40a568 to
38b49e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
Long bash commands are truncated to a one-line ellipsis in the tool card header, and the expanded body renders only the command output — the full command is visible nowhere, so users cannot audit what the agent actually ran. Non-shell tools already render
pretty(effectiveArgs)when expanded; the shell card's output branch simply never shows the command.bash 工具卡片头部对长指令单行 ellipsis 截断,展开后的 body 只渲染命令输出——完整指令在任何状态下都不可见,用户无法确认 agent 实际执行了什么。非 shell 工具展开后有完整 args JSON,唯独 bash 卡缺命令展示。
Fixes #9858.
Changes / 改动
ToolCard.tsx: render a Command section at the top of the shell card body (before the outputCodeViewer), fed by the samesubjectOfcommand the header uses — long/multi-line commands render wrapped and selectable. / shell 卡 body 顶部(输出之前)新增 Command 小节(CodeViewer、bash 高亮),数据源与头部一致的完整 command,长/多行指令完整可选中。tool.command(en "Command" / zh "命令" / zh-TW "命令"). / 三语言新增标签。styles.css:.tool__command/.tool__command-labelsections. / 新增小节样式。check-bundle-budget.mjs: ratchet the initial budgets for the added section (458.2 → 458.3 gzip, 2454.8 → 2455.2 raw) per the in-file convention. / 按文件内棘轮约定上调两通道预算。The collapsed header keeps its one-line ellipsis (glanceable row unchanged); the collapsed body stays hidden via
useCollapseAnimation, so nothing new shows until the user expands. / 折叠态头部速览不变;折叠 body 仍由既有折叠动画隐藏,展开才显示新增小节。Verification / 验证
pnpm build— full chain PASS (eslint / waapi / scroll-writer / css-syntax / z-index / theme-token /tsc --noEmit/ vite build / bundle budgets 8 channels, e.g. 458.2/458.3 and 2455.1/2455.2).npx tsx src/__tests__/tool-card-shell-execution.test.tsx— 38 passed, 0 failed, including the new command-section assertions: section rendered after expand, full command tail (LONG_COMMAND_TAIL_MARKER_DONE) visible, label rendered, header subject row retained.npx tsx src/__tests__/tool-card-error-details.test.tsx— 5 passed, 0 failed.git diff upstream/main-v2...HEAD --stat— only the 7 files above / 仅含上述文件。Issues Fixes / 关联修复
Fixes #9858
Refs: #1496 (old TUI-era adjacent)
Guard / 影响面
Cache-impact: none- desktop UI-only change (ToolCard.tsx + locales + styles.css + bundle budgets); no prompt, tool schema, or provider request payload changed.
Cache-guard: none- not required. Changed files are outside the provider-visible cache construction; no cache key inputs altered.
Documentation-impact: none- no docs/*.md changed; user-facing behavior is the tool card rendering itself.
System-prompt-review: @SivanCola — no system-prompt bytes change (frontend rendering only); explicit maintainer review requested for the locale additions.