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.
This commit is contained in:
Maurice
2026-11-01 11:41:56 +01:00
parent 4003769a5c
commit 04debce79e
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -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,
+6 -3
View File
@@ -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<MergedItem, number> {
const zoned = items.flatMap((it, index) => {