diff --git a/services/web-ui/public/app.jsx b/services/web-ui/public/app.jsx index 1bcf73b..5a88667 100644 --- a/services/web-ui/public/app.jsx +++ b/services/web-ui/public/app.jsx @@ -23,6 +23,18 @@ function App() { try { localStorage.setItem('df.sidebar.collapsed', next ? '1' : '0'); } catch {} return next; }); + + // Sync route state with URL hash + React.useEffect(() => { + const parseHash = () => { + const hash = window.location.hash.slice(1); // remove # + const route = hash.startsWith('/') ? hash.slice(1) : hash || 'home'; + setRoute(route); + }; + parseHash(); + window.addEventListener('hashchange', parseHash); + return () => window.removeEventListener('hashchange', parseHash); + }, []); }, []); React.useEffect(() => {