diff --git a/site/src/pages/AgentsPage/AgentsSidebar.stories.tsx b/site/src/pages/AgentsPage/AgentsSidebar.stories.tsx index 873cf64b96..9ee955c373 100644 --- a/site/src/pages/AgentsPage/AgentsSidebar.stories.tsx +++ b/site/src/pages/AgentsPage/AgentsSidebar.stories.tsx @@ -30,14 +30,16 @@ const defaultModelConfigs: TypesGen.ChatModelConfig[] = [ }, ]; +const oneWeekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(); + const buildChat = (overrides: Partial = {}): Chat => ({ id: "chat-default", owner_id: "owner-1", title: "Agent", status: "completed", last_model_config_id: defaultModelConfigs[0].id, - created_at: "2026-02-18T00:00:00.000Z", - updated_at: "2026-02-18T00:00:00.000Z", + created_at: oneWeekAgo, + updated_at: oneWeekAgo, archived: false, last_error: null, ...overrides, @@ -419,3 +421,41 @@ export const NoArchivedSection: Story = { expect(canvas.queryByText(/^Archived \(/)).not.toBeInTheDocument(); }, }; + +export const ArchivingShowsSpinnerOnly: Story = { + args: { + chats: [ + buildChat({ + id: "archiving-chat", + title: "Chat being archived", + updated_at: todayTimestamp, + }), + ], + isArchiving: true, + archivingChatId: "archiving-chat", + }, + parameters: { + reactRouter: reactRouterParameters({ + location: { path: "/agents" }, + routing: agentsRouting, + }), + }, +}; + +export const DefaultShowsTimestampHidesMenu: Story = { + args: { + chats: [ + buildChat({ + id: "default-chat", + title: "Default state agent", + updated_at: todayTimestamp, + }), + ], + }, + parameters: { + reactRouter: reactRouterParameters({ + location: { path: "/agents" }, + routing: agentsRouting, + }), + }, +}; diff --git a/site/src/pages/AgentsPage/AgentsSidebar.tsx b/site/src/pages/AgentsPage/AgentsSidebar.tsx index 7ef426fc37..e7994106fa 100644 --- a/site/src/pages/AgentsPage/AgentsSidebar.tsx +++ b/site/src/pages/AgentsPage/AgentsSidebar.tsx @@ -450,52 +450,50 @@ const ChatTreeNode = memo(({ chat, isChildNode }) => { )} -
- - {shortRelativeTime(chat.updated_at)} - - - - - - - onArchiveAgent(chat.id)} - > - - Archive agent - - {workspaceId && ( - - onArchiveAndDeleteWorkspace(chat.id, workspaceId) - } - > - {" "} - - Archive & delete workspace - - )} - {" "} - +
+ {isArchivingThisChat ? ( + + ) : ( + <> + + {shortRelativeTime(chat.updated_at)} + + + + + + + onArchiveAgent(chat.id)} + > + + Archive agent + + {workspaceId && ( + + onArchiveAndDeleteWorkspace(chat.id, workspaceId) + } + > + + Archive & delete workspace + + )} + + + + )}
@@ -778,7 +776,7 @@ export const AgentsSidebar: FC = (props) => { - )}{" "} + )} )}