Add recency sorting to project/list (#41223)

## What changed

- Include `recencyAt`, derived from the newest non-archived assigned thread, in project responses.
- Let `project/list` sort by `position` or `recencyAt` in either direction, with recency as the default descending order for that key and projects without activity placed last.
- Encode the sort key, direction, and millisecond-precision anchor in new cursors while retaining existing ascending-position cursors.
- Add an index for project recency lookups and document the API's sorting and pagination behavior.

## Testing

- Cover recency updates when threads are assigned, archived, unarchived, or deleted.
- Cover ordering, null handling, tie-breaking, cursor pagination, invalid sort combinations, and cursor mismatches.

GitOrigin-RevId: 6165e2b9976b0b45cfa16bcd42978b67811f6df5
This commit is contained in:
Anton Panasenko authored and copyberry committed 2026-08-27 23:43:46 +00:00
1 parent 2d929eb7c3
commit f6726e8986
22 files changed
+796 -122

No files matched your search

+1
View File
@@ -16,6 +16,7 @@ mod thread_sections;
mod types;
pub use codex_state::MAX_QUEUE_ITEMS;
pub use codex_state::ProjectSortKey;
pub use codex_state::QueuedUserSubmissionRecord;
pub use error::ThreadStoreError;
pub use error::ThreadStoreResult;