From 4d2282f5465a82129bf071edd5e24b74bc6c7fff Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Sat, 9 May 2026 21:49:06 +0200 Subject: [PATCH] refactor(timetable): extract computeStageRowHeight helper; StageHeaderCell takes :row-height-px prop (B2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pure structural seam — no layout changes yet (B3 wires the page through). apps/app/src/lib/timetable/row-height.ts (NEW): computeStageRowHeight(laneCount, laneHeightPx, lanePadPx) — one-line pure function with the existing math: max(1, laneCount) * (laneHeight + lanePad) + lanePad. Math.max(1, laneCount) keeps an empty stage row visible at single-lane height instead of collapsing. apps/app/src/components/timetable/StageRow.vue: Switches its inline rowHeightPx computation to call the helper. Behavior identical (the math was the helper's body). apps/app/src/components/timetable/StageHeaderCell.vue: New optional `rowHeightPx?: number` prop. When provided (B3 will pass it from the page via the same helper), the header root applies blockSize inline so the sticky-left column aligns pixel-for-pixel with the row. When omitted, the legacy `block-size: 100%` CSS still applies — every existing call-site keeps working. apps/app/src/lib/timetable/index.ts: re-export the new helper. Tests still green (389 across 54 files); typecheck clean. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../components/timetable/StageHeaderCell.vue | 17 ++++++++++++++++- apps/app/src/components/timetable/StageRow.vue | 3 ++- apps/app/src/lib/timetable/index.ts | 1 + apps/app/src/lib/timetable/row-height.ts | 18 ++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 apps/app/src/lib/timetable/row-height.ts diff --git a/apps/app/src/components/timetable/StageHeaderCell.vue b/apps/app/src/components/timetable/StageHeaderCell.vue index 1b9f45a8..7828578f 100644 --- a/apps/app/src/components/timetable/StageHeaderCell.vue +++ b/apps/app/src/components/timetable/StageHeaderCell.vue @@ -1,22 +1,37 @@