From 17c4518944d9a1b86522b29b48a4cb23a8cbc20a Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Tue, 12 May 2026 16:47:13 -0400 Subject: [PATCH] =?UTF-8?q?my=5Fbuds:=20dismiss=20"No=20buds=20yet"=20empt?= =?UTF-8?q?y-state=20row=20async=20on=20first-bud=20add=20=E2=80=94=20=5Fa?= =?UTF-8?q?ppendBudEntry=20queried=20`.bud-entry--empty`=20but=20=5Fapplet?= =?UTF-8?q?-list-shell=20renders=20it=20w.=20the=20family-agnostic=20`.app?= =?UTF-8?q?let-list-entry--empty`=20class;=20the=20selector=20never=20matc?= =?UTF-8?q?hed,=20so=20first-bud=20appends=20landed=20alongside=20the=20em?= =?UTF-8?q?pty=20row=20instead=20of=20replacing=20it;=20existing=20test=5F?= =?UTF-8?q?add=5Fbud=5Fvia=5Fbud=5Fbtn=5Fappends=5Fentry=20extended=20to?= =?UTF-8?q?=20also=20assert=20the=20empty=20row=20dismisses=20post-add=20(?= =?UTF-8?q?caught=20the=20bug=20=E2=80=94=20TDD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code architected by Disco DeDisco Git commit message Co-Authored-By: Claude Opus 4.7 (1M context) --- src/functional_tests/test_my_buds.py | 6 ++++++ src/templates/apps/billboard/_partials/_bud_add_panel.html | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/functional_tests/test_my_buds.py b/src/functional_tests/test_my_buds.py index 06978e1..759c202 100644 --- a/src/functional_tests/test_my_buds.py +++ b/src/functional_tests/test_my_buds.py @@ -55,6 +55,12 @@ class MyBudsPageTest(FunctionalTest): self.wait_for(lambda: self.assertIn( self.alice, list(self.gamer.buds.all()) )) + # "No buds yet" empty-state row dismisses async as the first bud lands + # (shell partial renders w. .applet-list-entry--empty, not .bud-entry--empty) + self.wait_for(lambda: self.assertEqual( + self.browser.find_elements(By.CSS_SELECTOR, ".applet-list-entry--empty"), + [], + )) def test_no_autocomplete_suggestions_on_my_buds_page(self): """The bud-autocomplete pool is request.user.buds — surfacing buds diff --git a/src/templates/apps/billboard/_partials/_bud_add_panel.html b/src/templates/apps/billboard/_partials/_bud_add_panel.html index cb4aade..2abbd68 100644 --- a/src/templates/apps/billboard/_partials/_bud_add_panel.html +++ b/src/templates/apps/billboard/_partials/_bud_add_panel.html @@ -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');