fix(ui): fix editor 404 flash, data loss on resize, and add request cancellation#1232
Merged
Conversation
…ancellation - Remove spurious Page404 flash when entering edit mode caused by a render tick before useEffect fires (PageEditor) - Fix data loss when resizing window across mobile/desktop breakpoint: MarkdownCodeEditor now uses a resetKey (pageId) to control reinitialization instead of initialValue, so typing no longer recreates the CodeMirror instance - Add isLoading flag and AbortController to pageEditorStore and viewerStore so rapid navigation no longer races (stale responses are discarded) - PageViewer now reads isLoading from viewerStore instead of progressbarStore - getPageByPath accepts an optional AbortSignal - Add tests for MarkdownEditor and MarkdownCodeEditor covering the fixed scenarios
…vars) - Move initialValueRef sync to useLayoutEffect in MarkdownCodeEditor (avoids react-hooks/refs error for ref mutation during render) - Remove markdownRef from MarkdownEditor; pass markdown directly to MarkdownCodeEditor (no ref read during render) - Rename inline mock to MockMarkdownCodeEditor (react-hooks/rules-of-hooks) - Use useRef snapshot pattern in test to avoid exhaustive-deps warning
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.
No description provided.