feat: add directions panel with editable origin/destination inputs

New UX for Get Directions:
- DirectionsPanel component with two stacked input fields
- LocationInput component with autocomplete, coordinate parsing
- Swap button to flip origin/destination
- Travel mode selector (Drive default, Foot, MTB, ATV, 4x4)
- Boundary selector (only visible for non-Drive modes)
- Map click fills active input field with crosshair cursor
- Auto-route when both endpoints are filled
- X button closes directions and returns to search view

Store changes:
- directionsMode state for panel switching
- activeDirectionsField for map click targeting
- startDirections now enters directions mode with destination pre-filled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-05-08 22:44:45 +00:00
commit 7523ddd0a2
5 changed files with 656 additions and 17 deletions

View file

@ -7,6 +7,7 @@ import SearchBar from './SearchBar'
import ManeuverList from './ManeuverList'
import ContactList from './ContactList'
import { PlaceCard } from './PlaceCard'
import DirectionsPanel from './DirectionsPanel'
const TRAVEL_MODES = [
{ id: 'auto', label: 'Drive', Icon: Car },
@ -39,6 +40,8 @@ export default function Panel({ onClearRoute }) {
const activeTab = useStore((s) => s.activeTab)
const auth = useStore((s) => s.auth)
const setActiveTab = useStore((s) => s.setActiveTab)
const directionsMode = useStore((s) => s.directionsMode)
const setDirectionsMode = useStore((s) => s.setDirectionsMode)
const panelState = usePanelState()
@ -86,7 +89,12 @@ export default function Panel({ onClearRoute }) {
const showRouteSection = hasRoutePoints || routeResult || routeLoading
const showEmptyState = panelState === 'IDLE' && !hasRoutePoints
const routesContent = (
const routesContent = directionsMode ? (
<DirectionsPanel onClose={() => {
setDirectionsMode(false)
onClearRoute?.()
}} />
) : (
<>
<SearchBar />