From 5aee7aa5419f45fd24dbf7b04437b07c284eb8b1 Mon Sep 17 00:00:00 2001 From: Forfold Date: Fri, 12 Dec 2025 09:48:42 -0800 Subject: [PATCH 1/3] guarantee every day header is rendered --- .../schedules/temp-sched/TempSchedShiftsList.tsx | 7 +------ .../app/schedules/temp-sched/shiftsListUtil.test.ts | 7 +++---- web/src/app/schedules/temp-sched/shiftsListUtil.tsx | 13 ++++++++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/web/src/app/schedules/temp-sched/TempSchedShiftsList.tsx b/web/src/app/schedules/temp-sched/TempSchedShiftsList.tsx index 1b21844a13..4a093fe770 100644 --- a/web/src/app/schedules/temp-sched/TempSchedShiftsList.tsx +++ b/web/src/app/schedules/temp-sched/TempSchedShiftsList.tsx @@ -124,12 +124,7 @@ export default function TempSchedShiftsList({ zone, handleCoverageGapClick, ) - const subheaderItems = getSubheaderItems( - schedInterval, - shifts, - shiftDur as Duration, - zone, - ) + const subheaderItems = getSubheaderItems(schedInterval, shifts, zone) const outOfBoundsItems = getOutOfBoundsItems(schedInterval, shifts, zone) diff --git a/web/src/app/schedules/temp-sched/shiftsListUtil.test.ts b/web/src/app/schedules/temp-sched/shiftsListUtil.test.ts index bcdeba22aa..88e47d02b8 100644 --- a/web/src/app/schedules/temp-sched/shiftsListUtil.test.ts +++ b/web/src/app/schedules/temp-sched/shiftsListUtil.test.ts @@ -31,7 +31,6 @@ describe('getSubheaderItems', () => { const result = getSubheaderItems( schedInterval, tc.shifts, - tc.shiftDuration as Duration, tc.zone, ) @@ -87,7 +86,7 @@ describe('getSubheaderItems', () => { schedIntervalISO: `${'2021-08-13T00:00:00.000-05:00'}/${'2021-08-14T01:00:00.000-05:00'}`, shifts: [], shiftDuration: Duration.fromObject({ hours: 25 }), - expected: ['Friday, August 13'], + expected: ['Friday, August 13', 'Saturday, August 14'], zone: chicago, }) @@ -96,7 +95,7 @@ describe('getSubheaderItems', () => { schedIntervalISO: `${'2021-08-13T00:00:00.000-05:00'}/${'2021-08-15T02:00:00.000-05:00'}`, shifts: [], shiftDuration: Duration.fromObject({ hours: 50 }), - expected: ['Friday, August 13'], + expected: ['Friday, August 13', 'Saturday, August 14', 'Sunday, August 15'], zone: chicago, }) @@ -177,7 +176,7 @@ describe('getSubheaderItems', () => { }, ], shiftDuration: Duration.fromObject({ hours: 30 }), - expected: ['Friday, August 13', 'Saturday, August 14'], + expected: ['Friday, August 13', 'Saturday, August 14', 'Sunday, August 15'], zone: chicago, }) }) diff --git a/web/src/app/schedules/temp-sched/shiftsListUtil.tsx b/web/src/app/schedules/temp-sched/shiftsListUtil.tsx index f04365e257..c16c00a9f1 100644 --- a/web/src/app/schedules/temp-sched/shiftsListUtil.tsx +++ b/web/src/app/schedules/temp-sched/shiftsListUtil.tsx @@ -31,7 +31,6 @@ export type Sortable = T & { export function getSubheaderItems( schedInterval: Interval, shifts: Shift[], - shiftDur: Duration, zone: ExplicitZone, ): Sortable[] { if (!schedInterval.isValid) { @@ -49,10 +48,14 @@ export function getSubheaderItems( ...shifts.map((s) => DateTime.fromISO(s.end, { zone })), ) - const dayInvs = splitShift( - Interval.fromDateTimes(lowerBound, upperBound), - shiftDur, - ) + const dayInvs: Interval[] = [] + let currentDay = lowerBound.startOf('day') + + while (currentDay < upperBound) { + const nextDay = currentDay.plus({ days: 1 }) + dayInvs.push(Interval.fromDateTimes(currentDay, nextDay)) + currentDay = nextDay + } return dayInvs.map((day) => { const at = day.start.startOf('day') From 44643fe7404909476f196f55bda81f03d68e98f3 Mon Sep 17 00:00:00 2001 From: Forfold Date: Fri, 12 Dec 2025 09:52:48 -0800 Subject: [PATCH 2/3] lint fix --- web/src/app/schedules/temp-sched/shiftsListUtil.test.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/web/src/app/schedules/temp-sched/shiftsListUtil.test.ts b/web/src/app/schedules/temp-sched/shiftsListUtil.test.ts index 88e47d02b8..67aa05ecc2 100644 --- a/web/src/app/schedules/temp-sched/shiftsListUtil.test.ts +++ b/web/src/app/schedules/temp-sched/shiftsListUtil.test.ts @@ -28,11 +28,7 @@ describe('getSubheaderItems', () => { const schedInterval = Interval.fromISO(tc.schedIntervalISO, { zone: tc.zone, }) - const result = getSubheaderItems( - schedInterval, - tc.shifts, - tc.zone, - ) + const result = getSubheaderItems(schedInterval, tc.shifts, tc.zone) expect(result).toHaveLength(tc.expected.length) expect(_.uniq(result.map((r) => r.id))).toHaveLength(tc.expected.length) From 1c0108b3945511b1280e3e0b3ca4a08254fda5c5 Mon Sep 17 00:00:00 2001 From: Forfold Date: Fri, 12 Dec 2025 10:06:35 -0800 Subject: [PATCH 3/3] transpile the ESM-only wouter package --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ce60eb1c4..bcf05ea434 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,10 @@ "transform": { "^.+\\.(j|t)sx?$": "esbuild-jest" }, - "rootDir": "web/src" + "rootDir": "web/src", + "transformIgnorePatterns": [ + "node_modules/(?!wouter)" + ] }, "standard": { "parser": "babel-eslint",