🤖 feat: implement proper URL routing with react-router #1281
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.
Replace hash-based URL handling with proper URL routing using react-router-dom.
URL Structure
//project?path=/path/to/project/workspace/:workspaceIdKey Changes
New Files
src/browser/contexts/RouterContext.tsx- Router provider wrapping MemoryRouter with navigation contextsrc/browser/hooks/useRouterUrlSync.ts- URL parsing and browser URL synchronizationModified Files
WorkspaceContext.tsx- State derived from URL instead of internal useStateAppLoader.tsx- Wrapped in RouterProviderApp.tsx- Removed old hash syncing codeArchitecture
Uses MemoryRouter (not BrowserRouter) because Electron's
file://protocol in production doesn't support HTML5 pushState. The router state syncs to the browser URL viahistory.replaceState()so the URL bar shows proper routes.Backward Compatibility
#workspace=abc,#/path/to/project) are converted to proper routes on loadsetSelectedWorkspace,beginWorkspaceCreation) continue to workTesting
Generated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high