From 1ac380dfc5c043e6b9a0731832c6a249c8b734e6 Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Fri, 29 May 2026 12:56:03 -0400 Subject: [PATCH] =?UTF-8?q?my-buds=20async=20add:=20insert=20new=20row=20b?= =?UTF-8?q?efore=20.applet-list-buffer,=20not=20after=20=E2=80=94=20keeps?= =?UTF-8?q?=20spacer=20last?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `_appendBudEntry` queried `.bud-entry-buffer` (a class that doesn't exist — the shell renders `.applet-list-buffer`), so the lookup missed and the row fell through to appendChild, landing BELOW the trailing spacer
  • and leaving a visible gap between the list and the new bud. Query the real class so the new row inserts before the spacer. FT now asserts the buffer stays last-child. Code architected by Disco DeDisco Git commit message Co-Authored-By: Claude Opus 4.8 (1M context) --- src/functional_tests/test_bill_my_buds.py | 7 +++++++ src/templates/apps/billboard/_partials/_bud_add_panel.html | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/functional_tests/test_bill_my_buds.py b/src/functional_tests/test_bill_my_buds.py index feadc33..c2baab4 100644 --- a/src/functional_tests/test_bill_my_buds.py +++ b/src/functional_tests/test_bill_my_buds.py @@ -79,6 +79,13 @@ class MyBudsPageTest(FunctionalTest): sel = f".bud-entry[data-bud-id='{self.alice.id}']" row = self.wait_for(lambda: self.browser.find_element(By.CSS_SELECTOR, sel)) + # The trailing `.applet-list-buffer` spacer must stay LAST — the new + # row goes BEFORE it, not after (regression: querying the wrong buffer + # class dropped the row below the spacer). + last = self.browser.find_element( + By.CSS_SELECTOR, "#id_buds_list > li:last-child" + ) + self.assertIn("applet-list-buffer", (last.get_attribute("class") or "").split()) # Carries both classes (styling + tooltip-lock both key on these). cls = (row.get_attribute("class") or "").split() self.assertIn("applet-list-entry", cls) diff --git a/src/templates/apps/billboard/_partials/_bud_add_panel.html b/src/templates/apps/billboard/_partials/_bud_add_panel.html index 6bf8888..668768e 100644 --- a/src/templates/apps/billboard/_partials/_bud_add_panel.html +++ b/src/templates/apps/billboard/_partials/_bud_add_panel.html @@ -54,7 +54,11 @@ rowTitle.textContent = ' the ' + title; li.appendChild(rowTitle); - var buffer = list.querySelector('.bud-entry-buffer'); + // Keep the trailing spacer LAST — _applet-grid-list.html renders it + // as `.applet-list-buffer` (not `.bud-entry-buffer`); querying the + // wrong class fell through to appendChild, dropping the new row + // BELOW the buffer. + var buffer = list.querySelector('.applet-list-buffer'); if (buffer) list.insertBefore(li, buffer); else list.appendChild(li); }