fix(booking): snap concept block start to nearest quarter, keep duration#8
Merged
Conversation
The VAN/TOT dropdowns only offer quarter-hour options, so a raw block time like 16:11 matched no <option> and the <select> silently fell back to its first entry — which is why concept blocks (and entries booked elsewhere) opened as 07:00–07:00. Snap the seeded start to the nearest quarter and carry the original duration (quarter-rounded, min 15m) in useBooking, the single chokepoint all booking-form paths flow through, so both dropdowns land on a real option and the booked range still reflects the block (16:11–16:41 → 16:15–16:45). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Probleem
Bij blokken die nog niet op een kwartier vallen (concept-blokken én entries die buiten de app geboekt zijn) stonden de VAN en TOT velden altijd op
07:00 – 07:00.Oorzaak: de VAN/TOT-dropdowns (
TimeSelect) bieden alleen kwartier-opties aan (07:00,07:15, …20:00). Een ruwe bloktijd als16:11matcht geen enkele<option>, en een<select>valt dan stilletjes terug op zijn eerste optie —07:00.Fix
In
useBooking— het ene punt waar alle boekpaden (concept klikken, suggestie, drag, bewerken) doorheen lopen — wordt de starttijd bij het openen nu op het dichtstbijzijnde kwartier gezet en de duur behouden:16:11→16:15(dichtstbijzijnde kwartier)30 minblijft behouden → TOT16:45De duur wordt óók op een heel kwartier afgerond (min. 15 min), zodat de TOT-dropdown altijd op een echte optie landt in plaats van weer terug te vallen op
07:00. Zonder starttijd blijft de oude default09:00 – 09:30.Tests & verificatie
16:11 → 16:15 / 16:45-scenariotsc --noEmitschoon, lint-neutraal (geen nieuwe meldingen)🤖 Generated with Claude Code