feat(docs): 676 — demo page for cancelling navigation on dirty edits - #96
Open
randomdevpete wants to merge 1 commit into
Open
Conversation
Base automatically changed from
task-675-coalesce-resolvedatom-and-asyncrouteatom
to
task-679-investigate-per-demo-scoped-store-context
August 19, 2026 21:51
randomdevpete
force-pushed
the
task-679-investigate-per-demo-scoped-store-context
branch
from
August 19, 2026 21:59
c349c01 to
1339a1a
Compare
randomdevpete
changed the base branch from
task-679-investigate-per-demo-scoped-store-context
to
task-675-coalesce-resolvedatom-and-asyncrouteatom
August 19, 2026 22:00
Owner
Author
|
Holding for a rewrite — this demo guards a component, not routing.
The mechanism is ticket 778: a |
Adds /demos/cancel-navigation: a form whose in-app links confirm before leaving while it has unsaved edits, built by wrapping useLink's onClick rather than the Link component. Ticket: 676
randomdevpete
changed the base branch from
task-675-coalesce-resolvedatom-and-asyncrouteatom
to
task-778-no-navigation-blocking-api
August 21, 2026 03:38
randomdevpete
force-pushed
the
task-676-demo-page-cancel-navigation-dirty-edits
branch
from
August 21, 2026 03:38
d3e4c63 to
e4615e1
Compare
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
Adds a new demo page at
/demos/cancel-navigationthat shows how to block in-app navigation while a form has unsaved edits. The demo consists of:Editorpage with a textarea that marks the form as dirtyOtherpage to navigate toGuardedLinkcomponent built onuseLinkthat intercepts clicks and showswindow.confirm()before navigating when the form is dirtyThe navigation guard is entirely userland logic — jarl has no built-in navigation-blocking API. This follows the same pattern as other demos: application-specific behaviour built on top of the primitives.
Details
packages/docs/src/demos/CancelNavigationApp.tsxpackages/docs/src/pages/CancelNavigationDemo.tsxpackages/docs/src/router/routes.tsusing the post-feat(atoms)!: 675 — one asyncRouteAtom API for async route data #95staticRouteAtomAPIStack
Stacked on #95 (task-675-coalesce-resolvedatom-and-asyncrouteatom). Will retarget automatically when that merges.
Compatibility notes
staticRouteAtom,useLink,notAtom)window.confirmis called only in event handlers (browser-side), safe for SSR