Skip to content

fix(editor): prevent Page404 flash when navigating to edit mode#1181

Merged
perber merged 1 commit into
mainfrom
fix/editor-404-flash
Jun 19, 2026
Merged

fix(editor): prevent Page404 flash when navigating to edit mode#1181
perber merged 1 commit into
mainfrom
fix/editor-404-flash

Conversation

@perber

@perber perber commented Jun 19, 2026

Copy link
Copy Markdown
Owner

setLoading(true) was called after resetting initialPage to null, leaving a window where !initialPage && !loading was true on the first render — briefly showing the 404 page before the load even started. Moving setLoading(true) before the store reset ensures React 18 auto-batching renders both updates together, so the 404 condition is never met.

setLoading(true) was called after resetting initialPage to null, leaving a
window where !initialPage && !loading was true on the first render — briefly
showing the 404 page before the load even started. Moving setLoading(true)
before the store reset ensures React 18 auto-batching renders both updates
together, so the 404 condition is never met.
Copilot AI review requested due to automatic review settings June 19, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a UI flash in the editor route where <Page404 /> could briefly render during navigation into edit mode. It does this by ensuring the global progress/loading state is set to true before the editor store is reset, so the !initialPage && !loading render condition in PageEditor.tsx is never transiently satisfied during a load.

Changes:

  • Reorders useProgressbarStore.setLoading(true) to run before resetting initialPage to null in loadPageData.
  • Eliminates the brief “404” render window during page-load transitions into edit mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@perber
perber merged commit f1932ba into main Jun 19, 2026
10 checks passed
@perber
perber deleted the fix/editor-404-flash branch June 20, 2026 23:57
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.

2 participants