Skip to content

The agent that grows with you

refactor(desktop): reuse ActionStatus for catalog installs

brooklyn!f30e5cbfd8c3
diff --git a/apps/desktop/src/app/skills/catalog-browser.tsx b/apps/desktop/src/app/skills/catalog-browser.tsx
index e0d25b7462e..a1220b70339 100644
--- a/apps/desktop/src/app/skills/catalog-browser.tsx
+++ b/apps/desktop/src/app/skills/catalog-browser.tsx
@@ -1,6 +1,7 @@
import { memo, type ReactNode, useDeferredValue, useEffect, useMemo, useState } from 'react'
import { PageLoader } from '@/components/page-loader'
+import { ActionStatus } from '@/components/ui/action-status'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { Codicon } from '@/components/ui/codicon'
@@ -101,8 +102,13 @@ export const CatalogBrowser = memo(function CatalogBrowser({
return (
<Button disabled={installed || installing || (kind === 'skills' && !entry.installIdentifier)} onClick={() => onInstall(entry)} size="sm" variant={installed ? 'secondary' : 'default'}>
- <Codicon name={installed ? 'check' : 'cloud-download'} />
- {installed ? c.installed : installing ? t.skills.hub.installing : t.skills.hub.install}
+ <ActionStatus
+ busy={t.skills.hub.installing}
+ done={c.installed}
+ idle={t.skills.hub.install}
+ idleIcon={<Codicon name="cloud-download" />}
+ state={installed ? 'done' : installing ? 'saving' : 'idle'}
+ />
</Button>
)
}
diff --git a/apps/desktop/src/app/skills/index.test.tsx b/apps/desktop/src/app/skills/index.test.tsx
index e5cba3cc638..e1e9b609232 100644
--- a/apps/desktop/src/app/skills/index.test.tsx
+++ b/apps/desktop/src/app/skills/index.test.tsx
@@ -391,6 +391,7 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
fireEvent.click(screen.getByRole('button', { name: 'Install' }))
const pending = screen.getByRole<HTMLButtonElement>('button', { name: 'Installing...' })
expect(pending.disabled).toBe(true)
+ expect(pending.querySelector('svg.animate-spin')).not.toBeNull()
fireEvent.click(pending)
expect(installHubSkill).toHaveBeenCalledExactlyOnceWith(identifier, {
connectionId: 'homelab', profile: 'researcher'