diff --git a/client/src/components/Planner/TransitJourneyModal.tsx b/client/src/components/Planner/TransitJourneyModal.tsx index 1de8a1ac2..2ea5d4fcf 100644 --- a/client/src/components/Planner/TransitJourneyModal.tsx +++ b/client/src/components/Planner/TransitJourneyModal.tsx @@ -241,7 +241,7 @@ export default function TransitJourneyModal({ reservation, onClose, onSave, onDe
{(transit.legs as TransitLegMeta[]).map((leg, i) => { - if (leg.mode === 'WALK') return + 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 @@ -253,10 +253,18 @@ export default function TransitJourneyModal({ reservation, onClose, onSave, onDe leg.stops ? t('transit.stops', { count: leg.stops }) : null, leg.agency || null, ].filter(Boolean).join(' · ') + // Names wrap instead of clipping; the platform gets its + // own quiet line below so it never pushes the name out. const stopName = (stop: TransitLegMeta['from']) => ( -
- {stop?.name} - {stop?.track && · {t('transit.platform', { track: stop.track })}} +
+
+ {stop?.name} +
+ {stop?.track && ( +
+ {t('transit.platform', { track: stop.track })} +
+ )}
) const timeCell = (time?: string | null) => ( diff --git a/client/src/components/Planner/TransitSearchPanel.tsx b/client/src/components/Planner/TransitSearchPanel.tsx index 369e11b2c..3a7a315d3 100644 --- a/client/src/components/Planner/TransitSearchPanel.tsx +++ b/client/src/components/Planner/TransitSearchPanel.tsx @@ -478,7 +478,7 @@ export default function TransitSearchPanel({ day, days, places, accommodations = const tzTo = to ? tzAt(to.lat, to.lng) : tzFrom const segBtn = (active: boolean): React.CSSProperties => ({ - padding: '6px 11px', fontSize: 'calc(12px * var(--fs-scale-body, 1))', borderRadius: 7, fontWeight: 500, + padding: isMobile ? '6px 5px' : '6px 11px', fontSize: isMobile ? 'calc(11px * var(--fs-scale-body, 1))' : 'calc(12px * var(--fs-scale-body, 1))', borderRadius: 7, fontWeight: 500, border: 0, cursor: 'pointer', fontFamily: 'inherit', whiteSpace: 'nowrap', background: active ? 'var(--bg-card)' : 'transparent', color: active ? 'var(--text-primary)' : 'var(--text-muted)', boxShadow: active ? '0 1px 4px rgba(0,0,0,0.08)' : 'none', diff --git a/client/src/components/Planner/transitDisplay.tsx b/client/src/components/Planner/transitDisplay.tsx index aff2604d8..aaf30d579 100644 --- a/client/src/components/Planner/transitDisplay.tsx +++ b/client/src/components/Planner/transitDisplay.tsx @@ -32,18 +32,23 @@ export function TransitWalkDivider({ leg, t, size = 'md' }: { size?: 'sm' | 'md' }) { const mins = leg.duration ? Math.round(leg.duration / 60) : null + const isMobile = typeof window !== 'undefined' && window.innerWidth < 768 // Hairlines that fade towards the outer edges — strongest next to the text. const rule = (dir: 'left' | 'right'): React.CSSProperties => ({ flex: 1, height: 1, minWidth: 12, borderRadius: 1, background: `linear-gradient(to ${dir}, var(--text-faint), transparent)`, opacity: 0.55, }) + // On phones the minutes lead so a long stop name only ever clips the name. + const text = isMobile + ? `${mins ? `${t('transit.min', { count: mins })} · ` : ''}${t('transit.walkTo', { name: leg.to?.name || '' })}` + : `${t('transit.walkTo', { name: leg.to?.name || '' })}${mins ? ` · ${t('transit.min', { count: mins })}` : ''}` return (
- + - {t('transit.walkTo', { name: leg.to?.name || '' })}{mins ? ` · ${t('transit.min', { count: mins })}` : ''} + {text}