Repository navigation
Commit e081ffb
authored
fix(ui): report the reset success with a toast level the sheet declares (#290)
The forgot-password success branch called
toast(T("forgot.done"), "ok");
reusing the API response's own status literal (`if (r.status === "ok")`, same
branch) as a toast *level*. `toast()` concatenates `type` into the element's
class with no validation:
el.className = "toast" + (type ? " " + type : ""); // ui/js/app.js:38
and `ui/css/style.css` declares `.toast.success` / `.toast.error` /
`.toast.info` only — `.toast.ok` exists solely in the design prototype
(`docs/prototype/aitokenpool-console.html`, whose own calls use `ok`/`warn`).
So the app's only password-reset success message silently fell back to the
base `.toast` style. `#40` introduced the product vocabulary and migrated the
call sites; `8ac018b` (forgot/reset password, three days later) wrote one new
call site back in the prototype's words.
Fix: use `"success"`, the word the running app already uses for a genuine
success on the same auth card, and say why the argument is a level.
The new static gate `state_gate::every_toast_level_is_a_level_the_sheet_declares`
pins the shape with three derived rules (no hand-written rosters):
1. every literal level at a `toast(...)` call site is in the sheet's
`.toast.<x>` rule set minus the state classes the function body applies
itself via `classList.add`;
2. that vocabulary equals, both ways, the contract line in `ui/README.md`;
3. conversely, every graded rule has a call site (no dead level).
`the_r92_rules_have_teeth` and `the_r92_rules_separate_the_variants` prove each
rule has its own tooth and declare each leg's verdict; the competitive fix
("leave the call site, add a `.toast.ok` rule") is rejected by rule 2, and the
jsdom probe rejects it too.1 parent 9fd93ee commit e081ffb
4 files changed
Lines changed: 860 additions & 2 deletions
0 commit comments