Each habit limit gets an inner level (yellow) and an outer level (red); existing limits become the inner ones. Plan in werkjournal.werkbaum #habit-limit-levels, scenarios WJ-067 to WJ-072. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: #7 Co-authored-by: claude-code <claude-code@javagil.de>
2.2 KiB
Two levels of habit limits
Each of the four habit limits gets an inner and an outer level. Crossing the inner level asks for attention in yellow; only crossing the outer level is severe and red. For a minimum the outer level lies lower, for a maximum higher; set values satisfy outer minimum ≤ minimum ≤ maximum ≤ outer maximum. Each level is optional and alone shows its own colour. Limits stay advisory: counting is never confirmed or blocked.
Limits set before this change become the inner levels, so their warnings turn from red to yellow until an outer level is set.
The edit dialog shows the eight values as a small table: rows day and week, columns min red, min yellow, max yellow, max red.
The export carries dailyMinOuter, dailyMaxOuter, weeklyMinOuter and weeklyMaxOuter beside the inner limits;
the schema version stays 1, and a file without them still imports.
Scenarios: WJ-067 to WJ-072 in gherkin/habit-tests.feature.
HabitBounds computes the level of a count per period; the views mark a missed inner level with habit-warning (amber)
and a missed outer one additionally with habit-severe (clay), so the selectors of the tests that look for habit-warning keep working.
This applies to the counter, the tile status, the calendar days, the week totals and the legend.
The calendar no longer marks a day above the maximum in amber by itself; the level decides the colour.
The changeset habit-limit-levels adds the four nullable outer columns with their order checks;
it is checked against a populated predecessor database (WJ-070).
Validation: the level and order rules and their rejection without a change in HabitServiceTest,
order and negative outer limits with their position in ImportServiceTest,
WJ-067 to WJ-071 against the services and the Flow components,
and WJ-072 in the mobile Chromium context, which fills the dialog and checks the computed amber and clay of the count.
WJ-040 now expects the outer limits among the exported fields.
The full local test task with -Pproduction=true passed: 290 tests, 52 skipped by the suite filters, none failed.
The dialog fits a 360 px wide screen.
Verified locally on 2026-10-13 for 0.1.121-SNAPSHOT.