Skip to content

fix(editor): stop unsaved dialog flicker#1116

Merged
perber merged 1 commit into
mainfrom
fix/unsaved-dialog-flicker
Jun 4, 2026
Merged

fix(editor): stop unsaved dialog flicker#1116
perber merged 1 commit into
mainfrom
fix/unsaved-dialog-flicker

Conversation

@perber

@perber perber commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Prevent the unsaved changes dialog from reopening while the router blocker is still transitioning after cancel.

Add end-to-end coverage for the cancel path so the dialog cannot briefly reappear without failing tests.

Prevent the unsaved changes dialog from reopening while the router blocker is still transitioning after cancel.

Add end-to-end coverage for the cancel path so the dialog cannot briefly reappear without failing tests.
Copilot AI review requested due to automatic review settings June 4, 2026 10:50

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 addresses a UX issue in the editor where the “unsaved changes” dialog can briefly reopen (“flicker”) after the user cancels navigation while the router blocker is still transitioning, and adds E2E coverage to prevent regressions.

Changes:

  • Add a one-shot suppression flag in useNavigationGuard to prevent reopening the unsaved-changes dialog immediately after cancel/reset.
  • Adjust DialogManager state retention effect dependencies.
  • Add Playwright E2E coverage for the cancel path, plus a page-object helper for clicking the cancel button.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
ui/leafwiki-ui/src/features/editor/useNavigationGuard.tsx Suppresses the unsaved-changes dialog from reopening during the blocker transition after cancel.
ui/leafwiki-ui/src/components/DialogManager.tsx Updates the dialog retention effect dependency list.
e2e/tests/page.spec.ts Adds an E2E test ensuring cancel keeps the editor open without dialog flicker/reopen.
e2e/pages/EditPage.ts Adds a page-object helper to click the unsaved-changes cancel button.

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

Comment thread ui/leafwiki-ui/src/components/DialogManager.tsx
@perber
perber merged commit 92f64d5 into main Jun 4, 2026
9 checks passed
@perber
perber deleted the fix/unsaved-dialog-flicker branch June 4, 2026 12:03
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