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.
This commit is contained in:
Matt 2026-04-26 23:38:42 +00:00
commit ed81b4e186

View file

@ -12,6 +12,7 @@ import { requestOptimizedRoute } from '../api'
export default function Panel({ onManeuverClick }) { export default function Panel({ onManeuverClick }) {
const selectedPlace = useStore((s) => s.selectedPlace) const selectedPlace = useStore((s) => s.selectedPlace)
const pendingDestination = useStore((s) => s.pendingDestination)
const clearSelectedPlace = useStore((s) => s.clearSelectedPlace) const clearSelectedPlace = useStore((s) => s.clearSelectedPlace)
const stops = useStore((s) => s.stops) const stops = useStore((s) => s.stops)
const mode = useStore((s) => s.mode) const mode = useStore((s) => s.mode)
@ -128,9 +129,9 @@ export default function Panel({ onManeuverClick }) {
// Determine what to show based on panel state // Determine what to show based on panel state
const showPreviewCard = panelState.startsWith('PREVIEW') 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 showManeuvers = panelState === 'ROUTE_CALCULATED' || panelState === 'PREVIEW_CALCULATED'
const showEmptyState = panelState === 'IDLE' const showEmptyState = panelState === 'IDLE' && !pendingDestination
// Routes tab content - now state-driven // Routes tab content - now state-driven
const routesContent = ( const routesContent = (