Default lessons to a week view on the booking page and in wp-admin #80

Merged
thatguygriff merged 1 commits from fix/week-view-default into main 2026-07-22 13:19:47 +00:00
Owner

Closes #76

What & why

From the user demo: lessons should default to a week view on both the front end and in wp-admin.

  • Front end (assets/js/booking.js) — the booking calendar now opens in the Week view, anchored to the week of the earliest open slot so the first look is never empty. The List view stays available via the existing toggle.
  • wp-adminScheduler and My Lessons were flat tables only. They now open in a Week calendar (same usc_view/usc_week pattern and markup as the availability page) showing each lesson's start time, student, and status per day, with previous/next-week navigation. The original table remains as the List view since it carries the per-lesson HST and e-transfer edit forms.
  • Added a generic WeekCalendar::bucket() (template-typed) so lesson display rows reuse the same seven-day bucketing as availability slots.

Tests

  • New LessonControllerTest cases: week is the default, lessons bucket into the right day, usc_week navigation is honoured, out-of-week lessons are hidden, and the list view still renders on usc_view=list.
  • New WeekCalendarTest::testBucketGroupsItemsByExtractedDay.
  • composer test — 369 tests pass; composer lint (PHPStan level 10) and composer cs clean.

Docs updated: docs/features/lesson-booking.md.

🤖 Generated with Claude Code

Closes #76 ## What & why From the user demo: lessons should default to a **week view** on both the front end and in wp-admin. - **Front end** (`assets/js/booking.js`) — the booking calendar now opens in the Week view, anchored to the week of the earliest open slot so the first look is never empty. The List view stays available via the existing toggle. - **wp-admin** — **Scheduler** and **My Lessons** were flat tables only. They now open in a Week calendar (same `usc_view`/`usc_week` pattern and markup as the availability page) showing each lesson's start time, student, and status per day, with previous/next-week navigation. The original table remains as the **List** view since it carries the per-lesson HST and e-transfer edit forms. - Added a generic `WeekCalendar::bucket()` (template-typed) so lesson display rows reuse the same seven-day bucketing as availability slots. ## Tests - New `LessonControllerTest` cases: week is the default, lessons bucket into the right day, `usc_week` navigation is honoured, out-of-week lessons are hidden, and the list view still renders on `usc_view=list`. - New `WeekCalendarTest::testBucketGroupsItemsByExtractedDay`. - `composer test` — 369 tests pass; `composer lint` (PHPStan level 10) and `composer cs` clean. Docs updated: `docs/features/lesson-booking.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thatguygriff added 1 commit 2026-07-22 13:14:00 +00:00
Default lessons to a week view on the booking page and in wp-admin
CI / Tests (PHP 8.2) (pull_request) Successful in 1m15s
CI / Tests (PHP 8.1) (pull_request) Successful in 1m16s
CI / No Debug Code (pull_request) Successful in 2s
CI / Coding Standards (pull_request) Successful in 3m15s
CI / PHPStan (pull_request) Successful in 3m14s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m37s
CI / Build Plugin Zip (pull_request) Skipped
14f43232c9
The front-end booking calendar now opens in the Week view (anchored to the
week of the earliest open slot) with List still available. The Scheduler and
My Lessons admin pages gain a week calendar (usc_view/usc_week, bucketed via
a new generic WeekCalendar::bucket()) and open in it by default; the original
table remains as the List view since it carries the HST / e-transfer forms.

Closes #76

Co-Authored-By: Claude Fable 5 <[email protected]>
thatguygriff merged commit 972c0624c1 into main 2026-07-22 13:19:47 +00:00
thatguygriff deleted branch fix/week-view-default 2026-07-22 13:19:47 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#80