From 132ddcad16de46d0e206bfb6ca78b5bfb6f5771d Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 3 Jul 2026 10:41:44 +0200 Subject: [PATCH] fix(planner): tighter mobile transit search + vertical journey itinerary --- .../Planner/TransitJourneyModal.tsx | 68 +++++++++++++++++-- .../components/Planner/TransitSearchPanel.tsx | 24 ++++--- 2 files changed, 75 insertions(+), 17 deletions(-) diff --git a/client/src/components/Planner/TransitJourneyModal.tsx b/client/src/components/Planner/TransitJourneyModal.tsx index 33db3f9ee..1de8a1ac2 100644 --- a/client/src/components/Planner/TransitJourneyModal.tsx +++ b/client/src/components/Planner/TransitJourneyModal.tsx @@ -212,14 +212,13 @@ export default function TransitJourneyModal({ reservation, onClose, onSave, onDe {transit && ( <> - {/* journey stats — three full-width tiles */} + {/* journey stats — three full-width tiles; iconless and flat on mobile */}
{statTiles.map(({ Icon, value, label }, i) => ( isMobile ? ( -
- +
{value}
-
{label}
+
{label}
) : (
@@ -244,9 +243,66 @@ export default function TransitJourneyModal({ reservation, onClose, onSave, onDe {(transit.legs as TransitLegMeta[]).map((leg, i) => { if (leg.mode === 'WALK') return const mins = leg.duration ? Math.round(leg.duration / 60) : null + if (isMobile) { + // The wide from → to line plus the chip row doesn't fit a + // phone: each leg becomes a depart / ride / arrive rail in + // the line's color, meta as one quiet text line. + const color = leg.line_color || 'var(--text-muted)' + const metaLine = [ + mins ? t('transit.min', { count: mins }) : null, + leg.stops ? t('transit.stops', { count: leg.stops }) : null, + leg.agency || null, + ].filter(Boolean).join(' · ') + const stopName = (stop: TransitLegMeta['from']) => ( +
+ {stop?.name} + {stop?.track && · {t('transit.platform', { track: stop.track })}} +
+ ) + const timeCell = (time?: string | null) => ( +
+ {time || ''} +
+ ) + return ( +
+ {timeCell(leg.from?.time)} +
+ + +
+ {stopName(leg.from)} +
+
+ +
+
+
+ + {leg.line || leg.mode} + + {leg.headsign && ( + + + {leg.headsign} + + )} +
+ {metaLine && ( +
{metaLine}
+ )} +
+ {timeCell(leg.to?.time)} +
+ +
+ {stopName(leg.to)} +
+ ) + } return ( -
-
+
+
{leg.from?.time || ''}
diff --git a/client/src/components/Planner/TransitSearchPanel.tsx b/client/src/components/Planner/TransitSearchPanel.tsx index 8b884b0ee..369e11b2c 100644 --- a/client/src/components/Planner/TransitSearchPanel.tsx +++ b/client/src/components/Planner/TransitSearchPanel.tsx @@ -486,18 +486,20 @@ export default function TransitSearchPanel({ day, days, places, accommodations = return (
- {/* from / to — stacked on mobile with the swap between the fields */} -
+ {/* from / to — stacked tight on mobile, swap button on desktop only */} +
- + {!isMobile && ( + + )}