diff --git a/client/src/mobile/screens/trip/plan/MPlanTimeline.tsx b/client/src/mobile/screens/trip/plan/MPlanTimeline.tsx index 95d4b6ce7..33a7a2bf2 100644 --- a/client/src/mobile/screens/trip/plan/MPlanTimeline.tsx +++ b/client/src/mobile/screens/trip/plan/MPlanTimeline.tsx @@ -508,12 +508,15 @@ function TimelineHeader({ tl, dayLabel, openLabel, weatherLabel, onOpenDay, onOp stayLabel: (chip: HotelChip) => string }) { const WeatherIcon = weatherIconFor(tl.weather?.main) + const [strip, setStrip] = useState(null) + const stripFade = useEdgeFade(strip) return (
{/* The one horizontal scroller inside the day pager. Nested scrolling is the browser's: while the chips overflow they pan first, and the pager - takes over at their end or when they fit. */} - + takes over at their end or when they fit. The ends fade while more + waits behind them. */} + {/* The same glass controls as the edit header's: a round one when the day is already named above it, a pill with the day's name otherwise. */} - {/* A stay gives way before anything else in the header does: its name ends - in an ellipsis rather than under the edge or the weather (the chip's - label says it whole), and the time after it stays. */} + {/* A stay's name stands whole: two stays and the weather rarely fit a + phone, and a name cut to a letter or two said nothing, so the strip + scrolls instead of squeezing the chips. */} {tl.hotelChips.map(chip => ( ))} diff --git a/client/tests/unit/mobile/trip/MPlanTimeline.test.tsx b/client/tests/unit/mobile/trip/MPlanTimeline.test.tsx index d6178df82..5933e3102 100644 --- a/client/tests/unit/mobile/trip/MPlanTimeline.test.tsx +++ b/client/tests/unit/mobile/trip/MPlanTimeline.test.tsx @@ -218,13 +218,16 @@ describe('MPlanTimeline', () => { weatherTemp: 17, }) - // The name gives way with an ellipsis; the time after it stays, with no dot between. + // The name stands whole, never cut to a few letters: the chip keeps its + // size and the strip scrolls instead. The time follows with no dot between. const sacher = screen.getByText('Hotel Sacher') - expect(sacher).toHaveClass('truncate', 'min-w-0') - // In an Arabic header a Latin name keeps its own direction, so the ellipsis lands at its end. + expect(sacher).not.toHaveClass('truncate') + // In an Arabic header a Latin name keeps its own direction. expect(sacher).toHaveAttribute('dir', 'auto') expect(sacher.closest('button')).toHaveTextContent('Hotel Sacher11:00') - expect(sacher.closest('button')).toHaveClass('shrink') + expect(sacher.closest('button')).toHaveClass('flex-none') + expect(sacher.closest('button')).not.toHaveClass('shrink') + expect(sacher.closest('button')?.parentElement).toHaveClass('overflow-x-auto') expect(screen.getByText('Ryokan Kyoto').closest('button')).toHaveTextContent('Ryokan Kyoto15:00') expect(screen.getByText('Capsule Tokyo')).toBeInTheDocument() expect(screen.getByText('17°')).toBeInTheDocument()