fix(layout): cap visible toasts at 5 to bound the toast-root column #121

Merged
YousifShkara merged 1 commit from fix/cap-toast-stack-at-5 into main 2026-06-12 04:53:51 +02:00
Owner

Closes BUNYIP-98.

window.bunyipToast appended every pill into #bunyip-toast-root with no cap on visible children. Each pill auto-dismissed after 2.5s, but a tight loop (the canonical case: spamming "Copy" on /downloads) piled them up indefinitely - 50 quick clicks could fill the viewport vertically.

Cap-and-evict, single while loop in front of the append:

while (root.children.length >= 5) {
root.removeChild(root.firstChild);
}

5 is the visible-pill target. The oldest is evicted so the newest action always lands, which is the signal users most want feedback for. The existing auto-dismiss setTimeout chain is untouched and already guards on pill.parentNode, so a manually evicted pill does not double-remove.

No new state, no queue, no dedup. The previous "spam-fills-screen" attempts at dedup-by-message are deferred until someone reports a case the cap alone does not address.

just check-container clean (modulo the pre-existing test_config_defaults parallel-env-var flake on main; 188 other tests pass; fmt + clippy + build clean).

#BUNYIP-98

Closes BUNYIP-98. `window.bunyipToast` appended every pill into `#bunyip-toast-root` with no cap on visible children. Each pill auto-dismissed after 2.5s, but a tight loop (the canonical case: spamming "Copy" on `/downloads`) piled them up indefinitely - 50 quick clicks could fill the viewport vertically. Cap-and-evict, single while loop in front of the append: while (root.children.length >= 5) { root.removeChild(root.firstChild); } 5 is the visible-pill target. The oldest is evicted so the newest action always lands, which is the signal users most want feedback for. The existing auto-dismiss `setTimeout` chain is untouched and already guards on `pill.parentNode`, so a manually evicted pill does not double-remove. No new state, no queue, no dedup. The previous "spam-fills-screen" attempts at dedup-by-message are deferred until someone reports a case the cap alone does not address. `just check-container` clean (modulo the pre-existing `test_config_defaults` parallel-env-var flake on main; 188 other tests pass; fmt + clippy + build clean). #BUNYIP-98
fix(layout): cap visible toasts at 5 to bound the toast-root column
All checks were successful
Check / fmt / clippy / build / test (pull_request) Successful in 59s
Create release / Create release from merged PR (pull_request) Has been skipped
8ff1b791bf
Closes BUNYIP-98.

`window.bunyipToast` appended every pill into `#bunyip-toast-root` with no cap on visible children. Each pill auto-dismissed after 2.5s, but a tight loop (the canonical case: spamming "Copy" on `/downloads`) piled them up indefinitely - 50 quick clicks could fill the viewport vertically.

Cap-and-evict, single while loop in front of the append:

  while (root.children.length >= 5) {
      root.removeChild(root.firstChild);
  }

5 is the visible-pill target. The oldest is evicted so the newest action always lands, which is the signal users most want feedback for. The existing auto-dismiss `setTimeout` chain is untouched and already guards on `pill.parentNode`, so a manually evicted pill does not double-remove.

No new state, no queue, no dedup. The previous "spam-fills-screen" attempts at dedup-by-message are deferred until someone reports a case the cap alone does not address.

`just check-container` clean (modulo the pre-existing `test_config_defaults` parallel-env-var flake on main; 188 other tests pass; fmt + clippy + build clean).

#BUNYIP-98
YousifShkara deleted branch fix/cap-toast-stack-at-5 2026-06-12 04:53:51 +02: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
psa-systems/bunyip!121
No description provided.