Skip to content

feat(site): add collapsible archived agents section to sidebar#22551

Merged
DanielleMaywood merged 11 commits intomainfrom
dm/archived-agents-sidebar
Mar 3, 2026
Merged

feat(site): add collapsible archived agents section to sidebar#22551
DanielleMaywood merged 11 commits intomainfrom
dm/archived-agents-sidebar

Conversation

@DanielleMaywood
Copy link
Copy Markdown
Contributor

Summary

Adds a collapsible Archived section at the bottom of the agents sidebar. Archived agents (chat.archived === true) are separated from active agents and displayed in their own section that is collapsed by default.

Changes

AgentsSidebar.tsx

  • Split visible root chats into activeRootIDs and archivedRootIDs
  • Active chats continue rendering in time groups (Today, Yesterday, This Week, Older)
  • Added collapsible Archived section below active chats with:
    • Toggle button (chevron + archive icon + "Archived" label + count badge)
    • Collapsed by default
    • Auto-expands when a search query matches archived agents
  • Empty state only shows when both active and archived lists are empty

AgentsSidebar.stories.tsx

  • Added 4 new stories: ArchivedAgentsCollapsed, ArchivedAgentsExpanded, ArchivedAgentsSearchAutoExpands, NoArchivedSection
  • Fixed missing onArchiveAndDeleteWorkspace in story meta args

Adds a collapsible 'Archived' section at the bottom of the agents
sidebar. Archived agents (chat.archived === true) are separated from
active agents and displayed in their own section that is collapsed by
default.

- Split visible root chats into active and archived lists
- Active chats continue to render in time groups (Today, Yesterday, etc.)
- Archived section shows toggle with chevron, archive icon, label, and count
- Section auto-expands when search matches archived agents
- Empty state only shows when both active and archived lists are empty
- Added 4 storybook stories covering collapsed, expanded, search, and
  no-archived states
- Fixed missing onArchiveAndDeleteWorkspace in story meta args
Replace the manual button/state toggle with the Radix-based
Collapsible, CollapsibleTrigger, and CollapsibleContent components
from components/Collapsible.
Use asChild on CollapsibleTrigger to delegate to a plain button with
explicit border-0, bg-transparent, p-0 resets. Also align the left
margin with the time group headers (ml-2.5 instead of ml-0.5).
Replaces the raw <button> with manual style resets with the project's
Button component using variant=subtle, which already provides
border-none, bg-transparent, and the correct hover color.
Renders an <hr> with border-border-default between the time-grouped
active chats and the archived section. The divider only appears when
both active and archived agents are visible.
Replace the raw <hr> with the project's Separator component
(Radix-based, renders with bg-border) to match the rest of the site.
Replace the Button-based trigger with a plain div using the same
classes as the time group headers (Today, Yesterday, etc.):
mb-1 ml-2.5 flex items-center justify-between text-xs font-medium
text-content-secondary. Only additions are cursor-pointer and a
small chevron on the right side for the expand/collapse affordance.

Removes the ArchiveIcon and separate count badge from the trigger
in favor of inline 'Archived (N)' text that matches the simplicity
of the other section labels.

Also updates stories to match the new label format.
Wrap the active and archived sections in a div with divide-y
divide-border. The active group gets pb-2 and the archived
Collapsible gets pt-2 for symmetric spacing around the divider.

Removes the Separator component import and the manual conditional
that checked activeRootIDs.length.
Biome's formatter inserted literal space text nodes between JSX
elements. They're meaningless inside Collapsible/ChatTreeContext
and just add noise.
The asChild prop on CollapsibleTrigger uses React.Children.only,
which requires exactly one child. Previous formatting had multiple
elements concatenated on single lines, causing whitespace text nodes
to be parsed as extra children. Fixed by placing each element on its
own line.
@DanielleMaywood DanielleMaywood marked this pull request as ready for review March 3, 2026 15:25
@DanielleMaywood DanielleMaywood merged commit cdb7145 into main Mar 3, 2026
27 of 29 checks passed
@DanielleMaywood DanielleMaywood deleted the dm/archived-agents-sidebar branch March 3, 2026 15:31
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants