fix: port slot grouping fixes across all booking journeys

UserBookingModal (reschedule): add lunch protection filtering, validation guard preventing invalid start>end unavailable blocks, composite each keys, and simplified available/unavailable rendering (lunch is invisible to users).

BookingCreateModal (admin): add validation guard for unavailable blocks and fix composite each keys. Admin lunch protection behavior (30min min + amber warning) preserved.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-05-10 14:26:28 +01:00
co-authored by Sisyphus
parent e1c815ed09
commit f3fb44f401
2 changed files with 53 additions and 13 deletions
@@ -652,12 +652,14 @@
if (currentUnavailableStart !== null) {
const unavailableStartTime = lastAvailableEndTime || currentUnavailableStart;
const groupEndTime = calculatePreviousTime(timeStr);
groupedSlots.push({
type: 'unavailable',
startTime: unavailableStartTime,
endTime: groupEndTime,
isGrouped: true
});
if (timeToMinutes(unavailableStartTime) < timeToMinutes(groupEndTime)) {
groupedSlots.push({
type: 'unavailable',
startTime: unavailableStartTime,
endTime: groupEndTime,
isGrouped: true
});
}
currentUnavailableStart = null;
}
@@ -1263,7 +1265,7 @@
{#if groupedTimeSlots.length > 0}
<div class="grid gap-2">
{#each groupedTimeSlots as slot (slot.startTime)}
{#each groupedTimeSlots as slot (slot.type + '-' + slot.startTime + '-' + slot.endTime)}
{#if slot.type === 'available'}
{@const protection = lunchProtectionStatus().get(slot.startTime)}
{#if protection?.isBlocked}