Skip to content

fix(native): highlight shell commands and scale work rows - #110

Merged
rynfar merged 2 commits into
nativefrom
nw/108-transcript-gaps
Nov 3, 2026
Merged

rynfar merged 2 commits into
nativefrom
nw/108-transcript-gaps

Conversation

@rynfar

@rynfar rynfar commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Expanded command inspectors used plain text and work rows stayed at 14px when the interface size changed. This ports the Bash command surface from ShellCommandBlock.tsx, HighlightedTokens.tsx, and embeddedScripts.ts, using the existing native Tree-sitter highlighter. Both command-output rows and dynamic-tool inspectors use that shared surface.

Commands tokenize on the background executor, with a bounded cache by command and syntax palette, plain fallback, visible controls, selection, and embedded-script byte mappings (inline interpreter arguments, heredocs, nested shell wrappers, escaped quotes and UTF-8). Heredoc output files use the same extension inference as native file previews, including Rust, Go, and TSX. Work rows now scale their text, line height, icon slots, spacing, group caps, error/approval labels, question-and-answer histories and image attachments, and worktree offsets with the interface font size; code/output font size remains fixed as on the web. Interface-size changes invalidate the persistent transcript and group-list measurements while preserving the reader’s proportional scroll position.

Addresses #108; advances #64 and #78. TR-CMDOUT and TR-INSPECT remain partial: the existing highlighter lacks PowerShell and fish/Perl/AppleScript/Ruby/XML embedded grammars. These fall back to plain text or the surrounding shell string style. Grammar availability is the remaining command-highlighting gap.

Verified with cargo test --workspace (1,076 tests), cargo clippy --workspace --all-targets -- -D warnings, snapshot-feature build, theme generation check, parity-sync tests (42 passed), conformance generation check, and vp run check:changed fork/native. Regression tests failed before the fixes: embedded file extensions, and actual GPUI list measurements for offscreen main/group rows when font size changes in either direction. No styling unit tests were added.

Offscreen captures use the existing Replay smoke thread read-only, with isolated native credentials. No server writes, paid turns, real windows, clipboard use, or dev servers. PNGs stay local as requested:

Capture Before After
Inspector + rows, dark 16px /private/tmp/native-108-evidence/before-dark-16.png /private/tmp/native-108-evidence/after-dark-16.png
Inspector + rows, light 16px /private/tmp/native-108-evidence/before-light-16.png /private/tmp/native-108-evidence/after-light-16.png
Work rows, dark 20px /private/tmp/native-108-evidence/before-dark-20.png /private/tmp/native-108-evidence/after-dark-20.png
Work rows, light 20px /private/tmp/native-108-evidence/before-light-20.png /private/tmp/native-108-evidence/after-light-20.png
Inspector, dark 20px /private/tmp/native-108-evidence/before-command-dark-20.png /private/tmp/native-108-evidence/after-command-dark-20.png
Inspector, light 20px /private/tmp/native-108-evidence/before-command-light-20.png /private/tmp/native-108-evidence/after-command-light-20.png

Live 16→20px resize evidence uses --font-size 16, expands the rows, then applies --resize-font 20 in the same offscreen process:

  • Expanded Q&A before: /private/tmp/native-108-evidence/before-question-light-20.png
  • Expanded Q&A after: /private/tmp/native-108-evidence/review-question-light-16-to-20.png
  • Expanded Q&A dark after: /private/tmp/native-108-evidence/review-question-dark-16-to-20.png
  • Expanded command/work rows after: /private/tmp/native-108-evidence/review-work-dark-16-to-20.png

Built with GPT-6.1 Sol in Codex

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