From e79a2591a144473f97293a130424ca4afe6f796c Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 4 Sep 2026 22:12:53 +0200 Subject: [PATCH] refactor(roadtrip): put the driving limits behind a button, and the walk beside the stay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two things the column was getting wrong. The limits sat open as a card, three rows of a narrow sidebar for something set once on the first day of planning and left alone after; they are behind a proper full-width button now, with what is currently set riding on the button so the form does not have to be open to read it. And the walk from the road was its own line under the stay, where it looked like an unrelated note; it wears the stay's two-part badge and sits beside it, because both answer the same question about a stop — one in time, one in a walk. --- .../Roadtrip/RoadtripLimitsCard.tsx | 150 +++++++++++------- .../components/Roadtrip/RoadtripSidebar.tsx | 52 ++++-- shared/src/i18n/ar/roadtrip.ts | 1 + shared/src/i18n/br/roadtrip.ts | 1 + shared/src/i18n/ca/roadtrip.ts | 1 + shared/src/i18n/cs/roadtrip.ts | 1 + shared/src/i18n/de/roadtrip.ts | 1 + shared/src/i18n/en/roadtrip.ts | 1 + shared/src/i18n/es/roadtrip.ts | 1 + shared/src/i18n/fr/roadtrip.ts | 1 + shared/src/i18n/gr/roadtrip.ts | 1 + shared/src/i18n/hu/roadtrip.ts | 1 + shared/src/i18n/id/roadtrip.ts | 1 + shared/src/i18n/it/roadtrip.ts | 1 + shared/src/i18n/ja/roadtrip.ts | 1 + shared/src/i18n/ko/roadtrip.ts | 1 + shared/src/i18n/nl/roadtrip.ts | 1 + shared/src/i18n/pl/roadtrip.ts | 1 + shared/src/i18n/ru/roadtrip.ts | 1 + shared/src/i18n/sv/roadtrip.ts | 1 + shared/src/i18n/tr/roadtrip.ts | 1 + shared/src/i18n/uk/roadtrip.ts | 1 + shared/src/i18n/vi/roadtrip.ts | 1 + shared/src/i18n/zh-TW/roadtrip.ts | 1 + shared/src/i18n/zh/roadtrip.ts | 1 + 25 files changed, 159 insertions(+), 66 deletions(-) diff --git a/client/src/components/Roadtrip/RoadtripLimitsCard.tsx b/client/src/components/Roadtrip/RoadtripLimitsCard.tsx index 44880d13d..6baeed246 100644 --- a/client/src/components/Roadtrip/RoadtripLimitsCard.tsx +++ b/client/src/components/Roadtrip/RoadtripLimitsCard.tsx @@ -1,17 +1,24 @@ -import React from 'react' -import { Clock, Fuel, CalendarClock } from 'lucide-react' +import React, { useState } from 'react' +import { Clock, Fuel, CalendarClock, SlidersHorizontal, ChevronRight } from 'lucide-react' +import Modal from '../shared/Modal' import { useTranslation } from '../../i18n/TranslationContext' import { useSettingsStore } from '../../store/settingsStore' -import { convertDistance } from '../../utils/units' +import { convertDistance, formatDistance } from '../../utils/units' +import { formatDurationShort } from './roadtripModel' import type { DistanceUnit } from '../../types' import { FS } from './typeScale' /** * The three numbers that decide when the rail speaks up about the driving. * + * Behind a button rather than laid out in the column, because this is set once and then + * read never: a permanent card costs three rows of a narrow sidebar for something most + * travellers touch on the first day of planning and leave alone after. The button carries + * the current answer, so what is set stays visible without the form being. + * * All three are personal rather than instance configuration: how long somebody is willing * to sit behind a wheel, and how far their car goes on a tank, belong to the traveller. - * They are stored as plain per-user settings, which is why this needs no migration. + * They are plain per-user settings, which is why this needs no migration. * * Nothing here suggests a stop, adds one, or knows anything about a vehicle. OSM has no * idea what car this is, and neither has TREK, so the range is a number the traveller @@ -33,9 +40,9 @@ function LimitRow({ icon: Icon, label, suffix, value, placeholder, onChange }: { onChange: (next: number) => void }): React.ReactElement { return ( -