feat(mobile-api): sortable catalog search (title/date) with sort-aware keyset#242
Conversation
…e keyset GET /api/v1/catalog/search now accepts a `sort` param mirroring the web catalog: newest (default), oldest, title_asc, title_desc. Previously the order was hardcoded to l.id DESC (cataloguing date) with no way to change it, so the app could only ever show newest-first — the mobile app has no title/alphabetical order the way the web catalog does. Keyset (cursor) pagination is made sort-aware: the opaque cursor now carries the last row's sort anchor (value + id), and the WHERE clause pages with (col </> ? OR (col = ? AND id </> ?)) tie-broken on the unique id, so no row is skipped or repeated regardless of the chosen order. A cursor minted under a different sort is ignored, so switching order restarts cleanly. Author sorts are intentionally left out for now (the principal author is a per-row subquery, not keyset-friendly). plugin.json 1.2.1 -> 1.2.2. Verified against the dev DB: title_asc pages continue alphabetically across the keyset boundary with no overlap, including titles containing apostrophes (bound params, not string-built SQL).
|
Warning Review limit reached
Next review available in: 38 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Backend half of Uwe's app remarks (#238-style): the mobile catalog could only ever show newest-first (hardcoded
ORDER BY l.id DESC), with no alphabetical/title order like the web catalog offers.GET /api/v1/catalog/searchnow takes asortparam mirroring the web:newest(default),oldest,title_asc,title_desc. The opaque keyset cursor is made sort-aware — it carries the last row's(sort value, id)and pages with(col </> ? OR (col = ? AND id </> ?))tie-broken on the unique id, so no row is skipped/repeated in any order. A cursor minted under a different sort is ignored, so switching order restarts cleanly.Author sorts are intentionally deferred (principal author is a per-row subquery, not keyset-friendly).
plugin.json1.2.1 → 1.2.2. Additive + backward compatible: an older server just ignores the param.Verified against the dev DB:
title_ascpages continue alphabetically across the keyset boundary with no overlap, including apostrophe titles (bound params). php -l + PHPStan L5 clean. The Android sort-picker UI that consumes this is a separate PR on Pinakes-Android.