From 7015ddd534ffe62b95bd184866ef28c7bc140615 Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Tue, 12 May 2026 15:42:41 -0400 Subject: [PATCH] =?UTF-8?q?my=5Fbuds:=20strip=20bud-autocomplete=20binding?= =?UTF-8?q?s=20from=20=5Fbud=5Fadd=5Fpanel.html=20=E2=80=94=20the=20autoco?= =?UTF-8?q?mplete=20pool=20is=20request.user.buds=20(per=20search=5Fbuds?= =?UTF-8?q?=20view),=20so=20on=20the=20page=20where=20you=20ADD=20new=20bu?= =?UTF-8?q?ds=20the=20suggestions=20are=20the=20precise=20set=20you=20can'?= =?UTF-8?q?t=20usefully=20re-add;=20post-share=20+=20gatekeeper-invite=20p?= =?UTF-8?q?anels=20keep=20the=20binding=20(re-sharing=20w.=20an=20existing?= =?UTF-8?q?=20bud=20is=20a=20real=20flow);=20test=5Fautocomplete=5Fsuggest?= =?UTF-8?q?s=5Fbuds=5Fby=5Fusername=5Fprefix=20=E2=86=92=20test=5Fno=5Faut?= =?UTF-8?q?ocomplete=5Fsuggestions=5Fon=5Fmy=5Fbuds=5Fpage=20(asserts=20#i?= =?UTF-8?q?d=5Fbud=5Fsuggestions=20absent=20=E2=80=94=20deterministic,=20n?= =?UTF-8?q?o=20debounce-window=20race);=20dead=20`id=5Fbud=5Fsuggestions`?= =?UTF-8?q?=20click-outside=20guard=20+=20unused=20`{%=20load=20static=20%?= =?UTF-8?q?}`=20dropped=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 | 34 +++++++------------ .../billboard/_partials/_bud_add_panel.html | 21 +++--------- 2 files changed, 16 insertions(+), 39 deletions(-) diff --git a/src/functional_tests/test_my_buds.py b/src/functional_tests/test_my_buds.py index 4068a57..8cf758a 100644 --- a/src/functional_tests/test_my_buds.py +++ b/src/functional_tests/test_my_buds.py @@ -5,7 +5,6 @@ will layer autocomplete (sky-place-style top-3 username suggestions) and implicit auto-add on post-share / gate-invite. """ from selenium.webdriver.common.by import By -from selenium.webdriver.common.keys import Keys from apps.lyric.models import User @@ -57,30 +56,21 @@ class MyBudsPageTest(FunctionalTest): self.alice, list(self.gamer.buds.all()) )) - def test_autocomplete_suggests_buds_by_username_prefix(self): - """Phase 2: typing in #id_recipient pulls top-3 prefix matches from - request.user.buds and renders them as .bud-suggestion-item buttons. - Click → input.value fills with the bud's username (or email if the - user typed an `@` already).""" + def test_no_autocomplete_suggestions_on_my_buds_page(self): + """The bud-autocomplete pool is request.user.buds — surfacing buds + you've already added on the page where you ADD new buds is just + noise. Post-share + gatekeeper-invite panels keep it (re-sharing + with an existing bud is a real flow); the My Buds add-panel drops + the autocomplete bindings entirely. Absence of #id_bud_suggestions + is the deterministic check (no debounce-window races).""" self.gamer.buds.add(self.alice) - bob = User.objects.create(email="bob@test.io", username="bob") - self.gamer.buds.add(bob) - self.browser.get(self.live_server_url + "/billboard/my-buds/") - btn = self.wait_for(lambda: self.browser.find_element(By.ID, "id_bud_btn")) - btn.click() - recipient = self.wait_for(lambda: self.browser.find_element(By.ID, "id_recipient")) - recipient.send_keys("al") + self.wait_for(lambda: self.browser.find_element(By.ID, "id_bud_btn")) - suggestions = self.wait_for(lambda: self.browser.find_element( - By.CSS_SELECTOR, "#id_bud_suggestions .bud-suggestion-item" - )) - self.assertEqual(suggestions.text.strip(), "alice") - - suggestions.click() - self.wait_for(lambda: self.assertEqual( - recipient.get_attribute("value"), "alice" - )) + self.assertEqual( + self.browser.find_elements(By.ID, "id_bud_suggestions"), + [], + ) def test_add_unregistered_email_is_silent_noop(self): self.browser.get(self.live_server_url + "/billboard/my-buds/") diff --git a/src/templates/apps/billboard/_partials/_bud_add_panel.html b/src/templates/apps/billboard/_partials/_bud_add_panel.html index 8f7cf9a..e37ca9f 100644 --- a/src/templates/apps/billboard/_partials/_bud_add_panel.html +++ b/src/templates/apps/billboard/_partials/_bud_add_panel.html @@ -1,4 +1,3 @@ -{% load static %} {# ─────────────────────────────────────────────────────────────────────── #} {# _bud_add_panel.html — bottom-left handshake btn + slide-out add- #} {# bud field. Mirrors _bud_panel.html (post-share) but POSTs to #} @@ -19,18 +18,10 @@ -{# Autocomplete suggestions list — sibling of #id_bud_panel because the #} -{# panel has overflow:hidden for its scaleX slide animation. #} - - - - +{# No autocomplete on this panel — the bud-autocomplete pool is the #} +{# user's existing buds, which is precisely the set you can't usefully #} +{# re-add. Post-share + gatekeeper-invite panels keep the autocomplete #} +{# binding (re-sharing with an existing bud is a real flow). #}