Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(agents): collapse the Archived sidebar section by default (#9380)

Eric Hayes38685b9e182c
diff --git a/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx b/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx
index b2bf6a2db7..8e81bac77e 100644
--- a/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx
+++ b/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx
@@ -203,7 +203,16 @@ describe('mixed Agents sidebar', () => {
screen
.getAllByRole('heading', { level: 3 })
.map((heading) => heading.textContent)
- ).toEqual(['Needs you1', 'Recent1', 'Archived']);
+ ).toEqual(['Needs you1', 'Recent1']);
+ // Archived starts collapsed; its header expands it.
+ const archivedToggle = screen.getByRole('button', { name: /Archived/ });
+ expect(archivedToggle.getAttribute('aria-expanded')).toBe('false');
+ expect(screen.queryByRole('button', { name: /Old spike/ })).toBeNull();
+ fireEvent.click(archivedToggle);
+ expect(archivedToggle.getAttribute('aria-expanded')).toBe('true');
+ expect(
+ await screen.findByRole('button', { name: /Old spike/ })
+ ).toBeTruthy();
const chat = screen.getByRole('button', { name: /Plan launch/ });
expect(chat.getAttribute('data-kind')).toBe('chat');
expect(chat.getAttribute('aria-current')).toBe('page');
diff --git a/apps/web/src/features/agents-view/components/AgentsSidebar.tsx b/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
index 50d112addc..2833ba7903 100644
--- a/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
+++ b/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
@@ -169,6 +169,7 @@ export function AgentsSidebar(props: AgentsSidebarProps) {
const [searchOpen, setSearchOpen] = createSignal(false);
const [openPullRequestsOpen, setOpenPullRequestsOpen] = createSignal(true);
const [conversationsOpen, setConversationsOpen] = createSignal(true);
+ const [archivedOpen, setArchivedOpen] = createSignal(false);
let searchInput: HTMLInputElement | undefined;
const factsOf = (conversation: AgentConversationEntity) =>
conversationFacts(
@@ -478,23 +479,34 @@ export function AgentsSidebar(props: AgentsSidebarProps) {
</CollapsibleSection.Content>
</CollapsibleSection.Root>
<Show when={archived().length}>
- <section
+ <CollapsibleSection.Root
+ open={archivedOpen()}
+ onOpenChange={setArchivedOpen}
+ as="section"
aria-label="Archived conversations"
- class="mt-auto flex min-h-0 shrink-0 basis-1/4 flex-col border-t border-edge-muted pt-2"
+ class={cn(
+ 'mt-auto flex min-h-0 flex-col border-t border-edge-muted pt-2',
+ archivedOpen() && 'basis-1/4'
+ )}
>
- <ViewSidebar.Toolbar class="shrink-0">
- <h3 class="text-xs font-medium text-ink-muted">Archived</h3>
- <span class="text-xs text-ink-extra-muted tabular-nums">
- {archived().length}
- </span>
- </ViewSidebar.Toolbar>
- <ViewSidebar.Nav
- class="min-h-0 flex-1 shrink overflow-auto"
- onScroll={loadMoreNearEnd}
- >
- {rows(archived)}
- </ViewSidebar.Nav>
- </section>
+ <CollapsibleSection.Header>
+ <CollapsibleSection.Trigger>
+ <span class="min-w-0 truncate">Archived</span>
+ <span class="text-ink-extra-muted tabular-nums">
+ {archived().length}
+ </span>
+ <CollapsibleSection.Indicator />
+ </CollapsibleSection.Trigger>
+ </CollapsibleSection.Header>
+ <CollapsibleSection.Content class="flex min-h-0 flex-1 flex-col">
+ <ViewSidebar.Nav
+ class="min-h-0 flex-1 shrink overflow-auto"
+ onScroll={loadMoreNearEnd}
+ >
+ {rows(archived)}
+ </ViewSidebar.Nav>
+ </CollapsibleSection.Content>
+ </CollapsibleSection.Root>
</Show>
</ViewSidebar.Content>
</ViewSidebar.Root>
diff --git a/docs/agent-guide/ai-chat.md b/docs/agent-guide/ai-chat.md
index 18a54fa4d5..5418995b41 100644
--- a/docs/agent-guide/ai-chat.md
+++ b/docs/agent-guide/ai-chat.md
@@ -461,7 +461,8 @@ the shimmer.
tagging the workspace and row nodes and checking they survive the click.
Right-click (or long-press on mobile) opens the same entity menu as Home:
Rename, Favorite, Copy link, Share, Archive, Delete, and the other session
- actions. Archived sessions are grouped at the bottom under **Archived**.
+ actions. Archived sessions are grouped at the bottom under **Archived**, a
+ section that starts collapsed; click its header (count and caret) to expand it.
Runs of routines set to **Hide runs** (the default) are left out until the
clock button beside the search control (**Show hidden routine runs**) is
pressed; runs of routines set to **Show runs** are always listed. Every