mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
The supply tab rendered a container's kind, its unit count and a state badge, and nothing else. A row could read "Expired" with nothing on screen to say which date caused it, and the correction dialog only ever offered the remaining-unit count — so the opening date, which the intake consumption hook writes without the user ever typing it, could not be taken back. Each row now carries the two dates it has, and the correction dialog edits both alongside the unit count. Each field rides along only when it actually changed, so saving a stock correction never rewrites a date left untouched, and clearing the opening date sends null, which the route reads as "this was never opened" rather than "leave it alone". Beside the opening date the helper text says whether the kind carries a 30-day window at all. The headline stops contradicting itself. "0 of 0 doses remaining" next to "+ 54 units expired" read as "nothing was ever recorded" beside "stock was written off"; when the available pool is empty and only expired stock is left, one line says so instead. The low-stock push follows: no usable supply with written-off units on hand is a different errand from an empty pack, and `expiredUnits` now reaches the payload, the notification metadata and the wide event.