straw: infinite-scroll pagination for channel + search

Wire the new strawcore continuation fetchers through UniFFI and add
load-more-on-scroll to the Channel and Search screens — previously both
loaded only page 1 and stopped.

FFI (rust/strawcore): search() now returns Page{items, continuation};
channelInfo carries videos_continuation; new searchContinuation() and
channelVideosContinuation() suspend funs map the core ContinuationPage.

Channel + Search ViewModels: loadMore() fetches the next page, dedups by
url, advances the token, and stops when the token runs out or a page
yields zero net-new items (guards a looping continuation). Result-set
swaps (channel switch / new submit / cache preview) cancel the in-flight
page, and a token fence inside the state update prevents a stale page
being spliced into a replaced list. Screens add a near-end LazyColumn
trigger (rememberLazyListState + derivedStateOf) and a footer spinner.
This commit is contained in:
Sulkta 2026-06-19 18:21:42 -07:00
parent 7cccc96d20
commit 21ca8da8d2
8 changed files with 2670 additions and 9 deletions

View file

@ -20,7 +20,7 @@ mod stream;
// Re-exports so UniFFI sees the types at the crate root for macro discovery.
pub use channel::ChannelInfo;
pub use error::StrawcoreError;
pub use search::SearchItem;
pub use search::{Page, SearchItem};
pub use stream::{AudioStreamItem, StreamInfo, VideoStreamItem};
/// Initialize Android logging + the strawcore-core HTTP downloader.