[codex] Add paginated conversation detail API for mobile#298
Draft
ijry wants to merge 1 commit into
Draft
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.
Summary
This is a conflict-free replacement for #283, rebased on the current
xintaofei/codeg:main.It adds a mobile-oriented paginated conversation detail API while leaving the existing full-detail API intact:
DbConversationDetailPagefor summaries plus a window of turnsget_folder_conversation_paginatedfor both Tauri commands and the Axum web APIRebase notes
The old #283 branch conflicted in
src/components/message/message-list-view.tsx. That file was only carrying a formatting/layout conflict from the old branch, not the paginated API behavior, so this replacement keeps the currentmainversion of that component and retains only the API/model/client changes.The compile issue after replaying the old commit was caused by the new
DbConversationDetailPagemodel not being exported throughsrc-tauri/src/models/mod.rs, while the command and web handler modules rely oncrate::models::*. This PR exports the type at the model boundary instead of adding one-off imports in each consumer.Compatibility
The existing
get_folder_conversationresponse shape and route remain unchanged. Mobile clients can opt intoget_folder_conversation_paginatedwith optionalbeforeTurnIndexandpageSizeparameters. The first call defaults to the latest 30 turns, then older pages can be requested withnext_before_turn_indexwhilehas_more_historyis true.Validation
cargo test --no-default-features --lib paginate_turnscargo check --no-default-features --bin codeg-serverpnpm exec eslint src/lib/api.ts src/lib/tauri.ts src/lib/types.tspnpm exec tsc --noEmitgit diff --check