fix: sort collection items before pagination in published site by lunenas · Pull Request #118 · ycode/ycode

@lunenas

When a collection layer uses field-based sorting (e.g. by date), the DB
was paginating by manual_order first, then client-side sort only
reordered that subset. This gave wrong results because the correct
items for the sorted view might not be in the DB-returned page.

Now fetch all items when field-based sorting is active, sort the full
set, then apply limit/offset via slice to get the correct page.

Made-with: Cursor

@liamwalder

liamwalder

@liamwalder liamwalder deleted the fix/published-collection-field-sort branch

April 1, 2026 09:41