From 5678eed55c168130297367547a1c087e019e7052 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 12 Sep 2026 23:35:30 +0200 Subject: [PATCH] fix(client): use TREK's own controls for tooltips and journey dates Three small things noticed while working nearby, none of them Dawarich: The map's layer switcher showed the browser's own tooltip while every control beside it showed TREK's, so hovering along the row produced two different boxes in two different styles. The journey entry editor mixed TREK's date picker with a native time input, and the date, which is the longer of the two, had the narrower column: "12. Sept. 2026" wrapped while the clock sat half empty. The row is split in the date's favour now and the picker is disabled together with the rest of the form instead of staying live behind it. On the phone's journey, the dock's "+" now turns into an upload button while the Gallery tab is open, which is what that tab's one big action actually is. --- .../Journey/JourneyDetailPageEntryEditor.tsx | 12 ++++-- .../src/components/Map/MapLayerSwitcher.tsx | 42 +++++++++++-------- .../shared/CustomDateTimePicker.tsx | 7 +++- client/src/mobile/components/MBottomNav.tsx | 22 ++++++++-- .../screens/journey/MJourneyEntrySheet.tsx | 23 +++++----- client/src/store/journeyStore.ts | 11 +++++ .../journey/MJourneyEntrySheet.test.tsx | 28 +++++++++++-- 7 files changed, 101 insertions(+), 44 deletions(-) diff --git a/client/src/components/Journey/JourneyDetailPageEntryEditor.tsx b/client/src/components/Journey/JourneyDetailPageEntryEditor.tsx index a7d3e4668..27f4108d5 100644 --- a/client/src/components/Journey/JourneyDetailPageEntryEditor.tsx +++ b/client/src/components/Journey/JourneyDetailPageEntryEditor.tsx @@ -606,13 +606,17 @@ export function EntryEditor({ entry, journeyId, tripDates, galleryPhotos, trips, -
+ {/* The date needs the room, not the clock: a long localized date + ("12. Sept. 2026") wrapped onto a second line while the time field + sat half empty beside it. The row is split in the date's favour and + the location, which is a free-text search, gives some back. */} +
{/* Time sat in state and went to the server, it just had no input here — so a draft's auto-stamped clock time showed up in the timeline, the map, the PDF and the public share, and the desktop had no way to correct it (#1614). */} - {/* 136px, not 104: the custom picker adds a clock button and, in 12h, - shows "2:30 PM" where the native input showed a fixed-width HH:MM. */} -
+ {/* 112px: enough for the clock button plus "2:30 PM" in 12h, and no + more — the date column is what needed the space back. */} +
diff --git a/client/src/components/Map/MapLayerSwitcher.tsx b/client/src/components/Map/MapLayerSwitcher.tsx index 2c7db30b8..f9700d8dd 100644 --- a/client/src/components/Map/MapLayerSwitcher.tsx +++ b/client/src/components/Map/MapLayerSwitcher.tsx @@ -1,5 +1,6 @@ import { Map as MapIcon, Satellite } from 'lucide-react' import { useTranslation } from '../../i18n' +import { Tooltip } from '../shared/Tooltip' import { MAP_CONTROL_SHADOW } from './mapControlShadow' export type BaseLayer = 'default' | 'satellite' @@ -21,24 +22,29 @@ export function MapLayerSwitcher({ active, onToggle }: { active: BaseLayer; onTo WebkitBackdropFilter: 'blur(20px) saturate(180%)', boxShadow: MAP_CONTROL_SHADOW, }}> - + {/* Same tooltip as its neighbours on the map, for the same reasons — see + TripRouteOverviewPill. To the right, though: this one sits at the + bottom left of the map, where a tooltip to the left would land on the + day sidebar and one below would land off the screen. */} + + +
) } diff --git a/client/src/components/shared/CustomDateTimePicker.tsx b/client/src/components/shared/CustomDateTimePicker.tsx index 3bdb3441e..69c09ef07 100644 --- a/client/src/components/shared/CustomDateTimePicker.tsx +++ b/client/src/components/shared/CustomDateTimePicker.tsx @@ -21,6 +21,8 @@ interface CustomDatePickerProps { style?: React.CSSProperties; compact?: boolean; borderless?: boolean; + /** Read-only contexts (a shared journey, a locked form) — same as CustomTimePicker. */ + disabled?: boolean; // Optional inclusive ISO (YYYY-MM-DD) bounds. Dates outside the range are // disabled in the calendar and rejected on manual entry. min?: string; @@ -34,6 +36,7 @@ export function CustomDatePicker({ style = {}, compact = false, borderless = false, + disabled = false, min, max, }: CustomDatePickerProps) { @@ -299,6 +302,7 @@ export function CustomDatePicker({