Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

Merge branch 'dev' into feat/selective-file-import-perf

Julien G.4f01a1027728
diff --cc client/src/components/Map/MapView.tsx
index 17fa5f37f,6bec003f1..c28a2fb29
--- a/client/src/components/Map/MapView.tsx
+++ b/client/src/components/Map/MapView.tsx
@@@ -608,40 -564,29 +619,47 @@@ export const MapView = memo(function Ma
)}
{/* GPX imported route geometries */}
- {places.map((place) => {
- if (!place.route_geometry) return null
- try {
- const coords = JSON.parse(place.route_geometry) as [number, number][]
- if (!coords || coords.length < 2) return null
- return (
- <Polyline
- key={`gpx-${place.id}`}
- positions={coords}
- color={place.category_color || '#3b82f6'}
- weight={3.5}
- opacity={0.75}
- />
- )
- } catch { return null }
- })}
+ {gpxPolylines}
+
+ <ReservationOverlay
+ reservations={visibleReservations}
+ showConnections
+ showStats={showReservationStats}
+ onEndpointClick={onReservationClick}
+ />
</MapContainer>
+
+ {TooltipOverlay && (
+ <div data-testid="tooltip" style={{
+ position: 'fixed',
+ left: tooltipPos.x + 14,
+ top: tooltipPos.y - 10,
+ zIndex: 9999,
+ pointerEvents: 'none',
+ background: 'white',
+ borderRadius: 8,
+ boxShadow: '0 2px 10px rgba(0,0,0,0.15)',
+ padding: '6px 10px',
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif",
+ maxWidth: 220,
+ whiteSpace: 'nowrap',
+ }}>
+ <div style={{ fontWeight: 600, fontSize: 12, color: '#111827', overflow: 'hidden', textOverflow: 'ellipsis' }}>
+ {hoveredPlace.name}
+ </div>
+ {hoveredPlace.category_name && CatIcon && (
+ <div style={{ display: 'flex', alignItems: 'center', gap: 3, marginTop: 1 }}>
+ <CatIcon size={10} style={{ color: hoveredPlace.category_color || '#6b7280', flexShrink: 0 }} />
+ <span style={{ fontSize: 11, color: '#6b7280' }}>{hoveredPlace.category_name}</span>
+ </div>
+ )}
+ {hoveredPlace.address && (
+ <div style={{ fontSize: 11, color: '#9ca3af', marginTop: 2, overflow: 'hidden', textOverflow: 'ellipsis' }}>
+ {hoveredPlace.address}
+ </div>
+ )}
+ </div>
+ )}
+ </>
)
})
diff --cc client/src/components/Planner/DayPlanSidebar.tsx
index b30e532cd,b9c23e8ee..e8bcc1096
--- a/client/src/components/Planner/DayPlanSidebar.tsx
+++ b/client/src/components/Planner/DayPlanSidebar.tsx
@@@ -231,8 -239,16 +239,15 @@@ const DayPlanSidebar = React.memo(funct
const dropTargetRef = useRef(null)
const setDropTargetKey = (key) => { dropTargetRef.current = key; _setDropTargetKey(key) }
const [dragOverDayId, setDragOverDayId] = useState(null)
- const [hoveredId, setHoveredId] = useState(null)
const [transportDetail, setTransportDetail] = useState(null)
const [transportPosVersion, setTransportPosVersion] = useState(0)
+
+ useEffect(() => {
+ if (externalTransportDetail) {
+ setTransportDetail(externalTransportDetail)
+ onExternalTransportDetailHandled?.()
+ }
+ }, [externalTransportDetail, onExternalTransportDetailHandled])
const [timeConfirm, setTimeConfirm] = useState<{
dayId: number; fromId: number; time: string;
// For drag & drop reorder
diff --cc client/src/pages/TripPlannerPage.tsx
index 933e8086f,b8b5dc503..685092a01
--- a/client/src/pages/TripPlannerPage.tsx
+++ b/client/src/pages/TripPlannerPage.tsx
@@@ -169,8 -235,24 +235,25 @@@ export default function TripPlannerPage
const [fitKey, setFitKey] = useState<number>(0)
const [mobileSidebarOpen, setMobileSidebarOpen] = useState<'left' | 'right' | null>(null)
const [deletePlaceId, setDeletePlaceId] = useState<number | null>(null)
+ const [deletePlaceIds, setDeletePlaceIds] = useState<number[] | null>(null)
+ const connectionsStorageKey = tripId ? `trek:visible-connections:${tripId}` : null
+ const [visibleConnections, setVisibleConnections] = useState<number[]>(() => {
+ if (typeof window === 'undefined' || !connectionsStorageKey) return []
+ try {
+ const stored = window.localStorage.getItem(connectionsStorageKey)
+ return stored ? JSON.parse(stored) as number[] : []
+ } catch { return [] }
+ })
+ useEffect(() => {
+ if (typeof window === 'undefined' || !connectionsStorageKey) return
+ window.localStorage.setItem(connectionsStorageKey, JSON.stringify(visibleConnections))
+ }, [connectionsStorageKey, visibleConnections])
+ const toggleConnection = useCallback((id: number) => {
+ setVisibleConnections(prev => prev.includes(id) ? prev.filter(x => x !== id) : [...prev, id])
+ }, [])
+ const [mapTransportDetail, setMapTransportDetail] = useState<Reservation | null>(null)
+
const [isMobile, setIsMobile] = useState(() => window.innerWidth < 768)
useEffect(() => {
const mq = window.matchMedia('(max-width: 767px)')