Skip to content

Commit c55f114

Browse files
committed
fix(agents): move archive action into menu
1 parent 6167dff commit c55f114

1 file changed

Lines changed: 47 additions & 25 deletions

File tree

frontend/src/lib/features/agents/AgentProfile.svelte

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
IconDeviceFloppy as Save,
1616
IconShieldCheck as ShieldCheck,
1717
IconArchive as Archive,
18+
IconDots as MoreHorizontal,
1819
} from '@tabler/icons-svelte-runes';
1920
import { agentBindings, agentRuns, agentSkills, api } from '../../api.js';
2021
import { updateQueryParams } from '../../router.js';
2122
import { workspacePermissions } from '../../stores';
2223
import PageHeader from '../../layout/PageHeader.svelte';
24+
import DropdownMenu from '../../layout/DropdownMenu.svelte';
2325
import AlertBox from '../../components/AlertBox.svelte';
2426
import Avatar from '../../components/Avatar.svelte';
2527
import Badge from '../../components/Badge.svelte';
@@ -586,6 +588,21 @@
586588
.replace(/\b\w/g, (letter) => letter.toUpperCase());
587589
}
588590
591+
function profileActionItems() {
592+
return [
593+
{
594+
id: 'archive',
595+
type: 'regular',
596+
icon: Archive,
597+
title: 'Archive',
598+
color: 'var(--ds-text-danger)',
599+
hoverClass: 'hover-danger',
600+
testid: 'agent-archive',
601+
onClick: () => archiveDialogOpen = true,
602+
},
603+
];
604+
}
605+
589606
function changeTab({ tab }) {
590607
activeTab = tab;
591608
updateQueryParams({ tab: tab === 'overview' ? null : tab }, { push: true });
@@ -625,32 +642,37 @@
625642
subtitle={agent.purpose || 'Workspace specialist'}
626643
>
627644
{#snippet actions()}
628-
<Badge variant={availabilityVariant(agent.availability)}>
629-
{label(agent.availability)}
630-
</Badge>
631-
{#if canAdmin}
632-
{#if agent.lifecycle === 'archived'}
633-
<Button
634-
variant="default"
635-
size="small"
636-
loading={lifecycleChanging}
637-
onclick={restoreProfile}
638-
dataTestid="agent-restore"
639-
>
640-
Restore as Draft
641-
</Button>
642-
{:else}
643-
<Button
644-
variant="danger"
645-
size="small"
646-
icon={Archive}
647-
onclick={() => archiveDialogOpen = true}
648-
dataTestid="agent-archive"
649-
>
650-
Archive
651-
</Button>
645+
<div class="flex min-h-8 items-center gap-2">
646+
<Badge variant={availabilityVariant(agent.availability)}>
647+
{label(agent.availability)}
648+
</Badge>
649+
{#if canAdmin}
650+
{#if agent.lifecycle === 'archived'}
651+
<Button
652+
variant="default"
653+
size="small"
654+
loading={lifecycleChanging}
655+
onclick={restoreProfile}
656+
dataTestid="agent-restore"
657+
>
658+
Restore as Draft
659+
</Button>
660+
{:else}
661+
<DropdownMenu
662+
triggerIcon={MoreHorizontal}
663+
triggerClass="w-8 h-8 flex items-center justify-center rounded-md transition-colors"
664+
triggerStyle="background-color: var(--ds-surface); color: var(--ds-text-subtle);"
665+
triggerTestid="agent-profile-actions"
666+
triggerLabel="Agent actions"
667+
items={profileActionItems()}
668+
maxWidth="max-w-48"
669+
showChevron={false}
670+
iconOnly={true}
671+
disabled={lifecycleChanging}
672+
/>
673+
{/if}
652674
{/if}
653-
{/if}
675+
</div>
654676
{/snippet}
655677
</PageHeader>
656678

0 commit comments

Comments
 (0)