Roo-Code/webview-ui/src/components/common
KJ7LNW 8b072ad126
feat: syntax highlighting terminal output with Shiki (#3021)
* feat: syntax highlighting terminal output with Shiki

Refactored CommandExecution.tsx to:
- Implement CodeBlock component for terminal display
- Use Shiki for syntax highlighting of shell commands and terminal output

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* ui: present same compressed command output that the model will receive

Avoids rendering problems and performance regressions:
- Compresses output using BaseTerminal.compressTerminalOutput
- Eliminates need for Virtuoso by limiting output size

Ensures command output shown in UI matches the compressed format provided to the model:
- Applies same BaseTerminal.compressTerminalOutput processing
- Uses configured terminalOutputLineLimit for consistency

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* test: update CommandExecution tests to use CodeBlock mock

- Replace virtuoso mock with CodeBlock mock to fix shiki import error
- Update CodeBlock mock to properly handle source prop
- Add proper empty output test case verification
- Keep original test values and structure

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

---------

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-04-28 19:54:10 -07:00
..
__mocks__ feat: syntax highlighting terminal output with Shiki (#3021) 2025-04-28 19:54:10 -07:00
__tests__ Overhaul CodeBlock rendering (#3019) 2025-04-28 17:10:57 -07:00
CodeAccordian.tsx Overhaul CodeBlock rendering (#3019) 2025-04-28 17:10:57 -07:00
CodeBlock.tsx Overhaul CodeBlock rendering (#3019) 2025-04-28 17:10:57 -07:00
MarkdownBlock.tsx Overhaul CodeBlock rendering (#3019) 2025-04-28 17:10:57 -07:00
MermaidBlock.tsx Refactor: Use path aliases in webview source files. (#2801) 2025-04-20 21:38:08 -04:00
Tab.tsx Settings tweaks: add terminal & language sections, fix whell scroll in editor tab (#1763) 2025-03-18 00:11:57 -07:00
TelemetryBanner.tsx Refactor: Use path aliases in webview source files. (#2801) 2025-04-20 21:38:08 -04:00
Thumbnails.tsx Refactor: Use path aliases in webview source files. (#2801) 2025-04-20 21:38:08 -04:00
VSCodeButtonLink.tsx Fix tests 2025-03-05 12:28:17 -08:00