fix(desktop): ensure Monaco editor loads syntax highlighting reliably#445
fix(desktop): ensure Monaco editor loads syntax highlighting reliably#445
Conversation
The MonacoProvider was rendering children immediately without waiting for Monaco initialization and theme registration. This caused a race condition where the DiffEditor would try to use the theme before it was defined, resulting in missing syntax highlighting. - Add MonacoContext with isReady state to track initialization - Export useMonacoReady hook for components to wait for readiness - DiffViewer now waits for Monaco to be ready before rendering - Theme updates are properly handled after initial setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Warning Rate limit exceeded@Kitenite has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 11 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughAdds Monaco readiness tracking through a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
useMonacoReadyhook to allow components to wait for Monaco initializationProblem
When opening files in the diff viewer, syntax highlighting would sometimes not load immediately. This was caused by:
MonacoProviderrendering children immediately without waiting for Monaco initializationmonacoPromise.then(), butDiffEditoralready trying to useSUPERSET_THEMEbefore it was registeredmonacoTheme: nulluntil hydration, causing the first render to skip theme registrationSolution
MonacoContextwithisReadystate to track full initializationisReady: trueuseMonacoReady()hook for consumers to check readinessDiffVieweruses the hook to show loading state until Monaco is fully readyTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.