Files
spencrmartin ba3e341666 Fix Monaco Editor loading in Electron environment
This commit properly configures Monaco Editor to work reliably in the
Electron/Vite environment by using direct module imports instead of
relying on problematic plugin configurations.

Changes:
- Add monaco-editor as direct dependency (v0.52.2)
- Configure @monaco-editor/react loader to use bundled Monaco instance
- Update vite.renderer.config.mts with proper worker and bundling config
- Replace lazy loading with direct import in RichChatInput
- Add Monaco-specific CSS for consistent theming
- Improve loading state UI with better feedback

Technical approach:
Instead of using vite-plugin-monaco-editor (which has ESM compatibility
issues), we import monaco-editor directly and configure the loader to
use that instance. Vite handles worker bundling via the 'worker.format'
config, and we manually chunk Monaco for optimal loading.

This ensures Monaco loads instantly and reliably when entering code mode
(e.g., typing #python in the chat input), with full IDE features like
syntax highlighting, autocomplete, and error detection.

Fixes: Monaco Editor infinite spinner and loading failures
Related: PR #5502
2025-10-31 14:58:49 -04:00
..