feat: Full URL deep linking — copy/paste URLs to recreate any view#24
Merged
Conversation
Copy/paste any URL to recreate the exact same view with same repo, date range, filters, sorting, and selections. URL schema: - Global: ?range=1w (or range=custom&since=2026-01-14&until=2026-04-15) - Commit Graph: &branches=main,dev - Network Graph: &branches=main,dev - Pull Requests: &state=OPEN&sort=newest&author=homeles&reviewer=octocat - Code Frequency: &tab=timeseries&path=src/ - Branches: &sort=updated&tab=branches&q=fix Implementation: - New useUpdateSearchParams() hook for merging params without clobbering - New useDateRangeParams() for bidirectional context↔URL sync with echo prevention - All pages init state from URL params (lazy useState) - Defaults omitted from URL to keep it clean - AppLayout preserves date range params when switching repos/views - Sidebar nav links preserve query string
When loading a URL like /app/repo/ActionsDesk/ghec-enterprise-reporting, the org dropdown showed 'Personal' and repo showed 'Select repository...' because selectedOwner initialized to null (Personal repos only). Fix: initialize selectedOwner from URL params.owner, and sync it when the URL owner changes. This ensures useOrgRepos fetches repos for the correct org, so currentRepo is found and the dropdown shows the right name.
Custom date ranges from URL (?range=custom&since=2026-03-07&until=2026-04-14) were being ignored because the context initialized with default '1w' values. The useDateRangeParams() hook updated it in a useEffect (after first render), but by then the first data fetch had already fired with wrong dates. Fix: DateRangeProvider now reads URL params synchronously during initial useState via getInitialRange(). This means the very first render has the correct date range, and the first data fetch uses the right params.
homeles
approved these changes
Apr 15, 2026
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.
Summary
All view state is now synced to URL search params. Copy/paste a URL into a new tab to recreate the exact same view with the same repo, date range, filters, and sorting.
URL Schema
range,since,until?range=3mor?range=custom&since=2026-01-14&until=2026-04-15branches&branches=main,devbranches&branches=main,devstate,sort,author,reviewer&state=OPEN&sort=newest&author=homelestab,path&tab=treemap&path=src/sort,tab,q&tab=tags&q=v1Implementation
useUrlParams.ts(new) —useUpdateSearchParams()merges params without clobbering;useDateRangeParams()bidirectional context↔URL sync with ref-based echo preventionuseStatefrom URL params,useEffectwrites back on changerange=1w,state=OPEN,sort=newestetc. are not written)Files
client/src/hooks/useUrlParams.tsTypeScript
tsc -bclean on both client and server.