From 647519967076a24a7b543b7cc3a0f1f706687679 Mon Sep 17 00:00:00 2001 From: fabi Date: Wed, 12 Aug 2026 21:40:29 +0200 Subject: [PATCH] fix(feed): stop raising the stale pill on a list view that is not filtered MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The merge gate tested the raw chip state (`selectedHashtag || activeFilters .length`), but `filterParams()` — which decides what the server actually returns — ignores `activeFilters` entirely in list view. `switchView('list')` deliberately keeps a chip on `activeFilters` (an uploader chip, or a second tag) while setting `selectedHashtag` to the first TAG filter, which is null when the only chip was an uploader. So a guest who filtered the grid by an uploader and then switched to list view had a genuinely unfiltered view whose every delta raised "Neue Beiträge" instead of merging the rows in — the same pill-for-rows-that-should-have-merged this block was written to stop, one branch further in. Nothing was lost (the pill always clears) but it trains guests to ignore the one control that means something. Now gated on the effective filter, which is exact by construction: it asks the same function the fetch does. --- frontend/src/routes/feed/+page.svelte | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/feed/+page.svelte b/frontend/src/routes/feed/+page.svelte index 753fccf..eb9fea9 100644 --- a/frontend/src/routes/feed/+page.svelte +++ b/frontend/src/routes/feed/+page.svelte @@ -450,7 +450,17 @@ const seen = new Set(uploads.map((u) => u.id)); const fresh = delta.uploads.filter((u) => !seen.has(u.id)); if (fresh.length) { - if (selectedHashtag || activeFilters.length) { + // Test the EFFECTIVE filter, not the raw chip state. `filterParams()` + // is what actually decides which rows the server returns, and in list + // view it reads `selectedHashtag` alone — `activeFilters` is ignored. + // `switchView('list')` deliberately keeps a chip there (an uploader + // chip, or a second tag) while setting `selectedHashtag` to the first + // TAG filter, which is null when the only chip was an uploader. So + // `activeFilters.length` was truthy on a list view that is genuinely + // unfiltered, and every delta raised the pill instead of merging — + // the same "a pill for rows that should have merged" this block was + // written to stop, one branch further in. + if (filterParams().toString() !== '') { // Still cannot MERGE under a filter — `/feed/delta` takes no // filter params and its rows carry no hashtags, so we cannot // tell which belong in this view. Flagging stale is right;