Repository navigation
URL state: open a claim and carry the comparison filters (#177) - #182
Merged
Merged
Conversation
A link can now open the claim a reader clicked, and a filtered comparison table, instead of only a view. - ?view=validation&claim=<claim_id> opens that claim's row, scrolls it into view and focuses it. A link without the claim's country (or with another one) switches to the claim's own country once the populations feed loads, replacing the landing entry so the back button is not trapped. An unknown id opens nothing and leaves the view intact. Opening or closing a row writes the claim back with replaceState, so a copied URL opens the same claim. - ?view=scorecard&program=snap&metric=...&geography=VT sets the comparison filters on load and is written back as they change (same history rules as before: replace within a view, push on a new view or country). Subgroup and status stay in the history entry only. - Each parameter travels only with its own view and is read against a closed vocabulary (hex claim ids, the table's program and metric options, two-letter geography codes or "states"); anything else falls back to the default and is dropped on the next write. view and country are written exactly as before, view=scorecard included. PROGRAM_ORDER and METRIC_ORDER move to filters.ts so the parser and the table share one vocabulary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Closes #177.
Summary
?view=validation&claim=<claim_id>opens that claim's row, scrolls it to the centre and focuses it.replaceState, so Back does not loop.claimback to the URL, so a copied link opens the same claim.?view=scorecard&program=snap&metric=participation_rate&geography=VTsets the comparison filters on load. Filter changes write back under the existing history rules:replaceStatewithin a view,pushStatefor a new view or country.claimis hex.programandmetricmust be in the table's own option lists. These moved tofilters.ts, so the parser and the table share them.geographyis a two-letter code orstates.''and__empty__never become filter values, so the Select sentinel keeps its meaning.viewandcountryare written exactly as before;view=scorecardis kept for old links.On the App v3 side, only
scorecardEntryUrl/claimScorecardUrlneed to change.Known limits
event=parameter first.country=and the claim disagree, the claim's country wins.Test plan
bun test src: 61 pass (41 before), with newurlState.test.tsround trips, invalid values and claim selection, andpopulations.test.tsclaimCountrybun run lint(only the 2 existingonly-export-componentswarnings)bun run build🤖 Generated with Claude Code