my_buds: dismiss "No buds yet" empty-state row async on first-bud add — _appendBudEntry queried .bud-entry--empty but _applet-list-shell renders it w. the family-agnostic .applet-list-entry--empty class; the selector never matched, so first-bud appends landed alongside the empty row instead of replacing it; existing test_add_bud_via_bud_btn_appends_entry extended to also assert the empty row dismisses post-add (caught the bug — TDD)

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-12 16:47:13 -04:00
parent be919c7aff
commit 17c4518944
2 changed files with 10 additions and 2 deletions

View File

@@ -35,8 +35,10 @@
// Skip if already in DOM (server-side dedup ensures M2M idempotence;
// this guards a fast double-click that races the post-add refresh).
if (list.querySelector('[data-bud-id="' + bud.id + '"]')) return;
// Drop the empty-state row if present
var empty = list.querySelector('.bud-entry--empty');
// Drop the empty-state row if present — _applet-list-shell renders
// it w. `.applet-list-entry--empty` (NOT `.bud-entry--empty`); the
// shell sets the family-agnostic class.
var empty = list.querySelector('.applet-list-entry--empty');
if (empty) empty.remove();
var li = document.createElement('li');