From 9b5a510d02de205435461c750408df1e5c328eb7 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 27 Feb 2026 19:21:31 +0000 Subject: [PATCH] Handle browser back/forward for in-page route navigation Listen for popstate events and reload the relation from the URL path, so the back button correctly returns to the route_master view after navigating to an individual route. Co-Authored-By: Claude Sonnet 4.6 --- web/static/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/static/app.js b/web/static/app.js index a471acf..a95604d 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -481,6 +481,11 @@ async function loadRouteMaster(relationId) { // ── Init ─────────────────────────────────────────────────────────────────── +window.addEventListener('popstate', () => { + const match = location.pathname.match(/^\/(\d+)$/); + if (match) loadRoute(parseInt(match[1], 10)); +}); + if (RELATION_ID) { loadRoute(RELATION_ID); }