From 04debce79e662a0ab27cab88092545572e246f4b Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 1 Nov 2026 11:41:56 +0100 Subject: [PATCH] fix(planner): keep the lint and size ratchets where they were The zone helpers of the day order take the merged row's own type instead of an explicit any, and the day list's size baseline follows it down. --- client/scripts/size-baseline.json | 2 +- client/src/utils/dayMerge.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/scripts/size-baseline.json b/client/scripts/size-baseline.json index efa4bd4cb..02df83ed1 100644 --- a/client/scripts/size-baseline.json +++ b/client/scripts/size-baseline.json @@ -11,7 +11,7 @@ "src/components/PDF/TripPDF.tsx": 1039, "src/components/Planner/DayDetailPanel.test.tsx": 2333, "src/components/Planner/DayPlanSidebar.test.tsx": 5349, - "src/components/Planner/DayPlanSidebar.tsx": 2936, + "src/components/Planner/DayPlanSidebar.tsx": 2929, "src/components/Planner/PlaceFormModal.test.tsx": 2836, "src/components/Planner/PlaceInspector.tsx": 1290, "src/components/Studio/TravelElements.tsx": 1559, diff --git a/client/src/utils/dayMerge.ts b/client/src/utils/dayMerge.ts index 34f33deee..83a8036c4 100644 --- a/client/src/utils/dayMerge.ts +++ b/client/src/utils/dayMerge.ts @@ -14,6 +14,9 @@ export interface MergedItem { data: any } +/** Reads a booking's time on one day, as getDisplayTimeForDay does. */ +type DisplayTimeOf = (r: MergedItem['data'], dayId: number) => string | null + export function parseTimeToMinutes(time?: string | null): number | null { if (!time) return null if (time.includes('T')) { @@ -365,7 +368,7 @@ function applyChronoOrder( export function chronoKeyOf( items: readonly MergedItem[], dayId: number, - getDisplayTime: (r: any, dayId: number) => string | null + getDisplayTime: DisplayTimeOf ): (it: MergedItem) => number | null { const clockOf = (it: MergedItem): number | null => { if (it.type === 'place') return parseTimeToMinutes(it.data?.place?.place_time) @@ -382,7 +385,7 @@ export function chronoKeyOf( * own pair of endpoints, and only when they line up one per stop with the legs (see * getTransportRouteEndpoints); the booking-wide zones belong to its outermost two. */ -function transportTimeZone(r: any, dayId: number): string | null { +function transportTimeZone(r: MergedItem['data'], dayId: number): string | null { const side = getSpanPhase(r, dayId) === 'end' ? 'to' : 'from' if (r?.__leg) { const ordered = orderedEndpoints(r) @@ -407,7 +410,7 @@ function transportTimeZone(r: any, dayId: number): string | null { function zonedClockSlots( items: MergedItem[], dayId: number, - getDisplayTime: (r: any, dayId: number) => string | null, + getDisplayTime: DisplayTimeOf, clockOf: (it: MergedItem) => number | null ): Map { const zoned = items.flatMap((it, index) => {