Space storage notifications for admins; admin Spaces shows limits; amber follows warn % (#801) #818

Merged
Cordy merged 2 commits from feat-801 into main 2026-09-28 18:38:06 +00:00
Owner

Closes #801; implements mockup-801-space-notifications.html and mockup-801b-admin-spaces-usage.html with the decisions in the #801 comments.

Server

  • New internal/spacealerts: per space ID {level, at}, statestore-persisted. Observe keeps the crossing time while the level holds; "" clears; Prune drops uncapped or removed spaces.
  • SpacesAPI.SpaceAlerts: for every capped space, from live usage: full when used ≥ limit; warn when used ≥ the "Warn people at" % (none when 0).
  • NotifyAPI.derive (admins only): space-full / space-warn items (file, used, limit, at = crossing time); prefKey → space-storage, added to notifPrefKinds. No horizon cut, since it's current state. The existing 45 s per-user cache applies.
  • main.go: opens spacealerts.json and wires Alerts, WarnPercent (settings) and Notify.SpaceAlerts.

Web

  • Bell: " is almost full" / " is full", with meta "X of Y (93%)" / "X of Y · uploads refused". Amber and red icons (data-k quota / quotafull). A click sets spcFocus and opens Admin › Spaces.
  • Icon fix: #bellmenu .bico svg{color:inherit}. A general .menu svg rule was painting every bell icon grey.
  • Preferences: "Space storage" row, admin-only, on by default.
  • Warn row copy gains the admin-notification clause (4 languages).
  • Admin › Spaces:
    • column "Storage used" (spcSize, also the details-panel label) at 140px, right-aligned;
    • capped rows use spqMeter with live quotaUsed;
    • the spcFocus row is scrolled into view and highlighted for 4 s.
  • spqLevel: amber from the warn % (90 % when empty).
  • Deliberate pin updates: qa803 (the amber rule) and qa815 (the pin narrowed to its own sentence, which #801 extends).

Docs: spaces-quota.md gains "Notifications for administrators".

Tests: RED 50c49fe8 → green. go test ./... passes (alert store, levels at 80 % / 0 %, admin-only feed items + mute key). Web 309/309; node --check passes.

Closes #801; implements `mockup-801-space-notifications.html` and `mockup-801b-admin-spaces-usage.html` with the decisions in the #801 comments. **Server** - New `internal/spacealerts`: per space ID `{level, at}`, statestore-persisted. `Observe` keeps the crossing time while the level holds; `""` clears; `Prune` drops uncapped or removed spaces. - `SpacesAPI.SpaceAlerts`: for every capped space, from live usage: **full** when used ≥ limit; **warn** when used ≥ the "Warn people at" % (none when 0). - `NotifyAPI.derive` (admins only): `space-full` / `space-warn` items (`file`, `used`, `limit`, `at` = crossing time); `prefKey` → `space-storage`, added to `notifPrefKinds`. No horizon cut, since it's current state. The existing 45 s per-user cache applies. - `main.go`: opens `spacealerts.json` and wires `Alerts`, `WarnPercent` (settings) and `Notify.SpaceAlerts`. **Web** - **Bell:** "<space> is almost full" / "<space> is full", with meta "X of Y (93%)" / "X of Y · uploads refused". Amber and red icons (`data-k` quota / quotafull). A click sets `spcFocus` and opens Admin › Spaces. - **Icon fix:** `#bellmenu .bico svg{color:inherit}`. A general `.menu svg` rule was painting every bell icon grey. - **Preferences:** "Space storage" row, admin-only, on by default. - **Warn row copy** gains the admin-notification clause (4 languages). - **Admin › Spaces:** - column "Storage used" (`spcSize`, also the details-panel label) at 140px, right-aligned; - capped rows use `spqMeter` with live `quotaUsed`; - the `spcFocus` row is scrolled into view and highlighted for 4 s. - **`spqLevel`:** amber from the warn % (90 % when empty). - **Deliberate pin updates:** qa803 (the amber rule) and qa815 (the pin narrowed to its own sentence, which #801 extends). **Docs:** `spaces-quota.md` gains "Notifications for administrators". **Tests:** RED 50c49fe8 → green. `go test ./...` passes (alert store, levels at 80 % / 0 %, admin-only feed items + mute key). Web 309/309; `node --check` passes.
Cordy merged commit 7d504d7e95 into main 2026-09-28 18:38:06 +00:00
Cordy deleted branch feat-801 2026-09-28 18:38:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#818
No description provided.