Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions console/src/hooks/use-agent-sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export function useAgentSessions({ agentKind, pageSize = DEFAULT_PAGE_SIZE }: Us
cursor: pageParam || undefined,
}),
getNextPageParam: (last) => last.next_cursor ?? undefined,
// Keep the previously-loaded pages visible while a background
// refetch (auto-refresh, window-focus, query-key churn) is in
// flight. Every other list hook in the app does this — without
// it the Sessions page blanks out and re-renders the whole list
// each refresh tick, while other pages do a frame-perfect swap.
placeholderData: (prev) => prev,
})
}

Expand All @@ -42,6 +48,7 @@ export function useAgentSessionDetail(sourceId: string | null, sessionId: string
`/api/agent-sessions/${encodeURIComponent(sourceId!)}/${encodeURIComponent(sessionId!)}`,
),
enabled: sourceId != null && sessionId != null,
placeholderData: (prev) => prev,
})
}

Expand All @@ -63,5 +70,6 @@ export function useSessionTurns(
},
),
getNextPageParam: (last) => last.next_cursor ?? undefined,
placeholderData: (prev) => prev,
})
}
Loading