Skip to content

fix(ui): fix editor 404 flash, data loss on resize, and add request cancellation#1232

Merged
perber merged 7 commits into
mainfrom
fix/editor-loading-state-and-data-loss
Jun 30, 2026
Merged

fix(ui): fix editor 404 flash, data loss on resize, and add request cancellation#1232
perber merged 7 commits into
mainfrom
fix/editor-loading-state-and-data-loss

Conversation

@perber

@perber perber commented Jun 30, 2026

Copy link
Copy Markdown
Owner

No description provided.

…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
@perber perber linked an issue Jun 30, 2026 that may be closed by this pull request
perber added 6 commits June 30, 2026 19:33
…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
@perber
perber merged commit f62737c into main Jun 30, 2026
9 checks passed
@perber
perber deleted the fix/editor-loading-state-and-data-loss branch June 30, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data loss with fast resizing window

1 participant