fix(tours): keep a multi-day tour's days in sight in the list row

The stage count sat in the row's fixed-height line of badges, so a tour
with stages and a recorded track wrapped and lost its days badge. The
count now sits on the fold button, a moon with the number at its corner,
or beside the row where it does not unfold, and the days come before the
measures so the ascent is what gets cut.
This commit is contained in:
Maurice
2026-10-20 16:44:55 +02:00
parent a1d683d7bc
commit 2ee4ea1e65
6 changed files with 108 additions and 22 deletions
@@ -137,6 +137,12 @@ describe('TourPlannerToursRail', () => {
const hutToHut = { ...tour, place_id: 43, name: 'Hut to hut', stage_count: 2 }
render(<TourPlannerToursRail planner={planner({ mode: { type: 'new-draft' } })} tours={[tour, hutToHut]} {...railProps} />)
expect(screen.getAllByRole('button', { name: 'Show stages' })).toHaveLength(1)
// The count sits on the fold button, always in sight, never in the row's line of badges.
const unfold = screen.getByRole('button', { name: 'Show stages' })
expect(unfold).toHaveAccessibleDescription('2 stages')
expect(within(unfold).getByTestId('tour-stages-count')).toHaveTextContent('2')
const row = screen.getByRole('option', { name: /Hut to hut/ })
expect(within(within(row).getByTestId('tour-metrics')).queryByText(/stages/)).toBeNull()
expect(screen.queryByTestId('tour-stage-overview')).toBeNull()
await userEvent.click(screen.getByRole('button', { name: 'Show stages' }))
expect(screen.getByTestId('tour-stage-overview')).toHaveAttribute('id', 'tour-stages-43')