feat(ui): refresh the planner interface #361

Merged
nessar merged 12 commits from feature/planner-ui-refresh into develop 2026-11-14 16:42:38 +01:00
Owner

Summary

UI/UX refresh of the planner, from the audit of 2026-11-13. It reorganises what the page shows first, removes the random first-visit balances, rewrites planning-rule text in plain language, and makes narrow screens usable. No change to the planning engine.

Closes #353, closes #354, closes #355, closes #356, closes #357, closes #358, closes #359, closes #360.

What changes for the person

Before After
Calendar start, 1440x900 about 1050 px, below the fold 491 px, whole first row of months visible
Calendar start, 390 px wide about 2400 px 865 px
Page height at 390 px after a calculation 7188 px 5754 px
First visit plan computed on random balances empty list with an invitation to enter balances
Rules panel template 509 lines, edit form duplicated 103 lines, one form in a dialog
  • #353 Product name "VacOptimizer" in the header, statistics rounded to one decimal, statistics dialog in two columns, calculation date attached to the results heading.
  • #354 The calendar comes right after the plan summary; rule contributions move into a closed "applied rules detail" disclosure.
  • #355 On wide screens the configuration panel stays in view with an internal scroll, and Calculate stays visible.
  • #356 No random initial balances. With no leave balance and no declared non-working day there is nothing to plan: no calculation on load, Calculate disabled, invitation in the results panel. Declared days alone still calculate. Recorded in ADR 0013, which supersedes the random-default part of ADR 0005.
  • #357 Planning rules are described by what the planner does for the person, in fr, en, de and es. The technical composition stays in the calculation details. The repeated generic help is gone from the impact table.
  • #358 New "your time-off periods" disclosure: dates, leave days per leave type, declared days and duration for each period; choosing one brings its month into view.
  • #359 Below 75rem the page shows either the configuration or the plan, with a bar fixed at the bottom holding the switch and Calculate. Declared-day entry keeps its leave-type choices reachable above the bar.
  • #360 Planning rules are added and edited in a dialog with one shared form; rules saved through it are identical to those the in-place editor produced.

Verification

  • bun run typecheck, bun run lint, bun run format:check: clean on this branch after the rebase onto develop.
  • bun run test: 1039 pass, 0 fail.
  • bun run build: succeeds. Two budget warnings, both present before this work: initial bundle 2.57 MB for a 2.50 MB budget (was 65.75 kB over, now 72.86 kB over), and the calendar stylesheet 10.30 kB for an 8 kB budget (was 9.63 kB).
  • Browser checks in Chromium through Playwright on the integrated branch: 1440x900 light and dark, 390x844, first visit; no console error and no horizontal overflow.

Known limits

  • Not checked: Safari and Firefox, a real touch device, a real screen reader, and a native-speaker review of the German and Spanish wording.
  • On narrow screens the indicative wait is no longer displayed; it remains the accessible description of Calculate.
  • With declared-day entry active at 390x844, the bottom bar takes about 30 % of the screen height.
  • Clicking outside the rule dialog closes it without saving, like the settings dialog.
  • Default rule names are unchanged; they are saved user data.
  • A test that this PR does not touch is flaky: DateComparison > announces an explicit comparison failure and retries inside the dialog failed once in eight full-suite runs and passes on its own. Its fix will follow as a separate commit on this branch.

Notes for review

  • The history is linear, one commit per ticket plus the ADR renumbering; the branch was rebased onto the current develop.
  • ADR 0012 was already taken on develop, so the empty-balances decision is ADR 0013.

🤖 Generated with Claude Code

## Summary UI/UX refresh of the planner, from the audit of 2026-11-13. It reorganises what the page shows first, removes the random first-visit balances, rewrites planning-rule text in plain language, and makes narrow screens usable. No change to the planning engine. Closes #353, closes #354, closes #355, closes #356, closes #357, closes #358, closes #359, closes #360. ## What changes for the person | | Before | After | |---|---|---| | Calendar start, 1440x900 | about 1050 px, below the fold | 491 px, whole first row of months visible | | Calendar start, 390 px wide | about 2400 px | 865 px | | Page height at 390 px after a calculation | 7188 px | 5754 px | | First visit | plan computed on random balances | empty list with an invitation to enter balances | | Rules panel template | 509 lines, edit form duplicated | 103 lines, one form in a dialog | - **#353** Product name "VacOptimizer" in the header, statistics rounded to one decimal, statistics dialog in two columns, calculation date attached to the results heading. - **#354** The calendar comes right after the plan summary; rule contributions move into a closed "applied rules detail" disclosure. - **#355** On wide screens the configuration panel stays in view with an internal scroll, and Calculate stays visible. - **#356** No random initial balances. With no leave balance and no declared non-working day there is nothing to plan: no calculation on load, Calculate disabled, invitation in the results panel. Declared days alone still calculate. Recorded in ADR 0013, which supersedes the random-default part of ADR 0005. - **#357** Planning rules are described by what the planner does for the person, in fr, en, de and es. The technical composition stays in the calculation details. The repeated generic help is gone from the impact table. - **#358** New "your time-off periods" disclosure: dates, leave days per leave type, declared days and duration for each period; choosing one brings its month into view. - **#359** Below 75rem the page shows either the configuration or the plan, with a bar fixed at the bottom holding the switch and Calculate. Declared-day entry keeps its leave-type choices reachable above the bar. - **#360** Planning rules are added and edited in a dialog with one shared form; rules saved through it are identical to those the in-place editor produced. ## Verification - `bun run typecheck`, `bun run lint`, `bun run format:check`: clean on this branch after the rebase onto develop. - `bun run test`: 1039 pass, 0 fail. - `bun run build`: succeeds. Two budget warnings, both present before this work: initial bundle 2.57 MB for a 2.50 MB budget (was 65.75 kB over, now 72.86 kB over), and the calendar stylesheet 10.30 kB for an 8 kB budget (was 9.63 kB). - Browser checks in Chromium through Playwright on the integrated branch: 1440x900 light and dark, 390x844, first visit; no console error and no horizontal overflow. ## Known limits - Not checked: Safari and Firefox, a real touch device, a real screen reader, and a native-speaker review of the German and Spanish wording. - On narrow screens the indicative wait is no longer displayed; it remains the accessible description of Calculate. - With declared-day entry active at 390x844, the bottom bar takes about 30 % of the screen height. - Clicking outside the rule dialog closes it without saving, like the settings dialog. - Default rule names are unchanged; they are saved user data. - A test that this PR does not touch is flaky: `DateComparison > announces an explicit comparison failure and retries inside the dialog` failed once in eight full-suite runs and passes on its own. Its fix will follow as a separate commit on this branch. ## Notes for review - The history is linear, one commit per ticket plus the ADR renumbering; the branch was rebased onto the current develop. - ADR 0012 was already taken on develop, so the empty-balances decision is ADR 0013. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nessar added 11 commits 2026-11-14 15:53:41 +01:00
An absent or unreadable saved list now starts empty; no quantity is
generated. With no leave balance and no declared non-working day there
is nothing to plan: no calculation starts on load, Calculate is disabled
with the reason exposed through aria-describedby, and the results panel
shows the planning horizon's calendar with an invitation. Declared days
alone still calculate, so earned-leave chains keep working.

ADR 0012 records the decision and supersedes the random defaults of
ADR 0005. Tests now state their balances explicitly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Show the product name VacOptimizer in the header, round plan statistics to one
decimal in the active locale, lay the statistics tiles out in two columns when
the dialog is wide enough, and attach the calculation date to the results
heading and status instead of a free paragraph.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Move the time-window, if-then and declared time-off period blocks into one
closed "applied rules detail" disclosure next to the placement explanation,
so the legend and the first row of months sit under the summary figures.
Put the status and the calculation date on the heading line.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
At the two-column breakpoint the panel is sticky and scrolls internally, and
the indicative wait with the Calculate button stays pinned at its bottom. The
panel is registered as a CDK scrollable so that dragging a rule still
auto-scrolls it. Single-column layouts are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Optimization rules now read as a goal ("Réduire la plus longue séquence
de travail") built from per-measure phrases, element nouns and condition
qualifiers, so every valid composition gets a sentence. The technical
composition stays in the calculation details and the audit data.

The placement impact table drops the generic help repeated on every
optimization row. If-then and imposed-period summaries use real plurals,
leave-type phrases and the earned-leave wording of CONTEXT.md; the German
templates, which never filled their placeholders, are rewritten.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a third disclosure above the calendar, closed by default, listing every
time-off period that contains a leave placement or a declared non-working day:
its date range in the active locale, the leave days per leave type, the declared
days and its duration in days off. Choosing a period scrolls its first leave or
declared day into view (honouring prefers-reduced-motion) and focuses it.

The three disclosures share one row on a wide screen; their summaries drop the
decorative icon when narrow so that the calendar stays above the fold.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adding or editing a planning rule now opens a Material dialog instead of
swapping the list item for an in-place form. One RuleDialog component serves
both, for every rule kind, so the duplicated add/edit template and the state
that only existed for in-place editing (editing class, cdkDragDisabled, the
hidden add buttons) are gone. The list only displays, enables, reorders and
deletes rules, and no longer changes layout while a rule is edited.

The form markup, validation and saved rule shape are moved unchanged; the
dialog returns the rule and the panel hands it to the rule service. The rule
editor tests now drive the real dialog.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The six supplied optimization compositions now say what the planner does
for the person ("Raccourcir la plus longue période travaillée d'affilée")
instead of naming the measure it moves. A rule matches when its elements,
measure, aggregation, direction and conditions equal a supplied rule; the
deficit threshold stays a placeholder, so a custom threshold keeps the
intent. Other compositions keep their generic sentence, and the
public-holiday-week phrases now explain their points per holiday.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Below 75rem only the chosen view is displayed, and a bar fixed to the
bottom of the viewport offers the configuration / plan switch and
Calculate. The page opens on the plan unless there is nothing to plan.
Calculate in the bar shows the plan and focuses its heading. Declared
non-working days are entered on the plan's calendar with the type and
erase choices in the bar. The skip link now shows the plan, and the
"go to your plan" link in the configuration is removed.

Calculate and the declaration controls become shared components, so
that the panel and the bar use the same markup and rules. The bar's
measured height reserves space at the end of the page and as scroll
padding, so that it never covers content or a focused element. The
two-column layout is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The maintainer could not understand several default rule summaries. Each
default optimization rule now states the action and its benefit, in the
four languages, and the automatic placement of an if-then rule reads
"au meilleur moment autour de ce jour".

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs(adr): renumber the empty leave balances decision to ADR 0013 (#356)
CI / policy (pull_request) Successful in 8s
CI / validate (pull_request) Successful in 38s
CI / build (pull_request) Successful in 38s
CI / benchmark (pull_request) Successful in 1m31s
CI / security (pull_request) Successful in 2m5s
CI / test (pull_request) Successful in 4m26s
CI / images (pull_request) Successful in 1m13s
CI / required (pull_request) Successful in 2s
556fa3fe37
develop already records ADR 0012 for obligation solutions.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
nessar added 1 commit 2026-11-14 16:07:43 +01:00
test(date-comparison): wait for the dialog's initial focus before the retry focus check
CI / policy (pull_request) Successful in 20s
CI / validate (pull_request) Successful in 34s
CI / build (pull_request) Successful in 23s
CI / benchmark (pull_request) Successful in 1m30s
CI / security (pull_request) Successful in 1m0s
CI / test (pull_request) Successful in 2m53s
CI / images (pull_request) Successful in 1m14s
CI / required (pull_request) Successful in 1s
CI / policy (push) Successful in 8s
CI / build (push) Successful in 35s
CI / validate (push) Successful in 42s
CI / benchmark (push) Successful in 1m42s
CI / security (push) Successful in 1m38s
CI / test (push) Successful in 3m25s
CI / images (push) Successful in 1m15s
CI / required (push) Successful in 1s
57521cc28b
The retry test recorded document.activeElement right after clicking Retry
and expected the arriving result not to move focus. MatDialog defaults to
delayFocusTrap, so autoFocus 'first-heading' moves focus to the title only
after the 150 ms opening animation timer and the next render. The test
usually finished just before that timer fired, so it compared body with
body. Under load the timer fired while job(2) was being polled, and the
final detectChanges ran the pending afterNextRender. Focus then moved from
body to #counterfactual-title and the assertion failed, even though the
result had not moved focus.

Wait for the title to receive focus, as the first test does, before taking
the snapshot. The assertion now checks that the result leaves the dialog's
settled focus on the title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

The flaky test listed under Known limits is now fixed on this branch (commit 57521cc, test-only). Cause: the retry test recorded the focused element before the dialog had moved focus to its title, which MatDialog does only after its 150 ms opening animation; under load that focus move landed after the snapshot and the final assertion failed. The test now waits for the title to hold focus before taking the snapshot, and still fails if the arriving result moves focus. Under CPU load the spec file failed 10 runs out of 60 before the change and 0 out of 60 after.

The flaky test listed under Known limits is now fixed on this branch (commit 57521cc, test-only). Cause: the retry test recorded the focused element before the dialog had moved focus to its title, which MatDialog does only after its 150 ms opening animation; under load that focus move landed after the snapshot and the final assertion failed. The test now waits for the title to hold focus before taking the snapshot, and still fails if the arriving result moves focus. Under CPU load the spec file failed 10 runs out of 60 before the change and 0 out of 60 after.
nessar merged commit 57521cc28b into develop 2026-11-14 16:42:38 +01:00
nessar deleted branch feature/planner-ui-refresh 2026-11-14 16:42:39 +01:00
Sign in to join this conversation.