Skip to content

feat: add wouter-based routing for the GitHub integration pages - #172

Open
Ziinc wants to merge 3 commits into
mainfrom
claude/github-integration-routing-wifzza
Open

feat: add wouter-based routing for the GitHub integration pages#172
Ziinc wants to merge 3 commits into
mainfrom
claude/github-integration-routing-wifzza

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Introduces app-wide URL routing via wouter (Router in App.tsx, wrapped
around the whole app) and uses it for the GitHub panel: tab, list
filter, selected issue/PR, and the create-item form now all live in
the URL (/github/issues, /github/prs/:number, ?filter=..., etc.)
instead of local component state, so browser back/forward moves
between them natively through the History API.
Dashboard's top-level view-mode switch stays in sync with the URL in
both directions: opening GitHub pushes a /github/* route, and leaving
it (via the sidebar, browser back, or otherwise) keeps viewMode and
location from drifting apart. openGitHubPr now navigates straight to
the PR's route instead of threading initialPrNumber/initialPrState
props through GitHubPanel.

claude added 3 commits August 5, 2026 19:25
Introduces app-wide URL routing via wouter (Router in App.tsx, wrapped
around the whole app) and uses it for the GitHub panel: tab, list
filter, selected issue/PR, and the create-item form now all live in
the URL (/github/issues, /github/prs/:number, ?filter=..., etc.)
instead of local component state, so browser back/forward moves
between them natively through the History API.

Dashboard's top-level view-mode switch stays in sync with the URL in
both directions: opening GitHub pushes a /github/* route, and leaving
it (via the sidebar, browser back, or otherwise) keeps viewMode and
location from drifting apart. openGitHubPr now navigates straight to
the PR's route instead of threading initialPrNumber/initialPrState
props through GitHubPanel.
The previous path-based routing (history pushState to /github/...)
overwrote the page's real ?repo=<path> query string, which the app
depends on to know which repo a window is for. That's harmless for
in-app navigation, but a real reload (e.g. the crash-recovery reset
button in ErrorBoundary) would hit that URL for real: the repo param
would be gone, and Tauri's production asset serving has no SPA
fallback for arbitrary sub-paths, so the request could fail outright.

Switch the app's Router to wouter's useHashLocation, so GitHub routes
live entirely after the # and never touch location.search. Since
wouter's hash-location navigate() treats a "?" in the target as the
page's real query string (not part of the hash), filters move from a
?filter= query param to a path segment: /github/<tab>/<filter>/<selector?>.
This also restores full fidelity for "close returns to the filter you
came from," including on PRs opened via onViewPrInApp.
CI's `npm run check:format` failed on an unwrapped navigate() call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants