feat(chat): implement pull-to-refresh functionality and pagination for chat history

This commit is contained in:
2026-07-15 18:19:35 +08:00
parent 05ca15be48
commit c37a2f9040
21 changed files with 892 additions and 66 deletions
@@ -0,0 +1,17 @@
import { describe, expect, it } from "vitest";
import { ChatHistoryResponse } from "@/data/dto/chat";
describe("ChatHistoryResponse", () => {
it("exposes the pagination total and limit used by chat history", () => {
const response = ChatHistoryResponse.from({
messages: [],
total: 120,
limit: 50,
offset: 0,
});
expect(response.total).toBe(120);
expect(response.limit).toBe(50);
});
});
@@ -10,6 +10,8 @@ import { ChatMessage } from "../chat_message";
export class ChatHistoryResponse {
declare readonly messages: ChatMessage[];
declare readonly total: number;
declare readonly limit: number;
private constructor(input: ChatHistoryResponseInput) {
const data = ChatHistoryResponseSchema.parse(input);