search-over-a-paged-list-queries-the-source
Installation
SKILL.md
Search queries the store, not the window
A paging stream is a window onto a collection. Filtering it — pagingData.filter { … }, or a
derivedStateOf over the loaded snapshot — only inspects the pages that have already been fetched.
Everything past the load boundary is not absent from the results; it was never asked.
The symptom is what makes this expensive: the feature works. On a short collection every page is loaded immediately and the filter is indistinguishable from a real search. It degrades with length and with scroll position, so the bug report is "search sometimes misses things", and the reproduction is "scroll down first, then search".
The correct shape is two independent readers of the same store:
// adapted — the paged reader, unchanged
val itemsPaging: StateFlow<PagingData<Row>> = …