mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
co-authored by
Claude Sonnet 4.6
Kayla はな
parent
808dd64ef6
commit
eda1bba969
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user