fix(feed): stop raising the stale pill on a list view that is not filtered
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user