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
@@ -131,6 +131,10 @@ export function createTestChatMachine(
export function createLoadHistoryCallback(
messages: UiMessage[],
networkMessages: UiMessage[] = messages,
pagination: { total: number; limit: number } = {
total: networkMessages.length,
limit: 50,
},
) {
return fromCallback<ChatEvent>(({ sendBack }) => {
sendBack({
@@ -147,6 +151,8 @@ export function createLoadHistoryCallback(
localOverwritten: true,
localCount: messages.length,
networkCount: networkMessages.length,
total: pagination.total,
limit: pagination.limit,
},
});
return () => undefined;