Skip to content

feat(results): reveal a larger pool with infinite scroll#57

Merged
ErikChevalier merged 1 commit into
mainfrom
feat/result-paging-android
Jun 3, 2026
Merged

feat(results): reveal a larger pool with infinite scroll#57
ErikChevalier merged 1 commit into
mainfrom
feat/result-paging-android

Conversation

@ErikChevalier
Copy link
Copy Markdown
Contributor

Part of the search-quality RC feature pile (paging, Android side). Parity with desktop PR #74. Merges to main behind 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

  • Compose (ui/search/SearchScreen.kt): ResultsList holds the whole ranked pool but composes only a window (results.take(revealed)), growing revealed via a LazyListState + snapshotFlow when the last visible item nears the end. Pure UI state; resets when results change. No ViewModel/network change.
  • Served page (server/SearchServer.kt): renders the whole pool but collapses results past the first window, revealing them in batches via a bottom sentinel + 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.

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

  • ktlint + lintDebug + testDebugUnitTest + assembleDebug green. PagingRevealTest covers the served collapse + reveal markup and the small-pool no-machinery case.
  • On the searchmob emulator 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

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>
@ErikChevalier ErikChevalier merged commit 81c0f4c into main Jun 3, 2026
2 checks passed
@ErikChevalier ErikChevalier deleted the feat/result-paging-android branch June 3, 2026 23:11
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.

1 participant