Skip to content

feat(timetable): a timetabler keeps hard and soft wishes on the school week grid - #794

Merged
rubenvdlinde merged 4 commits into
developmentfrom
feat/timetable-generator-wishes
Sep 30, 2026
Merged

rubenvdlinde merged 4 commits into
developmentfrom
feat/timetable-generator-wishes

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Timetable generator, section 3: a timetabler keeps the wishes the generator weighs

Base: development (19711e0). Sits on #793 (section 4, the scorer), which sits on #791 (section 2). Merge in that order, or merge this PR with a merge commit to land all three.

Change: timetabling-generator (DECISIONS rows 17 and 21), section 3 of 9 (tasks 3.1, 3.2). The change stays open; tt-hard-soft-wishes moves to built with section 5, when the generator respects the wishes.

What the user can now do

An admin opens Timetable, Wishes and sees every wish with what it applies to, who or what, its kind, hard or soft, and its weight, filtered to teachers, groups, rooms or activities. Add and edit open a dialog: what the wish applies to, who or what, the kind, hard ("the generator always keeps it") or soft with a weight of 1 to 3, a limit for "at most a number of lessons a day", and, for "not on these periods" and "preferably not on these periods", a picker laid out as the school week grid from the timetable_period_grid setting. Delete is the list's own.

How

  • src/manifest.json: page TimetableWishes (/timetable/wishes) is a declarative index page on timetableWish; its form-dialog slot is replaced by src/dialogs/TimetableWishDialog.vue, which saves through the page's own confirm. No new custom page, so the gate-69 ratchet holds. Menu Timetable, Wishes (admins; OpenRegister refuses writes from anyone else anyway). Icon CalendarClock registered.
  • src/utils/timetableWishes.js: period keys (wed-5), the grid setting, picker rows, and the saved object: periods only for the two period kinds, a limit only for maxPerDay, a weight only for a soft wish.
  • Day names come from Nextcloud (getDayNames); 16 new strings in all 36 locales.

Tests

  • tests/vitest/timetableWishes.spec.js (11): period key round trip and the schema's pattern; week order sort; toggling; the grid setting and its fallback; the picker rows; weight only for a soft wish (scenario "A timetabler marks a wish as hard"); periods and limit only where they apply; weight clamped to 1 to 3; the problems that stop a save; a stored wish opens as saved. Every saved object is validated with ajv against the real timetableWish fragment of lib/Settings/planninq_register.json.
  • tests/e2e/timetable-wishes.spec.ts: "a timetabler marks a wish as hard" (runs in the nightly Playwright job; not runnable from the lane clone).

Red first: the vitest file failed before the helper existed (lane log lane16/red-s3.log).

Verification

At head 388850a (development 19711e0 + #791 + #793 + this section): composer check:strict 0 (PHPUnit 510, 7 skipped); npm lint, stylelint, check:l10n, check:l10n-js, check:schema-l10n, check:manifest, vitest (41 files, 408 tests) and build all 0. CI-shaped Hydra gates (hydra-gates@main, full coverage, this body): ALL 82 applicable gates passed, gate-69 custom-page ratchet included.

Live check

  1. As an admin, open Planninq, Timetable, Wishes. Add: applies to Teacher, klaas, Not on these periods, tick Wednesday periods 5 to 8, Hard, Save. The row shows klaas, hard, no weight.
  2. Add a soft wish "Preferably not on these periods" on Friday period 8 with weight 2: the row shows soft and 2.
  3. Switch the filter to Room: neither row shows.
  4. As a user who is not an admin: no Timetable menu; a POST to /apps/openregister/api/objects/planninq/timetableWish is refused.

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 @ 86b4184

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 03:58 UTC

Download the full PDF report from the workflow artifacts.

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