Never drop an enrolled class from upcoming lessons; delete a guardian's children with them; pin the panel's line spacing
CI / Tests (PHP 8.2) (pull_request) Successful in 58s
CI / PHPStan (pull_request) Successful in 2m53s
CI / Coding Standards (pull_request) Successful in 2m58s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m47s
CI / Build Plugin Zip (pull_request) Skipped
CI / Tests (PHP 8.1) (pull_request) Successful in 1m1s
CI / No Debug Code (pull_request) Successful in 3s

Three fixes from testing the branch.

A group class was only listed when its schedule resolved to exact
datetimes, which needs a class time *and* a duration — both optional on
the offering form, and the schedule note exists precisely so a studio can
write "Tuesdays 4:00pm" instead. A class configured that way vanished
from the list, which is the one thing this feature must never do. So
Offering::sessionStarts() splits "when does it meet" from "how long does
it run" (sessionWindows() is that plus the duration, unchanged), and
SessionSchedule degrades instead of disappearing: dated rows with an open
end when there is no duration, and a single row carrying
Offering::scheduleLabel() when there is no time to derive dates from.
Only a class whose last day has passed drops out.

Deleting a guardian now deletes the children linked to them, releasing
each one's lessons and enrolments first. A child account is login-less
and exists only so the guardian has somebody to book for; without the
guardian nobody can reach it, book for it, or be billed for it, so it was
left stranded on the roster still holding slots. A `handled` set makes
the re-entrant delete_user each child deletion fires a no-op, and stops a
circular link recursing.

The upcoming panel never stated its own line-height, so a theme setting
line-height: 0 above it — the usual icon-font reset — was inherited
straight through. Below 1 that produces both reported symptoms at once:
stacked lines overlap, and the status pill's background is shorter than
the text in it. Pinned at the same id-level specificity as the rest.

Tests: composer test (863), composer lint, composer cs all pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
2026-07-30 12:10:43 -03:00
co-authored by Claude Opus 5
parent cb347ffca0
commit c9a1205fc0
14 changed files with 663 additions and 89 deletions
+25 -2
View File
@@ -104,18 +104,41 @@
* explicit flex rules above, but the text itself still sits in inline elements
* a theme is free to take out of normal flow — an absolutely positioned,
* floated or negatively offset span drops the date/time on top of the title and
* the status pill on top of the Cancel button. Pinning the three properties
* that would have to change keeps the leaves in flow, at the same id-level
* the status pill on top of the Cancel button. Pinning the properties that
* would have to change keeps the leaves in flow, at the same id-level
* specificity the rules above rely on.
*
* `line-height` is pinned for the same reason and is the subtler one, because a
* theme does not have to target this panel to break it — it is inherited, so a
* `line-height: 0` anywhere above (the usual icon-font or sprite reset) reaches
* these elements untouched. Below 1 it produces both halves of the same bug: a
* line box shorter than its glyphs, so stacked lines in the details column
* overlap, and an inline-block pill whose background is shorter than the text
* sitting in it. Nothing here should ever inherit a line-height, so the panel
* states its own.
*/
#us-booking-app .us-my-lesson,
#us-booking-app .us-my-lesson-info,
#us-booking-app .us-my-lesson-actions,
#us-booking-app .us-my-lesson-title,
#us-booking-app .us-my-lesson-when,
#us-booking-app .us-my-lesson-duration,
#us-booking-app .us-my-lesson-who,
#us-booking-app .us-my-lesson-kind,
#us-booking-app .us-lesson-status {
line-height: 1.45;
}
#us-booking-app .us-my-lesson-title,
#us-booking-app .us-my-lesson-when,
#us-booking-app .us-my-lesson-duration,
#us-booking-app .us-my-lesson-who,
#us-booking-app .us-my-lesson-kind,
#us-booking-app .us-lesson-status {
position: static;
float: none;
margin: 0;
vertical-align: middle;
}
/*
+16 -1
View File
@@ -613,6 +613,21 @@
return l.kind === 'group_class';
}
// When a row meets. A class with no class time set has no clock to put it on,
// so it carries `schedule` — the studio's own wording, or its term dates — and
// that is shown verbatim in place of a date and time. A dated row with no
// duration knows when it starts but not when it ends, and says only that
// rather than inventing a finish.
function lessonWhenHtml(l) {
if (l.schedule) {
return escHtml(String(l.schedule));
}
const when = `${escHtml(dayLabel(dayKey(l.start_dt)))} · ${escHtml(timeOf(l.start_dt))}`;
return l.end_dt ? `${when}${escHtml(timeOf(l.end_dt))}` : when;
}
function lessonRowHtml(l) {
const group = isGroupSession(l);
const title = l.offering_title ? escHtml(String(l.offering_title)) : (group ? 'Group class' : 'Lesson');
@@ -626,7 +641,7 @@
<div class="us-my-lesson">
<div class="us-my-lesson-info">
<strong class="us-my-lesson-title">${title}${duration}${badge}${lessonWhoHtml(l)}</strong>
<span class="us-my-lesson-when">${escHtml(dayLabel(dayKey(l.start_dt)))} · ${escHtml(timeOf(l.start_dt))}${escHtml(timeOf(l.end_dt))}</span>
<span class="us-my-lesson-when">${lessonWhenHtml(l)}</span>
</div>
<div class="us-my-lesson-actions">
<span class="us-lesson-status us-lesson-status-${escHtml(String(l.status))}">${escHtml(lessonStatusLabel(String(l.status)))}</span>