From ed81b4e18632d5a9448bbf2f9849ebc7573d1bca Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 26 Apr 2026 23:38:42 +0000 Subject: [PATCH] fix: directions card visible when pendingDestination set with no stops Symptom: clicking Get Directions with GPS denied closed the place card and showed empty map. User had no UI to pick an origin. Root cause: commit 9db8cec correctly stopped adding destination to stops (fixing duplicate), but Panel.jsx only rendered StopList when panelState was ROUTING/CALCULATED. With pendingDestination set but stops empty, panelState was IDLE and StopList never mounted. Fix: showRouteSection is now true when pendingDestination is truthy, regardless of panelState. showEmptyState is false when pendingDestination is set. StopList renders and displays its "Search for a starting point" prompt. --- src/components/Panel.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Panel.jsx b/src/components/Panel.jsx index d6dd2a0..b54cb95 100644 --- a/src/components/Panel.jsx +++ b/src/components/Panel.jsx @@ -12,6 +12,7 @@ import { requestOptimizedRoute } from '../api' export default function Panel({ onManeuverClick }) { const selectedPlace = useStore((s) => s.selectedPlace) + const pendingDestination = useStore((s) => s.pendingDestination) const clearSelectedPlace = useStore((s) => s.clearSelectedPlace) const stops = useStore((s) => s.stops) const mode = useStore((s) => s.mode) @@ -128,9 +129,9 @@ export default function Panel({ onManeuverClick }) { // Determine what to show based on panel state const showPreviewCard = panelState.startsWith('PREVIEW') - const showRouteSection = ['ROUTING', 'ROUTE_CALCULATED', 'PREVIEW_ROUTING', 'PREVIEW_CALCULATED'].includes(panelState) + const showRouteSection = ['ROUTING', 'ROUTE_CALCULATED', 'PREVIEW_ROUTING', 'PREVIEW_CALCULATED'].includes(panelState) || !!pendingDestination const showManeuvers = panelState === 'ROUTE_CALCULATED' || panelState === 'PREVIEW_CALCULATED' - const showEmptyState = panelState === 'IDLE' + const showEmptyState = panelState === 'IDLE' && !pendingDestination // Routes tab content - now state-driven const routesContent = (