From 904eb31e625291ba89427ff59ed371ee052163c3 Mon Sep 17 00:00:00 2001 From: Maurice Date: Tue, 20 Oct 2026 20:48:33 +0200 Subject: [PATCH] fix(tours): even the tour detail's rows and footer The times fill their row when there are two, the trip days are boxes in the look of the measures with the date under the day, the footer's collection button carries its label like the others and the copy button says Copy, and the name field keeps its distance to a save button as large as the close button. --- .../src/components/Tours/TourDetailDialog.tsx | 24 +++++++----- client/src/components/Tours/tourParts.tsx | 38 +++++++++++++++++++ 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/client/src/components/Tours/TourDetailDialog.tsx b/client/src/components/Tours/TourDetailDialog.tsx index aa46f42f4..0b980647d 100644 --- a/client/src/components/Tours/TourDetailDialog.tsx +++ b/client/src/components/Tours/TourDetailDialog.tsx @@ -61,7 +61,7 @@ import { SkiHeadPill } from './ski/skiMarks'; import { tourDayRowIcon } from './tourDayRowIcon'; import { tourDaysOf } from './tourDays'; import { heightsUnknown, movingTimeLabel, withoutHeights } from './tourFacts'; -import { TourDayPills, TourFactFields, TourMetricFields, type TourMetricField } from './tourParts'; +import { TourDayTiles, TourFactFields, TourMetricFields, type TourMetricField } from './tourParts'; import { formatPlannedTourDuration, hikeSourceBadgeLabel, @@ -159,7 +159,13 @@ function TourDetailMeasures({ ) : ( <> - {timeFields.length > 0 && } + {/* The times fill the row: two share it, three take a third each. */} + {timeFields.length > 0 && ( + = 3 ? 3 : undefined} + /> + )} )} {analysis.distanceIndexedProfileSamples.length >= 2 && ( @@ -430,7 +436,7 @@ function TourNameHeading({ ); if (onUpdatePlace && editingName) { return ( -
+
@@ -453,9 +459,9 @@ function TourNameHeading({ onClick={() => void saveName()} disabled={savingName} aria-label={t('common.save')} - className="grid h-7 w-7 flex-none place-items-center rounded-full bg-accent text-accent-text disabled:opacity-50" + className="grid h-8 w-8 flex-none place-items-center rounded-full bg-accent text-accent-text shadow-sm disabled:opacity-50" > - +
@@ -710,9 +716,7 @@ export default function TourDetailDialog({ {tourDays.length > 0 ? ( -
- -
+ ) : (

{t('tours.days.none')} @@ -809,7 +813,7 @@ function SaveAsNewButton({ onSave }: { onSave: () => Promise | void }) { icon={saving ? : } aria-label={t('tours.copy.action')} > - {t('tours.copy.action')} + {t('common.copy')} diff --git a/client/src/components/Tours/tourParts.tsx b/client/src/components/Tours/tourParts.tsx index e0d1910fc..c181d137b 100644 --- a/client/src/components/Tours/tourParts.tsx +++ b/client/src/components/Tours/tourParts.tsx @@ -12,6 +12,7 @@ import { BOX, Eyebrow } from '../Planner/bookings/bookingParts' import { SoftPill, WhiteBadge } from '../Planner/planParts' import { hikeSourceBadgeLabel, tourSource } from './tourPresentation' import { type TourDay, dayMenuLabel } from './tourDays' +import { formatDate } from '../../utils/formatters' import { tourMetricFacts } from './tourFacts' import type { TourDayAssignment } from './useTourDayAssignment' import { useRailFold } from './railFold' @@ -181,6 +182,43 @@ export function TourDayPills({ ) } +/** + * The days a tour is on, as the detail shows them: one box per day in the look + * of the measures below, so the days and the numbers read as one block. The + * date sits under the day's number where the day has one; the tooltip names + * the day in full. + */ +export function TourDayTiles({ tourDays }: { tourDays: readonly TourDay[] }) { + const { t, locale } = useTranslation() + return ( +

+ {tourDays.map((tourDay) => { + const full = dayMenuLabel(tourDay.day, tourDay.index, t, locale) + const date = formatDate(tourDay.day.date, locale) + return ( + + + + + {t('dayplan.dayN', { n: tourDay.index + 1 })} + + {date && ( + + {date} + + )} + + + ) + })} +
+ ) +} + /** * Putting a tour on a day: a round "+" on a row, or a footer button with a * chevron, both opening the trip's days as a menu. Which days it offers and