Use browser history and relative navigation without breaking native anchors.
A navigation link still needs to behave like a link. A modified click, a download, another target or an external URL has native browser meaning. Internal navigation may be intercepted only when that ordinary anchor action is eligible.
Relative paths use familiar filesystem-style ./ and ../ resolution. A query or fragment update changes a different part of the current location. Push adds history; replace changes the current entry.
Understand the moving parts
Link composes a normal callback with the router's navigation decision. A NavigationEvent may explicitly cancel that decision; cancelling is different from changing the destination after navigation already happened.
The controls below change the actual lesson URL. Use Back and Forward after moving between project details. A replace-query control should not create an extra history entry, while a cancelled destination should leave the URL alone.
Project links push real destinations. Replace query uses replace=True; the cancelled link calls cancel_navigation() before changing history. The location readout derives from the same router. The standalone version uses the same lesson paths without the surrounding course navigation.
Try it live
Push a detail URL, replace its query, go Back and Forward, then try a cancelled link.
What to observe
The address bar and readout agree. Cancellation changes neither the destination nor history.