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.

fix(agents): move the hidden routine runs toggle into the filter menu (#9837)

Eric Hayesc2323cfb988f
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 8e81bac77e..c59d135697 100644
--- a/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx
+++ b/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx
@@ -289,9 +289,10 @@ describe('mixed Agents sidebar', () => {
expect(clear).toHaveBeenCalledOnce();
});
- it('toggles hidden routine runs and marks the runs it lists', () => {
+ it('toggles hidden routine runs from the filter menu and marks the runs it lists', async () => {
const [show, setShow] = createSignal(false);
const change = vi.fn(setShow);
+ const clear = vi.fn();
render(() => (
<AgentsSidebar
onCreateAgent={vi.fn()}
@@ -299,7 +300,7 @@ describe('mixed Agents sidebar', () => {
filters={EMPTY_CONVERSATION_FILTERS}
grouping="none"
onFilterChange={vi.fn()}
- onClearFilters={vi.fn()}
+ onClearFilters={clear}
onGroupingChange={vi.fn()}
activePage="new"
onOpenPage={vi.fn()}
@@ -341,16 +342,6 @@ describe('mixed Agents sidebar', () => {
/>
));
- const toggle = screen.getByRole('button', {
- name: 'Show hidden routine runs',
- });
- expect(toggle.getAttribute('aria-pressed')).toBe('false');
- fireEvent.click(toggle);
- expect(change).toHaveBeenLastCalledWith(true);
- expect(toggle.getAttribute('aria-pressed')).toBe('true');
- fireEvent.click(toggle);
- expect(change).toHaveBeenLastCalledWith(false);
-
const run = screen
.getByRole('button', { name: 'Morning digest' })
.closest('[data-agent-session-row]');
@@ -359,6 +350,31 @@ describe('mixed Agents sidebar', () => {
.getByRole('button', { name: 'Plan launch' })
.closest('[data-agent-session-row]');
expect(mine?.querySelector('[aria-label="Routine run"]')).toBeNull();
+
+ const filterMenu = screen.getByRole('button', {
+ name: 'Filter conversations',
+ });
+ const badge = () => filterMenu.parentElement?.querySelector('span');
+ const openOption = async (name: string, role = 'menuitem') => {
+ fireEvent.keyDown(filterMenu, { key: 'ArrowDown' });
+ return screen.findByRole(role, { name });
+ };
+
+ expect(badge()).toBeNull();
+ fireEvent.keyDown(
+ await openOption('Show hidden routine runs', 'menuitemcheckbox'),
+ { key: 'Enter' }
+ );
+ await waitFor(() => expect(change).toHaveBeenLastCalledWith(true));
+ expect(badge()?.textContent).toBe('1');
+
+ await waitFor(() =>
+ expect(filterMenu.getAttribute('aria-expanded')).toBe('false')
+ );
+ fireEvent.keyDown(await openOption('Clear filters'), { key: 'Enter' });
+ await waitFor(() => expect(clear).toHaveBeenCalledOnce());
+ expect(change).toHaveBeenLastCalledWith(false);
+ expect(badge()).toBeNull();
});
it('opens rename and delete on a session or chat right-click', async () => {
diff --git a/apps/web/src/features/agents-view/components/AgentsSidebar.tsx b/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
index 2833ba7903..06c4fb0044 100644
--- a/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
+++ b/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
@@ -87,9 +87,6 @@ export type AgentsSidebarProps = Omit<
hasNextPage: boolean;
loadingNextPage: boolean;
onSearchChange: (search: string) => void;
- /** Whether the list includes unlisted sessions: routine runs it hides by default. */
- showUnlistedRuns: boolean;
- onShowUnlistedRunsChange: (show: boolean) => void;
onOpenConversation: (
conversation: AgentConversationEntity,
event?: MouseEvent
@@ -389,6 +386,8 @@ export function AgentsSidebar(props: AgentsSidebarProps) {
onFilterChange={props.onFilterChange}
onClearFilters={props.onClearFilters}
onGroupingChange={props.onGroupingChange}
+ showUnlistedRuns={props.showUnlistedRuns}
+ onShowUnlistedRunsChange={props.onShowUnlistedRunsChange}
/>
<Show when={isTouchDevice()}>
<CollapsibleSection.Action
@@ -400,16 +399,6 @@ export function AgentsSidebar(props: AgentsSidebarProps) {
<MagnifyingGlassIcon class="size-3.5" />
</CollapsibleSection.Action>
</Show>
- <CollapsibleSection.Action
- aria-label="Show hidden routine runs"
- aria-pressed={props.showUnlistedRuns}
- class={cn(props.showUnlistedRuns && 'bg-active text-ink')}
- onClick={() =>
- props.onShowUnlistedRunsChange(!props.showUnlistedRuns)
- }
- >
- <RoutineIcon class="size-3.5" />
- </CollapsibleSection.Action>
</CollapsibleSection.Header>
<CollapsibleSection.Content class="flex min-h-0 flex-1 flex-col gap-1">
<Show when={isTouchDevice() && searchOpen()}>
diff --git a/apps/web/src/features/agents-view/components/ConversationListControls.tsx b/apps/web/src/features/agents-view/components/ConversationListControls.tsx
index eb8982e732..5abd025122 100644
--- a/apps/web/src/features/agents-view/components/ConversationListControls.tsx
+++ b/apps/web/src/features/agents-view/components/ConversationListControls.tsx
@@ -4,12 +4,13 @@ import {
type ListFilterGroup,
ListGroupDropdown,
} from '@app/components/view-shell';
+import { t } from '@app/lib/i18n';
import ChatIcon from '@icon/system/regular/chat-circle.svg';
import CodeIcon from '@icon/system/regular/code.svg';
import GitMergeIcon from '@icon/system/regular/git-merge.svg';
import GitPullRequestIcon from '@icon/system/regular/git-pull-request.svg';
-import { cn } from '@ui';
-import { Show } from 'solid-js';
+import { cn, Dropdown } from '@ui';
+import { batch, Show } from 'solid-js';
import {
activeFilterCount,
type ConversationFilterCategory,
@@ -102,6 +103,9 @@ export type ConversationListControlsProps = {
) => void;
onClearFilters: () => void;
onGroupingChange: (grouping: ConversationGrouping) => void;
+ /** Whether the list includes unlisted sessions: routine runs it hides by default. */
+ showUnlistedRuns: boolean;
+ onShowUnlistedRunsChange: (show: boolean) => void;
};
/** The Tasks-style Group and Filter menus for the conversation list. */
@@ -110,7 +114,14 @@ export function ConversationListControls(props: ConversationListControlsProps) {
category: ConversationFilterCategory,
value: FilterValue
) => (props.filters[category] as readonly FilterValue[]).includes(value);
- const activeCount = () => activeFilterCount(props.filters);
+ const activeCount = () =>
+ activeFilterCount(props.filters) + (props.showUnlistedRuns ? 1 : 0);
+ const clearAll = () => {
+ batch(() => {
+ props.onClearFilters();
+ props.onShowUnlistedRunsChange(false);
+ });
+ };
return (
<div class="flex shrink-0 items-center">
@@ -129,7 +140,26 @@ export function ConversationListControls(props: ConversationListControlsProps) {
isSelected={isSelected}
selectedIds={(group) => props.filters[group]}
onSelectionChange={props.onFilterChange}
- onClear={props.onClearFilters}
+ footer={
+ <>
+ <Dropdown.Group>
+ <Dropdown.CheckboxItem
+ closeOnSelect
+ checked={props.showUnlistedRuns}
+ onChange={props.onShowUnlistedRunsChange}
+ >
+ <span class="flex-1">
+ {t('viewMenus.showHiddenRoutineRuns')}
+ </span>
+ </Dropdown.CheckboxItem>
+ </Dropdown.Group>
+ <Dropdown.Group>
+ <Dropdown.Item class="text-failure-ink" onSelect={clearAll}>
+ {t('viewMenus.clearFilters')}
+ </Dropdown.Item>
+ </Dropdown.Group>
+ </>
+ }
/>
<Show when={activeCount() > 0}>
<span class="pointer-events-none absolute -top-0.5 right-0 z-10 flex size-4 translate-x-1/2 items-center justify-center rounded-full bg-accent text-xxs font-medium leading-none text-surface">
diff --git a/apps/web/src/lib/i18n/locales/en/view-menus.ts b/apps/web/src/lib/i18n/locales/en/view-menus.ts
index f7bb29c6a4..abbf6ee078 100644
--- a/apps/web/src/lib/i18n/locales/en/view-menus.ts
+++ b/apps/web/src/lib/i18n/locales/en/view-menus.ts
@@ -80,6 +80,7 @@ export default {
groupList: 'Group list',
filterList: 'Filter list',
clearFilters: 'Clear filters',
+ showHiddenRoutineRuns: 'Show hidden routine runs',
// Filter menu
filter: 'Filter',
diff --git a/docs/agent-guide/ai-chat.md b/docs/agent-guide/ai-chat.md
index 5418995b41..2946edb5cd 100644
--- a/docs/agent-guide/ai-chat.md
+++ b/docs/agent-guide/ai-chat.md
@@ -463,11 +463,12 @@ the shimmer.
Rename, Favorite, Copy link, Share, Archive, Delete, and the other session
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
- routine run carries the same clock icon after its age. The list starts
- without hidden runs each time the Agents view opens.
+ Runs of routines set to **Hide runs** (the default) are left out until
+ **Show hidden routine runs** is checked in the **Filter conversations** menu,
+ which counts it on the filter badge and unchecks it with **Clear filters**;
+ runs of routines set to **Show runs** are always listed. Every routine run
+ carries a clock icon after its age. The list starts without hidden runs each
+ time the Agents view opens.
- The agent composer's **+ (Add)** menu offers **Add photos**, **Add files**,
**Add from library** (`@` references), and **Use a skill** (`/`; sessions show
**Skills & commands**). Desktop uses a scrollable menu; phones use a bottom
diff --git a/docs/agent-guide/navigation.md b/docs/agent-guide/navigation.md
index 20d507a6f5..690f4af540 100644
--- a/docs/agent-guide/navigation.md
+++ b/docs/agent-guide/navigation.md
@@ -1132,7 +1132,8 @@ fields hide their keyboard hint on touch devices.
Open the routine and use its **Run History** tab to see past runs. Each run is its
own agent session. The routine's **Runs hidden** / **Runs shown** chip decides
where its runs appear. **Hide runs** (the default) keeps them off Home and out of
-the Agents sidebar until **Show hidden routine runs** is pressed. **Show runs**
+the Agents sidebar until **Show hidden routine runs** is checked in its filter
+menu. **Show runs**
lists them on Home and in Agents like the owner's own sessions. The setting
applies to runs that start after it changes. A run that finishes normally sends
no notification; a failed or cut-short run, a question the agent asks, a held tool