Repository navigation
Feature/coordinator availability UI - #153
Merged
Merged
Conversation
…h overrides and previews
RenaudBernier
approved these changes
Sep 26, 2026
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.
Closes #130
Summary
Adds an Availability page where coordinators set when they're available for private lessons: weekly hours, time zone, date overrides and a preview
of the next few weeks. UI only. It builds on the backend from #119 / #124, plus one new read action.
Changes
Page & navigation
/availabilitypage (app/(authenticated)/availability), using the same Suspense + async content pattern aschildren/page.tsx./.Editor (
components/availability/)Takes a
coordinatorIdprop, so the admin issue ("Admin — edit any coordinator's availabilities") can reuse it.window itself, and Save is disabled. Any error from the server is shown in the card footer.
overrides, including days off, with edit and remove.
Each window shows a hint like "3 × 60-min slots · last 30 min not bookable", based on the coordinator's active private lessons.
Backend
listCoordinatorAvailabilityOverrides({ coordinatorId, from }), which returns upcoming overrides including days off (windows: []).It uses the same permission checks as the other availability actions.
app/private-lessons/schema.tsintolib/availability.ts(toMinutes,windowsConflict), so the server and the UIapply the same rule.
lib/availability-editor.tsholds the page's pure helpers: time formatting, slot splitting, per-window validation, time zone labels and building thepreview grid.
Tests
__tests__/coordinator-availability-actions.test.ts: 5 new tests forlistCoordinatorAvailabilityOverrides(returns days off, admin access, blocksregular users and other coordinators, rejects invalid dates).
__tests__/availability-editor.test.ts: tests for formatting, slot splitting, validation (including every-other-week windows that overlap only onalternate weeks), date and time zone helpers, and the preview grid.
registrations-view.test.tsxfails the same way ondevelop; that's unrelated to this PR.