feat: optimize code block rendering performance
Memoize CodeBlock components to prevent unnecessary re-renders:
- Add MemoizedCodeContent for syntax highlighted HTML
- Add MemoizedStyledPre for container element
- Properly type all component props
- Reduce React reconciliation work for complex code blocks
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
* Support mentioning filenames with spaces
Allows spaces to be escaped in mentions with \. Does not attempt more
comprehensive escape handling. (IMO a more structured representation or
moving to something like @[something complex] is probably a better long
term approach, but the scope of that seems problematic.
Adapted from 8955d45708.
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* Older array creation to make check-types happier
---------
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* Quick fix actions
* Remove unused keys
* Simplify more stuff
* Bring back "Explain Code"
* Bring "Improve Code" back
* Add back "Improve"
* This is too flakey for now
* 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>
* Fix mode switching performance in PromptsView by using local state for instant UI updates
* Update webview-ui/src/components/prompts/PromptsView.tsx
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
---------
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>