Skip to content

feat(web): event conflict warnings (UI task 19)#100

Merged
Pan14ek merged 3 commits into
mainfrom
feature/ui-19-event-conflict-warnings
Jul 18, 2026
Merged

feat(web): event conflict warnings (UI task 19)#100
Pan14ek merged 3 commits into
mainfrom
feature/ui-19-event-conflict-warnings

Conversation

@Pan14ek

@Pan14ek Pan14ek commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Wires the existing GET /api/calendar/conflicts and GET /api/lobbies/{id}/free-slots endpoints into a new debounced useConflictCheck hook (src/hooks/useEvents.ts) plus a useNextFreeSlotHint helper (src/hooks/useDashboard.ts).
  • Adds a ConflictBanner component (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).
  • Wires the banner into CreateEventModal (create + edit, filtering out the event's own overlap in edit mode) and ReserveSlotModal. CreateEventModal's primary button swaps to "Create Anyway" / "Save Anyway" while a conflict is shown; creation/reservation is never blocked.
  • Fails open: a loading or failed conflicts check never shows a banner or blocks submission.
  • Marks UI task 19 DONE in lined-web/docs/UI_TASKS.md.

Test plan

  • npm run lint
  • npm run typecheck
  • npm run test:run (533/533 passing, incl. 35 new tests across ConflictBanner.test.tsx, CreateEventModal.test.tsx, ReserveSlotModal.test.tsx — conflict rendering, fail-open on 500, edit-mode filtering, suggestion click)
  • npm run build
  • Manually verified against mockups/index.html#event-conflict at 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

Pan14ek added 3 commits July 18, 2026 13:01
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.
@sonarqubecloud

Copy link
Copy Markdown

@Pan14ek
Pan14ek merged commit 7663670 into main Jul 18, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant