From 348a3bd693c22cd48deb4014b3cf50ababc730c6 Mon Sep 17 00:00:00 2001 From: Ethan <39577870+ethanndickson@users.noreply.github.com> Date: Tue, 31 Mar 2026 12:57:46 +1100 Subject: [PATCH] fix(site): show archived filter on agents page when chat list is empty (#23793) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While running scaletests I noticed the archived filter button on the agents sidebar would disappear when the current filter had zero results. This made it impossible to switch between active and archived views once one side was empty. The filter dropdown was only rendered inside the Pinned or first time-group section header. When `visibleRootIDs` was empty, neither header existed, so the filter had nowhere to attach. This keeps the original dropdown placement on section headers when chats exist. When the list is empty, the empty-state box itself now provides a "View archived →" or "← Back to active" link so users can always switch filters without needing the dropdown. image image Both archived & unarchived look the same when there's at least one agent: image --- .../components/Sidebar/AgentsSidebar.tsx | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/site/src/pages/AgentsPage/components/Sidebar/AgentsSidebar.tsx b/site/src/pages/AgentsPage/components/Sidebar/AgentsSidebar.tsx index c0b23f2524..745d988559 100644 --- a/site/src/pages/AgentsPage/components/Sidebar/AgentsSidebar.tsx +++ b/site/src/pages/AgentsPage/components/Sidebar/AgentsSidebar.tsx @@ -855,9 +855,9 @@ export const AgentsSidebar: FC = (props) => { onReorderPinnedAgent?.(activeId, newIndex + 1); }; - // The filter dropdown attaches to the first visible section - // header. When pinned chats exist, that's the Pinned header; - // otherwise it falls through to the first non-empty time group. + // Attach the archived filter to the first visible section header. + // When the list is empty, fall back to contextual empty-state links + // instead of a floating standalone icon. const showFilterOnPinned = pinnedChats.length > 0; const firstNonEmptyGroup = showFilterOnPinned ? undefined @@ -1069,15 +1069,19 @@ export const AgentsSidebar: FC = (props) => { ? "No archived agents" : "No agents yet"}

- {archivedFilter === "archived" && ( - - )} + ) : (