feat(web): event conflict warnings (UI task 19)#100
Merged
Conversation
Wraps the existing GET /api/calendar/conflicts endpoint in a debounced useConflictCheck hook (with a same-duration next-free-slot suggestion via a new useNextFreeSlotHint), and adds a presentational ConflictBanner that names the busy lobby member and offers the suggestion as a one-click fix.
…otModal CreateEventModal (create + edit) and ReserveSlotModal now show the amber ConflictBanner once lobby/start/end are set, resolved via useConflictCheck. CreateEventModal's primary button swaps to "Create Anyway"/"Save Anyway" while a conflict is shown; edit mode filters out the event's own overlap.
|
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.



Summary
GET /api/calendar/conflictsandGET /api/lobbies/{id}/free-slotsendpoints into a new debounceduseConflictCheckhook (src/hooks/useEvents.ts) plus auseNextFreeSlotHinthelper (src/hooks/useDashboard.ts).ConflictBannercomponent (src/components/ConflictBanner.tsx): a non-blocking amber banner naming the busy lobby member and their conflicting event, with a one-click "Next slot when everyone is free" suggestion that rewrites the start/end fields (same duration).CreateEventModal(create + edit, filtering out the event's own overlap in edit mode) andReserveSlotModal.CreateEventModal's primary button swaps to "Create Anyway" / "Save Anyway" while a conflict is shown; creation/reservation is never blocked.DONEinlined-web/docs/UI_TASKS.md.Test plan
npm run lintnpm run typechecknpm run test:run(533/533 passing, incl. 35 new tests acrossConflictBanner.test.tsx,CreateEventModal.test.tsx,ReserveSlotModal.test.tsx— conflict rendering, fail-open on 500, edit-mode filtering, suggestion click)npm run buildmockups/index.html#event-conflictat 1280×800 via MSW dev mode: opened "New Event" on a 2-member lobby with a mocked conflicting event and confirmed the amber banner names the busy member ("nastia_k already has "Yoga class" Sat, Jul 18 · 9 PM – 10 PM. You are free at this time."), the suggestion hint ("Next slot when everyone is free: Today 11 PM–12 AM →"), and the primary button swapping to "Create Anyway".🤖 Generated with Claude Code