mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(site/src/pages/AgentsPage): show "Archived chats" sidebar heading when viewing archived chats (#26926)
In the agents sidebar, show "Archived chats" instead of "Chats" when the archive filter is set to `archived`. The heading reads the existing `sidebarFilters.archiveStatus` state, the same condition already used for the archived empty-state message. --- _This PR was opened by [Coder Agents](https://coder.com/) on behalf of @tracyjohnsonux._ --------- Co-authored-by: Coder Agents <noreply@coder.com>
This commit is contained in:
@@ -335,9 +335,11 @@ export const ChatsPanel: FC<ChatsPanelProps> = ({
|
||||
}))
|
||||
).filter((section) => section.chats.length > 0);
|
||||
const isShowingEmptyState = visibleRootIDs.length === 0;
|
||||
const isViewingArchived = sidebarFilters.archiveStatus === "archived";
|
||||
const chatsHeadingLabel = isViewingArchived ? "Archived chats" : "Chats";
|
||||
const emptyStateMessage = hasAppliedResultFilters
|
||||
? "No agents match these filters"
|
||||
: sidebarFilters.archiveStatus === "archived"
|
||||
: isViewingArchived
|
||||
? "No archived agents"
|
||||
: "No agents yet";
|
||||
const clearResultFilters = () => {
|
||||
@@ -429,7 +431,7 @@ export const ChatsPanel: FC<ChatsPanelProps> = ({
|
||||
<div className="mx-2 pt-6 mb-1.5">
|
||||
<div className="ml-2.5 mr-2 flex h-7 items-center justify-between">
|
||||
<h2 className="m-0 text-sm font-normal leading-6 text-content-secondary">
|
||||
Chats
|
||||
{chatsHeadingLabel}
|
||||
</h2>
|
||||
<div className="flex items-center gap-1">
|
||||
{onOpenSearchDialog && (
|
||||
|
||||
Reference in New Issue
Block a user