Skip to content

fix(ContentOverview): keep the infinite-scroll list from collapsing on load more - #2006

Open
MrDirkelz wants to merge 1 commit into
mainfrom
fix/content-overview-infinite-scroll
Open

fix(ContentOverview): keep the infinite-scroll list from collapsing on load more#2006
MrDirkelz wants to merge 1 commit into
mainfrom
fix/content-overview-infinite-scroll

Conversation

@MrDirkelz

Copy link
Copy Markdown
Collaborator

Scrolling the CMS overview snapped the reader back to the top on every "load more", flashed a near-empty list, and fired hundreds of POST /query requests.

The CMS syncs a 30-day content window, so most overview rows are API-supplement docs rather than Dexie docs. Growing $limit rebuilt the HybridQuery generation, which emptied both contributions; keepPreviousResult bridged output only until the local read landed, and that read publishes the local-only subset. The list therefore dropped to a handful of rows for the length of the supplement's round trip, collapsing the scroll height (browsers clamp scrollTop) and unmounting most rows. Each ContentDisplayCard ran an unbounded per-parent Content query, which always takes HybridQuery's always-post branch, so every remount re-issued one request per row.

HybridQuery now recognises a rebuild that differs only by a larger $limit and carries the local + remote contributions over, re-deciding the supplement for the widened window. Everything already gathered still satisfies the wider query, so the list only ever gains rows. Gated on keepPreviousResult; any other change to the query stays a normal rebuild.

Row translations move from a query per card to one parentId: {$in} query on the overview, passed down as a prop, collapsing the per-row requests and Dexie subscriptions into a single source.

…n load more

Scrolling the CMS overview snapped the reader back to the top on every "load
more", flashed a near-empty list, and fired hundreds of POST /query requests.

The CMS syncs a 30-day content window, so most overview rows are API-supplement
docs rather than Dexie docs. Growing `$limit` rebuilt the HybridQuery generation,
which emptied both contributions; `keepPreviousResult` bridged `output` only until
the local read landed, and that read publishes the local-only subset. The list
therefore dropped to a handful of rows for the length of the supplement's round
trip, collapsing the scroll height (browsers clamp scrollTop) and unmounting most
rows. Each ContentDisplayCard ran an unbounded per-parent Content query, which
always takes HybridQuery's always-post branch, so every remount re-issued one
request per row.

HybridQuery now recognises a rebuild that differs only by a larger `$limit` and
carries the local + remote contributions over, re-deciding the supplement for the
widened window. Everything already gathered still satisfies the wider query, so
the list only ever gains rows. Gated on `keepPreviousResult`; any other change to
the query stays a normal rebuild.

Row translations move from a query per card to one `parentId: {$in}` query on the
overview, passed down as a prop, collapsing the per-row requests and Dexie
subscriptions into a single source.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@MrDirkelz
MrDirkelz force-pushed the fix/content-overview-infinite-scroll branch from 67c953d to d20930a Compare September 4, 2026 08:15
@MrDirkelz MrDirkelz self-assigned this Sep 4, 2026
@MrDirkelz MrDirkelz linked an issue Sep 4, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CMS: Infinite Scrolling not working correctly

1 participant