Repository navigation
Schedule sessions from the New session dialog - #525
Conversation
[Medium impact] The changes affect how coaches schedule and reschedule sessions. Fix the calendar-read and multiple-overlap paths before merging.
|
| const busySource = useEnrichedCoachingSessionsForUser( | ||
| userId, | ||
| window.from, | ||
| window.to, | ||
| [CoachingSessionInclude.Relationship], | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| timezone | ||
| ).enrichedSessions; |
There was a problem hiding this comment.
useScheduleData drops the busy read's loading and error state. On an uncached month, a slow or failed request returns an empty list. The dialog then offers occupied times as free and lets the coach submit without resolving the overlap. Keep availability in a loading/error state and block confirmation until the selected range has loaded successfully.
There was a problem hiding this comment.
Fixed on #527 in "fix(scheduling): don't confirm against an unread calendar, a second overlap, or a loading series rule".
| const [first] = overlapping(slot, busy); | ||
| if (!first) return None; | ||
| return Some({ session: first, instead: nextFreeStart(slot, busyOn(busy, slot.start, None), hours) }); |
There was a problem hiding this comment.
clashFor keeps only the first overlapping session. A long new session can overlap two existing sessions. Moving the first enables confirmation while the second still overlaps, without asking the coach to keep that overlap. Track all clashes and require a choice for each before confirming.
There was a problem hiding this comment.
Fixed on #527 in "fix(scheduling): don't confirm against an unread calendar, a second overlap, or a loading series rule".
466edae to
995de21
Compare
9db43e5 to
2ed2e05
Compare
…e or length changes A move target was picked from slots that avoid the old time, so keeping it after a change could move the other session into a fresh overlap.
In a modal, Radix sets pointer-events: auto inline on tooltip content, so the tooltip swallowed clicks on the days it covered.
995de21 to
2da7972
Compare
2ed2e05 to
473b052
Compare
Description
Fourth of five PRs for the stepped "New session" dialog. Schedule mode: Add New › Coaching session and the empty Upcoming card's "Schedule a coaching session" now open the new dialog. Its steps are Who, When and Repeat, plus Resolve overlap when the chosen time clashes. It replaces the old "Create New Coaching Session" form. Stacked on #524.
Changes
newSessionDialogStorewith its host mounted once inProviders. The dialog can open from any page, and every open starts fresh. AuseNewSessionDialoghook drives the presentational step components, built on New session dialog step controls #523's controls and StepDialog, the shared stepped modal #524'sStepDialog.lib/schedule-draft.ts. Suggested times now count a coach's start time only once it's been used twice.coaching-session-form.tsx(the coachee Select and the recurrence section). It's update-only now, for Reschedule until the next PR.sessionCreatedMessageandseriesCreatedMessage.docs/test-plans/new_session_dialog_manual_testing.md.Screenshots / Videos Showing UI Changes (if applicable)
Useful: each step on desktop (Who, When with an overlap, Repeat Weekly, Resolve overlap), and When at 375px.
Testing Strategy
tscand lint are clean.docs/test-plans/new_session_dialog_manual_testing.md.Concerns
multi-org-live.spec.tswasn't run, since it needs a freshly seeded database. Its changed steps were replayed by hand.