fix(site): show table loader during session list pagination (#23719)

This patch shows the loading spinner on the AI Bridge Sessions table
during pagination. These API calls can take a noticeable amount of time
on dogfood, and without this it shows stale data while the fetch is
fetching.

Claude with the assist 🤖

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Kayla はな <mckayla@hey.com>
This commit is contained in:
Jeremy Ruppel
2026-03-27 19:09:42 -04:00
committed by GitHub
co-authored by Claude Sonnet 4.6 Kayla はな
parent 808dd64ef6
commit eda1bba969
3 changed files with 12 additions and 1 deletions
@@ -62,6 +62,7 @@ const AISessionListPage: FC = () => {
<ListSessionsPageView
isLoading={sessionsQuery.isLoading}
isFetching={sessionsQuery.isFetching}
isAISessionsEntitled={isEntitled}
isAISessionsEnabled={isEnabled}
sessions={sessionsQuery.data?.sessions}
@@ -32,6 +32,7 @@ const meta: Meta<typeof ListSessionsPageView> = {
component: ListSessionsPageView,
args: {
isLoading: false,
isFetching: false,
isAISessionsEntitled: true,
isAISessionsEnabled: true,
filterProps: defaultFilterProps,
@@ -77,6 +78,13 @@ export const Loaded: Story = {
},
};
export const Fetching: Story = {
args: {
isFetching: true,
sessions: [MockSession],
},
};
export const MultipleSessions: Story = {
args: {
sessions: Array.from({ length: 5 }, (_, i) => ({
@@ -30,6 +30,7 @@ import { ListSessionsRow } from "./ListSessionsRow";
interface ListSessionsPageViewProps {
isLoading: boolean;
isFetching: boolean;
isAISessionsEntitled: boolean;
isAISessionsEnabled: boolean;
sessions?: readonly AIBridgeSession[];
@@ -56,6 +57,7 @@ const ThreadTooltip: FC<PropsWithChildren> = ({ children }) => (
export const ListSessionsPageView: FC<ListSessionsPageViewProps> = ({
isLoading,
isFetching,
isAISessionsEntitled,
isAISessionsEnabled,
sessions,
@@ -110,7 +112,7 @@ export const ListSessionsPageView: FC<ListSessionsPageViewProps> = ({
</TableRow>
</TableHeader>
<TableBody>
{isLoading ? (
{isLoading || isFetching ? (
<TableLoader />
) : sessions?.length === 0 ? (
<TableEmpty message="No session logs available" />