feat(results): reveal a larger pool with infinite scroll#57
Merged
Conversation
The aggregator already merged and ranked the full pool, but the Compose list and the served page rendered everything at once. The list could still feel like it stopped at the first screenful with no smooth way to keep going. Add infinite scroll on both surfaces, matching the desktop app. - ui/search/SearchScreen.kt: ResultsList holds the whole ranked pool but composes only a window (results.take(revealed)), growing it via a LazyListState + snapshotFlow when the last visible item nears the end. Pure UI state; resets when the results change. No ViewModel or network change. - server/SearchServer.kt: the served page renders the whole pool but collapses results past the first window, revealing them in batches via a bottom sentinel and a small inline IntersectionObserver script (same pattern as the theme script). No new request, store-nothing, and with JS off every result shows. The /click render cache and owner/LAN gating are unchanged. Deeper-fetch past the pool is deferred (documented in the OpenSpec tasks). Verified: ktlint + lintDebug + testDebugUnitTest + assembleDebug green (PagingRevealTest covers the served collapse + reveal markup); on the emulator the served page returned 46 results (10 visible + 36 collapsed) with the reveal script, up from one undifferentiated list. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Part of the search-quality RC feature pile (paging, Android side). Parity with desktop PR #74. Merges to
mainbehind CI; no per-feature GA — the pile ships together as one-rc.Context
The Android aggregator already merges and ranks the full pool (it never capped at 10, unlike desktop), but the Compose list and the served page rendered everything at once. This adds infinite scroll on both surfaces.
Change
ui/search/SearchScreen.kt):ResultsListholds the whole ranked pool but composes only a window (results.take(revealed)), growingrevealedvia aLazyListState+snapshotFlowwhen the last visible item nears the end. Pure UI state; resets when results change. No ViewModel/network change.server/SearchServer.kt): renders the whole pool but collapses results past the first window, revealing them in batches via a bottom sentinel + a small inlineIntersectionObserverscript (same pattern as the theme script). No new request, store-nothing, and with JS off every result shows. The/clickrender cache and owner/LAN gating are unchanged.Deferred (documented, not dropped)
Deeper-fetch past the pool is deferred — most engines return a single page and the full pool already removes truncation. Logged in the OpenSpec tasks.
Verification
PagingRevealTestcovers the served collapse + reveal markup and the small-pool no-machinery case.searchmobemulator the served page returned 46 results (10 visible + 36 collapsed) with the reveal script.OpenSpec
add-result-paging(new, Android) validates--strict.🤖 Generated with Claude Code