Skip to content

[codex] Add paginated conversation detail API for mobile#298

Draft
ijry wants to merge 1 commit into
xintaofei:mainfrom
ijry:codex/mobile-conversation-detail-pagination-v2
Draft

[codex] Add paginated conversation detail API for mobile#298
ijry wants to merge 1 commit into
xintaofei:mainfrom
ijry:codex/mobile-conversation-detail-pagination-v2

Conversation

@ijry

@ijry ijry commented Jun 19, 2026

Copy link
Copy Markdown

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:

  • adds DbConversationDetailPage for summaries plus a window of turns
  • adds get_folder_conversation_paginated for both Tauri commands and the Axum web API
  • exposes the new API through the frontend API/Tauri wrappers and TypeScript types
  • adds unit coverage for pagination boundaries

Rebase 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 current main version of that component and retains only the API/model/client changes.

The compile issue after replaying the old commit was caused by the new DbConversationDetailPage model not being exported through src-tauri/src/models/mod.rs, while the command and web handler modules rely on crate::models::*. This PR exports the type at the model boundary instead of adding one-off imports in each consumer.

Compatibility

The existing get_folder_conversation response shape and route remain unchanged. Mobile clients can opt into get_folder_conversation_paginated with optional beforeTurnIndex and pageSize parameters. The first call defaults to the latest 30 turns, then older pages can be requested with next_before_turn_index while has_more_history is true.

Validation

  • cargo test --no-default-features --lib paginate_turns
  • cargo check --no-default-features --bin codeg-server
  • pnpm exec eslint src/lib/api.ts src/lib/tauri.ts src/lib/types.ts
  • pnpm exec tsc --noEmit
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant