fix(ux): Three UX improvements for feature selection

Fix 1: Never zoom out when clicking a feature - preserves user's
intentional zoom level by checking cameraForBounds before fitBounds

Fix 2: Single-click to switch between features - clicking outside
the current feature's circle clears selection and selects new feature

Fix 3: View mode toggle reflects saved state on load - initialize
viewMode from localStorage on store creation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-05-02 16:57:32 +00:00
commit 869391ee4e
2 changed files with 19 additions and 5 deletions

View file

@ -100,7 +100,7 @@ export const useStore = create((set, get) => ({
autocompleteOpen: false,
theme: 'dark', // 'dark' | 'light' (resolved value — what's actually applied)
themeOverride: null, // null | 'dark' | 'light' (manual override, persisted)
viewMode: 'map', // 'map' | 'satellite' | 'hybrid'
viewMode: (typeof localStorage !== 'undefined' && localStorage.getItem('navi-view-mode')) || 'map', // 'map' | 'satellite' | 'hybrid'
setSheetState: (s) => set({ sheetState: s }),
setViewMode: (mode) => {