fix: improve Monaco editor theming and empty trash UX#24
Merged
Conversation
Monaco Editor improvements: - Replace CSS overrides with native 'vs' and 'vs-dark' themes for proper syntax highlighting - Add global MonacoThemeContext to sync theme across all code blocks - Fix scroll blocking by setting alwaysConsumeMouseWheel to false - Remove theme icon from individual blocks since theme is now global Empty Trash improvements: - Remove confirmation modal for faster workflow - Add optimistic UI updates to clear trash items immediately - Add spinner to Empty Trash button with "Emptying..." state - Fix selected note persisting after trash is emptied - Improve auto-selection logic to prevent selecting trashed notes Performance: - Add React Query with optimized cache configuration - Implement code splitting with manual chunks for major dependencies - Defer WebSocket connection until after initial data load - Convert sequential pagination to parallel requests Editor stability: - Fix editor view access errors during mount/unmount cycles - Add proper null checks for editor.view.dom in all useEffects - Wrap editor operations in try-catch for transitional states
…and editor stability
Contributor
|
🎉 This PR is included in version 1.28.8 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves Monaco editor theming, empty trash UX, application performance, and editor stability.
Monaco Editor Improvements
vs(light) andvs-dark(dark) themes for proper syntax highlightingMonacoThemeContextto synchronize theme across all code execution blocksalwaysConsumeMouseWheel: falsein editor optionsEmpty Trash UX Improvements
Performance Optimizations
staleTime: 5 minutes- Data stays fresh for 5 minutesgcTime: 30 minutes- Cache kept for 30 minutesrefetchOnWindowFocus: false- Better UX, no unnecessary refetchesmonaco-editor- Large code editor bundletiptap-coreandtiptap-extensions- Rich text editor (split for better caching)clerk,radix-ui,react-query,syntax-highlight- Vendor librariesPromise.all()for folders and notesautoConnect: falseuntil after initial data loadsEditor Stability Fixes
editor.view.domin all useEffectsinstanceof Datechecks in favor oftypeof === 'string'Bug Fixes
note.deletedinstead ofnote.deletedAt(correct property name)useNotes.tsanduseEditorEffects.tsreact-refresh/only-export-componentsin context filePerformance Impact
Before:
After:
Promise.all()Expected improvements: