Repository navigation
Commit 6936973
authored
fix(ui): re-list outcome must come from the same entry as the action (#265)
A sharing key has three reachable statuses (`on` / `paused` / `off`): PATCH
/api/sharings/:id accepts all three, and GET /api/sharings applies no status
filter, so a soft-deleted row stays in the list. The row button labels the
transition from the CURRENT status (Pause / Resume / Re-list), while the
outcome toast picked it from the NEXT status with a two-valued ternary
(`s.status === "on" ? "paused" : "on"`) -- so `off -> on` (re-list) was
reported as a resume: button "Re-list", toast "Resumed sharing of ...".
The key naming that branch, `share.toggle.relisted`, is present in both
language packs and unreachable -- an unreachable key is the fingerprint of a
lost branch. Provenance is drift, not a trade-off: 68f9f70 (#86) introduced
the three-way button, 89963f3 (#94) replaced the mock's three-branch toggle
with the two-branch ternary.
- add `SHARE_TOGGLE` (status -> { label, next, outcome }): the button's action,
its next status and its outcome text now come from the SAME entry, read by
both consumers through `shareToggle(s.status)`.
- new static gate
`state_gate::the_sharing_toggle_outcome_comes_from_the_same_entry_as_its_action`:
share.toggle.* literals may only live inside the table; the table's key set
must equal `SHARE_STATUS`'s (both derived from source); the label/outcome
columns must be unique per entry; and the handler (derived as the endpoint
that sends a NON-literal status to /api/sharings/) must not name a
share.toggle.* key nor branch on a status literal, and must share exactly one
accessor with the button markup. Extractor self-proofs use synthetic inputs.
- i18n positive controls recalibrated from what the gate reported:
T() literals 542 -> 537, distinct 433 -> 428 (five literal call sites became
table entries).
- ui/README.md: rule + measured scope; index.html cache-bust for app.js.1 parent ba486b2 commit 6936973
5 files changed
Lines changed: 661 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
| 101 | + | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments