refactor(ui/dashboard): migrate unsaved-page blocker to react-router useBlocker - #2574
Draft
steveninhle wants to merge 1 commit into
Draft
refactor(ui/dashboard): migrate unsaved-page blocker to react-router useBlocker#2574steveninhle wants to merge 1 commit into
steveninhle wants to merge 1 commit into
Conversation
steveninhle
force-pushed
the
refactor/unsaved-page-use-blocker
branch
from
June 26, 2026 03:49
088b4c1 to
be25641
Compare
steveninhle
force-pushed
the
refactor/unsaved-page-use-blocker
branch
2 times, most recently
from
August 11, 2026 04:41
0bbd84b to
6830d25
Compare
steveninhle
force-pushed
the
refactor/unsaved-page-use-blocker
branch
from
August 26, 2026 08:14
6830d25 to
9c2c303
Compare
There was a problem hiding this comment.
Pull request overview
Migrates dashboard navigation blocking to React Router’s data-router APIs.
Changes:
- Replaces
BrowserRouterwithcreateBrowserRouter. - Migrates unsaved-change handling to
useBlocker. - Moves navigation bypass handling into
ConfirmProvider.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
app/index.tsx |
Adds data-router configuration and AuthShell. |
use-unsaved-leave-page.tsx |
Implements blocker-based navigation confirmation. |
my-projects.tsx |
Uses context-provided navigation bypass. |
switch-organization.tsx |
Uses context-provided navigation bypass. |
segment-form/index.tsx |
Bypasses blocking after successful saves. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| bypassRef.current = false; | ||
| return false; | ||
| } | ||
| if (isWalkthroughActive()) return false; |
|
|
||
| const instanceId = useRef(++nextInstanceId).current; | ||
|
|
||
| const blocker = useBlocker( |
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