Repository navigation
feat(api): add paginated document list and detail endpoints - #22
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
GET /api/documentsnow returns a paginated envelope (items,total,limit,offset) ordered most recently created first, with an optionalsourcefilter and a truncatedcontent_previewper item, matching the conversation endpoints. A newGET /api/documents/{document_id}returns one document with its full content or 404, and the frontend client infrontend/lib/api.tsnow matches the new shape with agetDocumenthelper.Part of #5
Closes #21
How it was verified
mise run install- frontend installed cleanly. The backend needed the worktree venv recreated with the mise-pinned Python 3.13, because the default Python 3.14 cannot build a chromadb dependency. Theuv.lockchurn from that sync was reverted, so no lockfile change is in this PR.mise run test-backend- 67 passed, including the 8 new tests inbackend/tests/test_documents.py(ordering, preview truncation, pagination, source filter, empty list, detail, missing-document 404, invalid pagination). The new file swaps its database override per test so it cannot clobber the conversation tests when the files run together.mise run test-frontend- passed (the repo task currently reports no frontend tests yet).mise run test-runtime- 7 passed. Unchanged by this slice, run as a sanity check.bun run buildinfrontend/compiled and type-checked cleanly, which covers thelib/api.tschanges.GET /healthreturned 200.Proof
Capture method (a) succeeded offline. Nothing connected to a live Slack workspace, and no Socket Mode was run.
Reviewer notes
GET /api/documentschanged from a bare list to the paginated envelope. The only in-repo caller islistDocumentsinfrontend/lib/api.ts, updated here. Anything outside this repo reading that endpoint needs the same update.