Skip to content

fix: reset the map view when table filters are cleared - #551

Merged
joaquimds merged 1 commit into
mainfrom
fix/filter-map-fit
Dec 1, 2026
Merged

joaquimds merged 1 commit into
mainfrom
fix/filter-map-fit

Conversation

@joaquimds

Copy link
Copy Markdown
Member

What

  • Clearing the open table's filters (all filters and the search) moves the map:
    • if another data source still has location filters (marker or turf), it fits to those
    • otherwise it resets to the initial "all markers" view
  • The location-filter fit now only fires when the location filters actually change, not whenever marker or turf queries refetch, and its padding leaves room for the control panel.
  • Opening or switching table no longer moves the map.
  • Free text and column filters still don't move the map (filtered markers are already faded or removed in place).
  • The initial fit is extracted from Map.tsx into a shared useFitToAllMarkers hook, used for both first load and reset.

Testing

  • Add a marker/turf filter, change its radius, remove it
  • Type a search, then clear it → resets to all markers
  • Location filter on data source A, then add and clear a filter on B → fits to A's filter
  • Open/switch tables with filters set → map doesn't move
  • Mobile layout

🤖 Generated with Claude Code

Clearing the open table's filters now fits the map to any location
filters left on other data sources, or resets it to the initial
all-markers view. The location-filter fit now only fires when the
filters change, not whenever marker or turf queries refetch, and
leaves room for the control panel.

The initial fit is extracted into a shared useFitToAllMarkers hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaquimds
joaquimds merged commit fd5d3af into main Dec 1, 2026
1 check passed
@joaquimds
joaquimds deleted the fix/filter-map-fit branch December 1, 2026 16:13
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