Add place-level (city) selection UI for US impact analysis#634
Merged
Add place-level (city) selection UI for US impact analysis#634
Conversation
- Add PLACE to US_REGION_TYPES in regionTypes.ts - Add PlaceOption interface and US_PLACES_OVER_100K constant (333 places with population > 100,000 from Census 2023 estimates) - Add helper functions: getPlaceStateNames, filterPlacesByState, placeToRegionString, parsePlaceRegionString, findPlaceFromRegionString - Create USPlaceSelector component for selecting cities by state - Add place option to USGeographicOptions with radio button and selector - Update PopulationScopeView validation to require region for PLACE scope 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change "All households in a city" to "All households in a municipality" - Change "Pick" to "Choose" in USPlaceSelector - Change "Select City" to "Select Municipality" - Remove CITY from US_REGION_TYPES (replaced by PLACE) - Remove NYC city mock from test fixtures 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add tests for place-related functions in regionStrategies (getPlaceStateNames, filterPlacesByState, placeToRegionString, parsePlaceRegionString, findPlaceFromRegionString) - Add tests for regionTypes verifying PLACE constant exists and CITY doesn't - Add tests for USPlaceSelector component - Add tests for USGeographicOptions place/municipality option - Add fixtures for place testing data 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix duplicate import in USGeographicOptionsMocks.ts - Remove unused MOCK_STATE_NAMES import in USPlaceSelector.test.tsx - Run prettier formatting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update all user-facing labels and comments to use 'city' instead of 'community' for place-level geographic analysis. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.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.
Fixes #633
Requires PolicyEngine/policyengine.py#223, a relaunch of the simulation API, and PolicyEngine/policyengine-api#3195.
Summary
Changes
app/src/types/regionTypes.tsPLACE: 'place'toUS_REGION_TYPESapp/src/utils/regionStrategies.tsPlaceOptioninterfaceUS_PLACES_OVER_100Kconstant (333 places from Census 2023 Population Estimates)getPlaceStateNames()- Get unique state names with 100k+ placesfilterPlacesByState()- Filter places by state nameplaceToRegionString()- Convert PlaceOption to region stringparsePlaceRegionString()- Parse region string into state/FIPSfindPlaceFromRegionString()- Find PlaceOption from region stringapp/src/pathways/report/components/geographicOptions/USPlaceSelector.tsx(new)app/src/pathways/report/components/geographicOptions/USGeographicOptions.tsxapp/src/pathways/report/views/population/PopulationScopeView.tsxUS_REGION_TYPES.PLACEtoneedsRegionvalidation arrayRegion String Format
place/{STATE_ABBREV}-{PLACE_FIPS}place/NJ-57000for Paterson, NJTest plan
🤖 Generated with Claude Code