Skip to content

feat: add geolocation with Near Me button - #12

Merged
mitoperni merged 1 commit into
mainfrom
feat/geolocation
Feb 5, 2026
Merged

mitoperni merged 1 commit into
mainfrom
feat/geolocation

Conversation

@mitoperni

@mitoperni mitoperni commented Feb 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add useGeolocation hook with browser geolocation API integration and permission handling
  • Create NearMeButton component with loading, error, and default states
  • Integrate button in network map (zoom 11) and stations map (zoom 16)
  • Improve cleanStationName utility to handle more edge cases (short codes, underscores, ALL CAPS)
  • Fix station cluster markers race condition with style loading
  • Update network detail layout structure

Test plan

  • Click "Near me" button on home page → browser requests location permission
  • Accept permission → map flies to user location at zoom 11
  • Navigate to network detail page → click "Near me" button
  • Map flies to user location at zoom 16 to see nearby stations
  • Deny permission → button shows error state (red with X icon)
  • Click error button → clears error and retries location request
  • Verify 141 tests pass with npm run test

- Create useGeolocation hook with permission handling and error states
- Add NearMeButton component with loading, error, and default states
- Integrate button in both network map (zoom 11) and stations map (zoom 16)
- Add GeolocationPosition and GeolocationError types
- Improve cleanStationName utility to handle more edge cases
- Fix station cluster markers style loading race condition
- Update network detail layout structure
- Add comprehensive tests for hook and component (22 new tests)
@mitoperni
mitoperni merged commit 020d5a6 into main Feb 5, 2026
4 checks passed
@mitoperni
mitoperni deleted the feat/geolocation branch February 10, 2026 08:10
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