| `P1W` (more than the preview holds) | the horizon end | all five windows |
| none / zero | the horizon end | all five windows |
Falling back to the horizon when the preview is *shorter* than the duration is deliberate:
there is nothing more to book, and trimming would only drop windows the operator asked for.
`from` is still the searched horizon start — nothing before the first window is open, so the
server clips it away.
The header caption reports what the button will actually do, because the duration can now
stop the span short of the table:
```
Book separate reserves one window; Book whole span reserves the first 1 of 2 as one group.
```
**Book separate** is unchanged: in clipped mode it still books the window as offered
(the server does not apply the duration per window, so trimming there would book
something the preview never showed).
## Changed files
| File | Change |
|---|---|
| `src/features/availability/AvailabilitySearchPage.tsx` | `spanExtent()`; `handleBookSpan` sends its `end` as `to`; header caption counts the windows the span takes. |
| `src/features/availability/AvailabilitySearchPage.test.tsx` | `searchClipped()` split out of `searchClippedAndBookSpan()`, both taking `initialEntries` so the duration can be seeded from the URL; 5 tests added. |
## Tests
- ends the span where the windows have added up to the requested duration (`PT2H` → first
window start + 2h), with `from` still the horizon start;
- carries the span into later windows when one is not enough (`PT12H` → second window start + 4h);
- books the whole horizon when the preview is shorter than the requested duration;
- says "the first 1 of 2" when the duration stops it short, and "all 2" when it does not.
Changes for docs/index.md: 1 added line, 0 removed lines.
Original line number
Diff line number
Diff line
@@ -2,6 +2,7 @@
| Date | File | Description |
|---|---|---|
| 2026-08-09 16:40 | ["Book whole span" now respects the requested duration](20260809_1640_book_whole_span_respects_duration.md) | The span handed the reservation form the searched horizon verbatim, so *Slot duration* was write-only on that path and a two-hour request booked every window the preview returned; the fix is **not**`To = From + duration` — a clipped span books *open time*, so eight hours is however many calendar windows add up to eight, and a wall-clock range that wide against a 9-to-5 calendar would book fewer — `spanExtent()` walks the preview accumulating window lengths and ends the span the moment the duration is met, inside the last window when only part of it is needed (exact, since the server clips the span to the calendar either way); a preview shorter than the duration, or no duration at all, still books the whole horizon, and the header caption now says "the first *k* of *n*" so the button reports what it will actually reserve; **Book separate** is unchanged, because the server does not apply the duration per window in that mode; +5 tests (1042) |
| 2026-08-09 16:05 | [Availability results — "Book whole span" is a button, and the row action says "Book separate"](20260809_1605_availability_book_span_button.md) | The clipped-mode span action lived in the `action` slot of an info `Alert`, which renders a low-emphasis text button — the primary way to use a `CLIP_TO_CALENDAR` preview looked like a footnote, and an info box is not where an operator looks for something to click; it is now a `contained` button in the results header row beside the window count, with one caption naming both scopes, and the per-row action reads **Book separate** while the span button is on screen (still plain "Book" in `STRICT`, still "Select" in the embedded picker); the gating condition became a named `spanBookable` flag read by all three; presentation only — both handlers and their query strings, including the agreed-suggestion resource handoff, are untouched; +2 tests (1037) |
| 2026-08-09 15:45 | [Nav: Availability moves next to Pools, Assessment leaves the drawer](20260809_1545_nav_availability_after_pools.md) | **Availability** moved from below Reservations to directly after **Pools** — it is asked *about* a pool, `/pools/{id}` links straight into it per resource, and the drawer now reads in the order the work happens (pick a pool → ask when it is free → book it); **Assessment** dropped from the sidebar while keeping its route, page and capability, the same call made for Memberships: it answers a question about a service order, and opened cold from the drawer there is no order to assess; the order regression test reads the rendered link list rather than the `navItems` array, so it also fails if a capability hides Pools from under it; the one pre-existing `Shell.tsx``badge` tsc error changes only its message text, because the printed union now lists Availability second |
| 2026-08-09 15:30 | ["membershipId must not be null" — every reservation targets a resource](20260809_1530_reservation_requires_membership.md) | Book whole span → Create Reservation returned a 400 because both booking forms labelled the resource "(optional)" and offered "— Any resource —", and the codec dropped the field when empty — but `FeasibilityRequest` lists `membershipId` as required "for every pool category, capacity pools included", so there is no pool-level booking to express; `FeasibilityDraft.membershipId` is now required in the domain (which surfaced every construction site through `tsc -b`), the encoder sends it unconditionally, and both forms make the resource a required field that gates Submit instead of failing after the click, with an explicit message when the pool has no members; an alternative no longer clears the chosen resource (the kinds are all start/end moves, and clearing it now leaves the form unsubmittable); Book whole span carries the preview's suggested resource when — and only when — every window agrees on one; +8 tests (1033), lint 106 → 104 |