From a3fb42359667b067e523dbfffd3caebf54c20507 Mon Sep 17 00:00:00 2001 From: Oier Bravo Urtasun Date: Mon, 18 May 2026 11:40:22 +0200 Subject: [PATCH] feat(fase-15): exclude-on-list wiring + CI-02 e2e (15.4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /lists/[id]/+page.svelte now passes the current item names through to fetchSuggestions as excludeNames, both on initial cold-load and on every debounced keystroke. The exclude list is a `$derived` of `items` so it recomputes the moment an optimistic insert lands — the next keystroke no longer surfaces the freshly-added item. ItemSuggestions.svelte gets a stable data-testid handle on the strip plus per-chip testids so the suite can assert presence/absence without fragile text matches. The component still hides itself entirely when the post-filter suggestion list is empty (the dropdown was already gated on `suggestions.length > 0`). Playwright CI-02 lives on a freshly-created list (the seed list is shared with the entire suite and tends to accumulate hundreds of test items, which both buries the assertion target and inflates the excludeNames URL). Boosts two synthetic names heavily so they lead the dropdown regardless of pollution in item_frequency, verifies "added" → "next fetch excludes it", and tears its own rows down via the admin purge RPC (direct table deletes are blocked by the deny-all RLS from migration 006). Co-Authored-By: Claude Opus 4.7 --- .../src/lib/components/ItemSuggestions.svelte | 2 + .../src/routes/(app)/lists/[id]/+page.svelte | 21 ++- apps/web/tests/e2e/common-items.test.ts | 169 ++++++++++++++++-- 3 files changed, 171 insertions(+), 21 deletions(-) diff --git a/apps/web/src/lib/components/ItemSuggestions.svelte b/apps/web/src/lib/components/ItemSuggestions.svelte index e9ee2f6..cf24383 100644 --- a/apps/web/src/lib/components/ItemSuggestions.svelte +++ b/apps/web/src/lib/components/ItemSuggestions.svelte @@ -17,11 +17,13 @@ Desktop (md+): wraps to two lines as before. -->
{#each suggestions as item (item.name)}