Skip to content

fix(desktop): add collapsible command preview to approval prompt (#44888) - #44910

Closed
Morad37 wants to merge 2 commits into
NousResearch:mainfrom
Morad37:fix/desktop-command-truncation-44888
Closed

fix(desktop): add collapsible command preview to approval prompt (#44888)#44910
Morad37 wants to merge 2 commits into
NousResearch:mainfrom
Morad37:fix/desktop-command-truncation-44888

Conversation

@Morad37

@Morad37 Morad37 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Problem

Long shell commands are truncated in the Desktop approval prompt with no way to view the full command. Users had to make a safety decision without seeing what they were approving.

What changed

Added a collapsible command preview below the Run/Reject button strip in the inline approval bar. The preview shows the command with word wrapping. Short commands display fully. Long commands are collapsed to about 3 lines with a "Show full command" button to expand and view the entire command text.

The existing "Always allow" dialog already showed the command in a scrollable pre block. The inline approval bar now shows it directly too, so the user never has to hunt for the full command.

Key files

  • apps/desktop/src/components/assistant-ui/tool-approval.tsx -- added CommandPreview component, updated imports and layout structure

Testing

  • all 7 existing tests pass (2 test files)
  • tested with npx vitest run --environment jsdom

Morad37 added 2 commits June 12, 2026 16:02
Long shell commands were truncated in the inline approval prompt with
no way to view the full command before approving or rejecting. This was
a safety issue — users had to guess what they were approving.

Fix: add a CommandPreview component below the Run/Reject button strip
that shows the command with word wrapping. Short commands display fully.
Long commands are collapsed to ~3 lines with a 'Show full command' toggle
to expand and view the entire command text.

The 'Always allow...' dialog already showed the command in a scrollable
pre block. The inline approval bar now also shows it directly, so the
user never has to hunt for the full command text.

Closes NousResearch#44888

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Summary

Verdict: Approved

Clean UI improvement. The collapsible command preview allows users to review full commands before approving or rejecting tool execution in the desktop approval bar.

Looks Good

  • Collapsible preview with ChevronUp/ChevronDown toggle icons
  • Overflow detection via scrollHeight vs clientHeight measurement
  • Smooth CSS transition for max-height animation
  • Proper accessibility: type=button on the toggle, sr-only text labels
  • Feature is additive and only renders when command is non-empty
  • New ChevronUp icon properly exported from icons.ts

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused desktop safety improvement. This is already implemented on current main; this is an automated hermes-sweeper review.

  • Commit 266b5a19f128799d2c604a965872608902836ceb added the approval-bar Command toggle, which reveals the complete pending command inline before approval.
  • apps/desktop/src/components/assistant-ui/tool/approval.tsx:231-248 renders the toggle and the wrapped, scrollable full-command <pre>.
  • apps/desktop/src/components/assistant-ui/tool/approval.test.tsx:87-98 covers revealing a 400-character command in full.
  • The implementation shipped in v2026.6.19.

The linked #44888 discussion is therefore resolved; this PR's implementation is redundant with the shipped behavior.

@teknium1 teknium1 closed this Jul 14, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants