fix(cms): infinite scrolling in UserOverview (and RedirectOverview)#1799
Open
johan-bell wants to merge 1 commit into
Open
fix(cms): infinite scrolling in UserOverview (and RedirectOverview)#1799johan-bell wants to merge 1 commit into
johan-bell wants to merge 1 commit into
Conversation
…jected scroll container `useInfiniteScrollList` grew its window from `useInfiniteScroll` on BasePage's scroll container, obtained via `inject(basePageScrollKey)`. But an overview page *renders* BasePage — it is BasePage's parent, not its descendant — so the inject always resolved to its `ref(null)` fallback and no scroll listener was ever attached. The browse list stayed frozen at the first 20 rows. Search paging was unaffected because it uses an IntersectionObserver on a sentinel element, which needs no ancestor lookup. Apply the same mechanism to the browse window: the composable now owns a sentinel ref that the page binds to a zero-height div after the list. RedirectOverview had the identical latent bug and is fixed by the same change. The old spec hid the defect by mocking `useInfiniteScroll` away and supplying `basePageScrollKey` through `global.provide`, which production never does. The rewritten spec mounts bare, with no provider in the tree. Fixes #1797
MrDirkelz
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1797
The bug
useInfiniteScrollListgrew its visible window by watching BasePage's scroll container, obtained withinject(basePageScrollKey).But an overview page renders
BasePage— it is BasePage's parent, not its descendant.provide/injectonly flows downward, so the inject always resolved to itsref(null)fallback:The browse list therefore stayed frozen at the first 20 rows, forever.
Search paging was never affected: it uses an
IntersectionObserveron a sentinel element, which needs no ancestor lookup. That is exactly why the bug reads as "scrolling works when I search, but not otherwise".The fix
Apply the sentinel mechanism to the browse window too.
useInfiniteScrollListnow owns asentinelref, which the page binds to a zero-height div rendered after the list:No ancestor lookup, so it works from either side of the slot boundary.
Scope
RedirectOverviewcalls the same composable the same way and had the identical latent bug — nobody had noticed because the redirect list is short. Fixing the composable fixes both, so both call sites are updated here.usePinnedToolbarBelowTopbaralso injectsbasePageScrollKey, but it is used fromRichTextEditor, which sits inside BasePage's slot. It is correct and untouched.Why the tests didn't catch it
The old spec mocked
useInfiniteScrollaway entirely and suppliedbasePageScrollKeythroughglobal.provide— something production never does. It asserted the window logic while stubbing out the very wiring that was broken.The rewritten spec mounts bare, with no provider in the tree, and drives the real observer.
Verification
expected 20 to be 25) and pass after — they are real regression guards, not tautologies.npm run type-check, eslint, prettier — clean.Not verified in a browser. No Docker daemon or
api/.envavailable on the machine this was written on, so there is no CouchDB/API to serve theUserdocsUserOverviewreads (User is a non-synced, API-only type). Paging is covered by the page-level test against a mocked/query, but the real scroll-into-view geometry has not been exercised against a running CMS. Worth a manual check with >20 users before merge.