Skip to content

feat(opengrid): jurisdiction filter — add multi-select#17

Merged
nicholasalanbrown merged 2 commits intomainfrom
feat/jurisdiction-multi-select
Feb 25, 2026
Merged

feat(opengrid): jurisdiction filter — add multi-select#17
nicholasalanbrown merged 2 commits intomainfrom
feat/jurisdiction-multi-select

Conversation

@nicholasalanbrown
Copy link
Contributor

@nicholasalanbrown nicholasalanbrown commented Feb 25, 2026

Summary

Addresses Cyril's feedback (MAI-39): the jurisdiction filter was single-select (no filter at all previously in the ExploreShell version), but utilities frequently span multiple states. This PR adds multi-select so users can filter by multiple jurisdictions simultaneously.

Update: Replaced the bespoke JurisdictionFilter dropdown with edges' FilterDialog / DataControls filter chip pattern, which handles mobile natively via a Dialog/Tray.

Changes

components/explorer/panels/UtilityListPanel.tsx

  • Removed hand-rolled JurisdictionFilter component (~200 lines deleted)
  • Added FilterDialog with two facets: Segment and Jurisdictions
  • Segment filter moved from bespoke <select> into FilterDialog
  • Active filters shown as chips via DataControls filter props
  • Filtering logic unchanged: parses comma-separated jurisdiction strings, matches on ANY selected state

explorer/app/(shell)/utilities/page.tsx

  • Same refactor: JurisdictionFilterFilterDialog
  • Segment + jurisdiction filters consolidated into one filter dialog
  • Active filter chips displayed inline

components/explorer/ExplorerContext.tsx (unchanged from original PR)

  • jurisdictions: string[] in ExplorerState
  • SET_JURISDICTIONS action and setJurisdictions context method
  • URL serialized as ?jurisdictions=CA,TX,NY

UX Details

  • Filter button in DataControls opens FilterDialog
  • Chips shown for active segment / jurisdiction filters with × to remove individually
  • Mobile: FilterDialog renders as a bottom sheet (Tray) — no inline dropdown needed
  • Desktop: standard modal dialog with searchable checkbox list per facet
  • URL-safe: filter survives browser refresh/share (unchanged)

Testing

  • TypeScript: tsc --noEmit passes clean
  • Multi-state utilities (e.g. "AR, KS, MO, OK") match when any of those states is selected

Closes MAI-39

- Add jurisdictions[] array to ExplorerState for tracking selected state codes
- Serialize/deserialize jurisdiction filter in URL (?jurisdictions=CA,TX,NY)
- Add JurisdictionFilter component: dropdown with search + checkboxes
- Update UtilityListPanel to render JurisdictionFilter and apply jurisdiction filtering
- Update explorer/utilities/page.tsx with same multi-select behavior
- Filtering logic: a utility matches if its jurisdiction field contains ANY selected state
  (utilities with multi-state jurisdictions like 'AL, GA, MS' match any of those states)

Fixes MAI-39
@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opengrid Ready Ready Preview, Comment Feb 25, 2026 8:12pm

Request Review

- Remove hand-rolled JurisdictionFilter dropdown (~200 lines removed)
- Replace with edges FilterDialog + DataControls filter chips pattern
- Consolidates segment filter into same FilterDialog (two facets: Segment, Jurisdictions)
- Works on mobile via Dialog/Tray (no inline popover needed)
- URL sync unchanged — still serializes to ?jurisdictions=CA,TX,NY
- tsc --noEmit: clean
@nicholasalanbrown nicholasalanbrown merged commit 276914a into main Feb 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant