Make the calibration-map geography filter data-driven (fixes blank UK map)#69
Open
juaristi22 wants to merge 1 commit into
Open
Make the calibration-map geography filter data-driven (fixes blank UK map)#69juaristi22 wants to merge 1 commit into
juaristi22 wants to merge 1 commit into
Conversation
The release-summary Geography filter hardcoded US levels (National / State / Congressional district). UK target rows parse to no level, so selecting any option filtered the treemap to zero tiles — a blank map. The target-treemap payload now carries a levels field computed from the unfiltered rows, so a level-filtered request still reports the full list. The view builds its options from that list (labelled per level, title-cased fallback) and hides the select entirely when the release has no levels, as UK releases do today. Also fixes the stale-filter bug: the selected level is reset when the country changes and whenever the response says the level doesn't exist in the release, instead of silently filtering the map to nothing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
The release-summary page's calibration-map "Geography" filter hardcodes US levels (National / State / Congressional district). Every UK target currently parses to
level: "", so on the UK dataset selecting any option filters the treemap to zero tiles — a blank map. The selected level also persisted across country/release switches, so US → "State" → toggle UK left a stale filter applied.Fix
levels: string[], computed from the unfiltered rows (so a level-filtered request still reports the release's full level list).national/state/congressional_district/region, title-cased fallback), and hides the select entirely when the release has no levels (UK today).Testing
bun test: 35 pass, 0 fail (includes a new test coveringlevelson unfiltered, filtered, and UK-shaped rows).tsc --noEmit: clean.levels: []hides the select, map still renders).Part of a series fixing UK-side dashboard bugs; UK targets gaining real levels (
national/region) is a separate PR.🤖 Generated with Claude Code