Skip to content

feat(timetable): compare two or three scenarios side by side before publishing one - #797

Merged
rubenvdlinde merged 10 commits into
developmentfrom
feat/timetable-generator-compare
Sep 30, 2026
Merged

rubenvdlinde merged 10 commits into
developmentfrom
feat/timetable-generator-compare

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Timetable generator, section 7: compare scenarios side by side

Base: development (19711e0). Sits on #796 (section 6, imported scenarios), which sits on #795, #794, #793 and #791. Merge in that order, or merge this PR with a merge commit to land all six.

Change: timetabling-generator (DECISIONS rows 17 and 21), section 7 of 9 (task 7.1). The change stays open. Row moved to built: tt-scenario-compare.

What the user can now do

On Timetable, Scenarios, a timetabler picks two or three finished scenarios, generated or taken from the current timetable, and reads them side by side: lessons placed and without a place, clashes, hard and soft wishes broken, the weighted soft penalty, free periods between lessons (all teachers and the worst teacher), the most lessons of one group on a day, and room use. The best value per line is marked (bold, and "Best" for screen readers); a line where every value is equal, or room use, marks nothing. Below it, the lessons whose period or room differs, with "Not placed" where a scenario has no place for a lesson.

How

  • src/components/TimetableScenarioCompare.vue in the below-header slot of the declarative TimetableScenarios index page (manifest slots), so no new custom page and the gate-69 ratchet holds. It reads scenarios with status done or published from OpenRegister; the numbers are the metrics the scorer stored on each (design decision 5), so generated and imported scenarios are read the same way.
  • src/utils/scenarioCompare.js: compareRows, bestPositions, lessonDiff.
  • 19 new strings in all 36 locales.

Tests

  • tests/vitest/scenarioCompare.spec.js (6): best value per line (scenario "Compare a generated and an imported scenario"), nothing marked when equal or without a direction, a missing value kept as null and never marked, ties share the mark, the lesson diff with a missing lesson as null, empty for equal scenarios.
  • tests/e2e/timetable-generator.spec.ts: "compare a generated and an imported scenario" (nightly Playwright; not runnable from the lane clone).

Red first: the vitest file failed with the module missing (lane log lane17/red-s7.log).

Verification

At head 3d871ed (development 19711e0 + #791 + #793 + #794 + #795 + #796 + this section): composer check:strict 0 (PHPUnit 530, 7 skipped); npm lint, stylelint, check:l10n, check:l10n-js, check:schema-l10n, check:manifest, vitest (422 tests) and build all 0; parity_verify --strict 0 (only the unknown-cells census). CI-shaped Hydra gates (hydra-gates@main, full coverage, this body): ALL 82 applicable gates passed.

Live check

  1. As an admin, with a generated scenario that is done (section 5) and an imported one that is done (section 6) for the same week: Timetable, Scenarios, choose both in "Scenarios to compare".
  2. "Hard wishes broken" reads 0 and 1 with the 0 in bold; "Lessons that differ" lists the lessons on another period or in another room.
  3. Choose a third: three columns. A fourth cannot be chosen.

Inherited: the non-required Newman, PHPUnit (pgsql) and Quality Report jobs have been red on every PR since #758.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/planninq @ c3664bb

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 107/107
npm ✅ ✅ 646/646
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ❌
Newman ❌
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it on any branch from the Actions tab, or locally with npx playwright test.
Hydra gates ✅

Quality workflow — 2026-09-30 06:56 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
rubenvdlinde merged commit 3d871ed into development Sep 30, 2026
36 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant