feat: add wouter-based routing for the GitHub integration pages - #172
Open
Ziinc wants to merge 3 commits into
Open
feat: add wouter-based routing for the GitHub integration pages#172Ziinc wants to merge 3 commits into
Ziinc wants to merge 3 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.