Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): finish button follow-up migration

kirozengcedb91d1a619
diff --git a/apps/desktop/src/renderer/__tests__/addProviderWizardOpenAiAuth.test.tsx b/apps/desktop/src/renderer/__tests__/addProviderWizardOpenAiAuth.test.tsx
index 1a8a81e2eb..5a97972e70 100644
--- a/apps/desktop/src/renderer/__tests__/addProviderWizardOpenAiAuth.test.tsx
+++ b/apps/desktop/src/renderer/__tests__/addProviderWizardOpenAiAuth.test.tsx
@@ -192,6 +192,23 @@ afterEach(() => {
});
describe('AddProviderWizard — OpenAI 授权边界', () => {
+ it('keeps the inline cancel action named and enabled during authorization', async () => {
+ let finish!: (value: unknown) => void;
+ triggerLogin.mockReturnValue(new Promise(resolve => { finish = resolve; }));
+ cancelLogin.mockResolvedValue({});
+ const onDone = vi.fn();
+ render(<AddProviderWizard providers={[OPENAI_PROVIDER]}
+ entry={{ kind: 'builtin', providerId: 'openai' }} onOpenCustomForm={vi.fn()} onClose={vi.fn()} onDone={onDone} />);
+ fireEvent.click(await screen.findByText('settings.providers.openai.useLocalAccount'));
+ const cancel = await screen.findByRole('button', { name: 'settings.providers.button.cancel' });
+ expect((cancel as HTMLButtonElement).disabled).toBe(false);
+ expect(cancel.getAttribute('aria-busy')).toBeNull();
+ fireEvent.click(cancel);
+ expect(cancelLogin).toHaveBeenCalledOnce();
+ await act(async () => { finish({ ok: false, authenticated: false }); });
+ expect(onDone).not.toHaveBeenCalled();
+ });
+
it.each(['openai', 'anthropic'].flatMap(id => ['cancel', 'unmount'].map(exit => ({ id, exit }))))('discards local $id completion after $exit', async ({ id, exit }) => {
let finish!: (value: unknown) => void;
triggerLogin.mockReturnValue(new Promise(resolve => { finish = resolve; }));
diff --git a/apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx b/apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx
index 9461d7e018..b43434ea61 100644
--- a/apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx
+++ b/apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx
@@ -25,7 +25,6 @@ import {
import { Check } from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import { Spinner } from '@/components/ui/spinner';
import { blobToDataUrl } from '@/lib/annotationBurnIn';
import { isEditableKeyboardTarget } from '@/lib/editableKeyboardTarget';
import { createLogger } from '@/lib/logger';
diff --git a/apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx b/apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx
index 1c4f759925..d16586fe5a 100644
--- a/apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx
+++ b/apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx
@@ -36,7 +36,6 @@ import {
slashCommandRangeCoversToken,
} from '@cindy/maker-shared/composer-palette';
import { cn } from '@/lib/utils';
-import { Spinner } from '@/components/ui/spinner';
import { ListComposerTextarea } from '@/components/new-chat/ListComposerTextarea';
import { toast } from '@/lib/toast';
import { ApiError } from '@/lib/httpClient';
diff --git a/apps/desktop/src/renderer/components/settings/BrowserBackendSubsection.tsx b/apps/desktop/src/renderer/components/settings/BrowserBackendSubsection.tsx
index 21120cd6ff..07f9a39d81 100644
--- a/apps/desktop/src/renderer/components/settings/BrowserBackendSubsection.tsx
+++ b/apps/desktop/src/renderer/components/settings/BrowserBackendSubsection.tsx
@@ -110,13 +110,6 @@ export function BrowserBackendSubsection({
<Button
variant="secondary"
loading={recovering}
- aria-label={
- recovering
- ? t('settings.computerUse.browserBackend.health.recovering')
- : embeddedHealth.status === 'error'
- ? t('settings.computerUse.browserBackend.health.recover')
- : t('settings.computerUse.browserBackend.health.reconnect')
- }
type="button"
onClick={onRecover}
disabled={pending || !embeddedHealth.canRecover}
diff --git a/apps/desktop/src/renderer/components/settings/HookConnectionsSection.tsx b/apps/desktop/src/renderer/components/settings/HookConnectionsSection.tsx
index 83a747a36f..6448817fa2 100644
--- a/apps/desktop/src/renderer/components/settings/HookConnectionsSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/HookConnectionsSection.tsx
@@ -402,10 +402,6 @@ function DefaultWorkspaceRadio({
);
}
-/** 小号胶囊按钮(「复制链接 / 安装 Slack App」共用)。 */
-const pillBtn =
- 'flex h-6 shrink-0 items-center rounded-full border border-[var(--border-default)] px-2.5 text-11 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)] disabled:opacity-50';
-
const RESERVED_WORKSPACE_ALIASES = new Set([
HOOK_CHAT_WORKSPACE_ALIAS,
'__proto__',
diff --git a/apps/desktop/src/renderer/components/settings/MyDevicesPanel.tsx b/apps/desktop/src/renderer/components/settings/MyDevicesPanel.tsx
index 1379a93d2c..46452e072c 100644
--- a/apps/desktop/src/renderer/components/settings/MyDevicesPanel.tsx
+++ b/apps/desktop/src/renderer/components/settings/MyDevicesPanel.tsx
@@ -19,7 +19,6 @@ import { useTranslation } from 'react-i18next';
import { RefreshCw, Pencil, Trash2, Check, X, Monitor } from 'lucide-react';
import { toast } from '@/lib/toast';
-import { Spinner } from '@/components/ui/spinner';
import { Switch } from '@/components/ui/switch';
import type { DeviceLinkSettings } from '@/hooks/useDeviceLinkSettings';
import { revokedDevicesStore } from '@/features/device-link/revokedDevicesStore';
diff --git a/apps/desktop/src/renderer/components/settings/OAuthDeviceCodeCard.tsx b/apps/desktop/src/renderer/components/settings/OAuthDeviceCodeCard.tsx
index 500fe26618..f1b52233a9 100644
--- a/apps/desktop/src/renderer/components/settings/OAuthDeviceCodeCard.tsx
+++ b/apps/desktop/src/renderer/components/settings/OAuthDeviceCodeCard.tsx
@@ -91,11 +91,6 @@ export function OAuthDeviceCodeCard({
toast.error(t('settings.providers.wizard.verificationPageOpenFailed')),
);
}}
- className="flex h-8 items-center gap-1.5 rounded-full border px-3 text-12 font-medium transition-colors hover:bg-[var(--surface-hover)]"
- style={{
- borderColor: 'var(--settings-btn-secondary-border)',
- color: 'var(--settings-btn-secondary-text)',
- }}
>
<ExternalLink size={13} />
{t('settings.providers.wizard.openVerificationPage')}
diff --git a/apps/desktop/src/renderer/components/settings/PiPackagesSection.tsx b/apps/desktop/src/renderer/components/settings/PiPackagesSection.tsx
index e6cabb95cc..e1713bc467 100644
--- a/apps/desktop/src/renderer/components/settings/PiPackagesSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/PiPackagesSection.tsx
@@ -25,14 +25,6 @@ const CARD_CLASS = cn(
'border border-[var(--settings-theme-card-border)]',
);
-const ACTION_CLASS = cn(
- 'inline-flex h-8 items-center justify-center gap-1.5 rounded-full px-3 text-12 font-medium',
- 'border border-[var(--settings-theme-card-border)]',
- 'text-[var(--settings-section-sublabel)] transition-colors hover:bg-sidebar-item-hover',
- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]',
- 'disabled:cursor-not-allowed disabled:opacity-50',
-);
-
const ICON_ACTION_CLASS = cn(
'flex h-7 w-7 shrink-0 items-center justify-center rounded-lg',
'text-[var(--settings-section-desc)] transition-colors hover:bg-sidebar-item-hover',
diff --git a/apps/desktop/src/renderer/components/settings/ProviderConnectionDialog.tsx b/apps/desktop/src/renderer/components/settings/ProviderConnectionDialog.tsx
index a6f908a138..9d57535a2c 100644
--- a/apps/desktop/src/renderer/components/settings/ProviderConnectionDialog.tsx
+++ b/apps/desktop/src/renderer/components/settings/ProviderConnectionDialog.tsx
@@ -32,7 +32,6 @@ import {
import { SegmentedControl } from '@/components/ui/segmented-control';
import { cn } from '@/lib/utils';
import { toast } from '@/lib/toast';
-import { Spinner } from '@/components/ui/spinner';
import { Button } from '@/components/ui/button';
import { FormField } from '@/components/ui/form-field';
import { Tip } from '@/components/ui/tooltip';
diff --git a/apps/desktop/src/renderer/components/settings/RemoteHostDetail.tsx b/apps/desktop/src/renderer/components/settings/RemoteHostDetail.tsx
index 11d0b7dbcc..cabfd08abf 100644
--- a/apps/desktop/src/renderer/components/settings/RemoteHostDetail.tsx
+++ b/apps/desktop/src/renderer/components/settings/RemoteHostDetail.tsx
@@ -19,7 +19,6 @@ import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { CheckCircle2, AlertCircle, Play, Upload, Sparkles, Waypoints } from 'lucide-react';
-import { cn } from '@/lib/utils';
import { toast } from '@/lib/toast';
import { mapIpcErrorToI18nKey } from '@/utils/ipcError';
import { useConfirmDialog } from '@/components/ui/confirm-dialog-provider';
diff --git a/apps/desktop/src/renderer/components/settings/SessionImportSection.tsx b/apps/desktop/src/renderer/components/settings/SessionImportSection.tsx
index 33f6eb9233..301af556f1 100644
--- a/apps/desktop/src/renderer/components/settings/SessionImportSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/SessionImportSection.tsx
@@ -6,7 +6,6 @@ import { Check, ChevronDown, ChevronRight, Download, FileUp, RefreshCw } from 'l
import { basename, cn } from '@/lib/utils';
import { toast } from '@/lib/toast';
import { emitRefresh } from '@/lib/sessionsBus';
-import { Spinner } from '@/components/ui/spinner';
import { Button } from '@/components/ui/button';
import { formatSidebarTime, formatSidebarTimeAbsolute } from '@/features/cc-agent/lib/formatSidebarTime';
import { SessionShareImportWizard } from './SessionShareImportWizard';
diff --git a/apps/desktop/src/renderer/components/settings/SshKeySetupDialog.tsx b/apps/desktop/src/renderer/components/settings/SshKeySetupDialog.tsx
index b7b9de0c54..bb46bc14fc 100644
--- a/apps/desktop/src/renderer/components/settings/SshKeySetupDialog.tsx
+++ b/apps/desktop/src/renderer/components/settings/SshKeySetupDialog.tsx
@@ -20,7 +20,6 @@ import { useTranslation } from 'react-i18next';
import * as Dialog from '@radix-ui/react-dialog';
import { X, Copy, Key, KeyRound, Lock, Plus, Server, CheckCircle2, Circle, Unlock, Eye, EyeOff, AlertTriangle } from 'lucide-react';
-import { cn } from '@/lib/utils';
import { toast } from '@/lib/toast';
import { Spinner } from '@/components/ui/spinner';
import { mapIpcErrorToI18nKey } from '@/utils/ipcError';
diff --git a/apps/desktop/src/renderer/components/settings/VoiceInputSection.tsx b/apps/desktop/src/renderer/components/settings/VoiceInputSection.tsx
index 6983b7cc4f..c23c578b4d 100644
--- a/apps/desktop/src/renderer/components/settings/VoiceInputSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/VoiceInputSection.tsx
@@ -2162,12 +2162,6 @@ export function VoiceInputSection() {
}
setCustomDictionaryExpanded(!customDictionaryExpanded);
}}
- className={cn(
- 'flex h-8 shrink-0 items-center gap-1.5 rounded-full px-3 text-12 font-medium transition-colors',
- 'border border-[var(--settings-btn-secondary-border)]',
- 'bg-[var(--settings-btn-secondary-bg)] text-[var(--settings-btn-secondary-text)]',
- 'hover:bg-[var(--settings-btn-secondary-hover-bg)]',
- )}
>
<span>
{t(
diff --git a/apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx b/apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx
index b84762c604..af8b1ed03e 100644
--- a/apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx
+++ b/apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx
@@ -1067,7 +1067,11 @@ export function WorkLouderCodexSettings({
</span>
)}
{guardState?.status === 'recovery-required' ? (
- <SettingsSecondaryButton disabled={guardSaving} onClick={() => void recoverGuard()}>
+ <SettingsSecondaryButton
+ loading={guardSaving}
+ disabled={guardSaving}
+ onClick={() => void recoverGuard()}
+ >
{t('settings.shortcuts.workLouderCodex.codexGuard.recover')}
</SettingsSecondaryButton>
) : (
diff --git a/apps/desktop/src/renderer/components/settings/__tests__/BrowserBackendSubsection.test.tsx b/apps/desktop/src/renderer/components/settings/__tests__/BrowserBackendSubsection.test.tsx
index 1b676412e0..ef05d0fecf 100644
--- a/apps/desktop/src/renderer/components/settings/__tests__/BrowserBackendSubsection.test.tsx
+++ b/apps/desktop/src/renderer/components/settings/__tests__/BrowserBackendSubsection.test.tsx
@@ -63,7 +63,8 @@ describe('BrowserBackendSubsection', () => {
).toBeTruthy();
});
- it('uses the semantic spinner motion and stays static under reduced motion', () => {
+ it('keeps its accessible name while loading, prevents repeats and uses reduced-motion-aware feedback', () => {
+ const onRecover = vi.fn();
render(
<BrowserBackendSubsection
active="rsb-webview"
@@ -71,15 +72,22 @@ describe('BrowserBackendSubsection', () => {
recovering
health={{ active: 'rsb-webview', status: 'ready', canRecover: true }}
onSelect={vi.fn()}
- onRecover={vi.fn()}
+ onRecover={onRecover}
/>,
);
const button = screen.getByRole('button', {
- name: 'settings.computerUse.browserBackend.health.recovering',
+ name: 'settings.computerUse.browserBackend.health.reconnect',
});
+ expect(button.getAttribute('aria-busy')).toBe('true');
+ expect((button as HTMLButtonElement).disabled).toBe(true);
+ fireEvent.click(button);
+ expect(onRecover).not.toHaveBeenCalled();
+ expect(button.querySelector('.opacity-0')?.textContent).toContain(
+ 'settings.computerUse.browserBackend.health.reconnect',
+ );
const spinner = button.querySelector('.animate-spinner');
- expect(spinner).toBeTruthy();
+ expect(spinner?.classList.contains('animate-spinner')).toBe(true);
expect(spinner?.classList.contains('motion-reduce:animate-none')).toBe(true);
expect(spinner?.classList.contains('animate-spin')).toBe(false);
});
diff --git a/apps/desktop/src/renderer/components/settings/contacts/ContactsListPane.tsx b/apps/desktop/src/renderer/components/settings/contacts/ContactsListPane.tsx
index 52132c36af..963b140c0a 100644
--- a/apps/desktop/src/renderer/components/settings/contacts/ContactsListPane.tsx
+++ b/apps/desktop/src/renderer/components/settings/contacts/ContactsListPane.tsx
@@ -118,18 +118,16 @@ export function ContactsListPane(props: Props) {
>
{newKind === 'person' ? <User size={14} /> : <Building2 size={14} />}
</button>
- <button
+ <Button
+ variant="cta"
+ size="md"
+ compact
type="button"
onClick={submitCreate}
disabled={!newName.trim()}
- className={cn(
- 'h-8 shrink-0 rounded-lg px-2.5 text-13 font-medium transition-colors',
- 'bg-[var(--accent-cta-bg)] text-[var(--accent-pure-cta-fg)]',
- 'disabled:cursor-not-allowed disabled:opacity-40',
- )}
>
{t('settings.contacts.list.newConfirm')}
- </button>
+ </Button>
</div>
)}
diff --git a/apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx b/apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx
index 4c4abcbdc0..731ad6f9ec 100644
--- a/apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx
@@ -6,7 +6,6 @@ import { ModelSelector } from '@/components/new-chat/ModelSelector';
import type { AgentKind } from '@/hooks/useAgentCapabilities';
import { useAvailableAgents } from '@/hooks/useAvailableAgents';
import type { MakerVendor } from '@/lib/ccAgent.types';
-import { cn } from '@/lib/utils';
import {
BOT_MODEL_CHAIN_MAX,
type BotHarness,
diff --git a/apps/desktop/src/renderer/features/plugin/AddMarketplaceDialog.tsx b/apps/desktop/src/renderer/features/plugin/AddMarketplaceDialog.tsx
index a107c0116c..3c310c7316 100644
--- a/apps/desktop/src/renderer/features/plugin/AddMarketplaceDialog.tsx
+++ b/apps/desktop/src/renderer/features/plugin/AddMarketplaceDialog.tsx
@@ -12,7 +12,6 @@ import * as Dialog from '@radix-ui/react-dialog';
import { ChevronRight } from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import { Spinner } from '@/components/ui/spinner';
import { cn } from '@/lib/utils';
import { useAuth } from '@/contexts/AuthContext';
import { extractIpcError } from '@/utils/ipcError';
diff --git a/apps/desktop/src/renderer/features/plugin/GhostPluginDetailView.tsx b/apps/desktop/src/renderer/features/plugin/GhostPluginDetailView.tsx
index 9d8249139d..55ada21317 100644
--- a/apps/desktop/src/renderer/features/plugin/GhostPluginDetailView.tsx
+++ b/apps/desktop/src/renderer/features/plugin/GhostPluginDetailView.tsx
@@ -62,7 +62,6 @@ import {
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
import { Switch } from '@/components/ui/switch';
import { toast } from '@/lib/toast';
-import { Spinner } from '@/components/ui/spinner';
import { cn } from '@/lib/utils';
import {
isOfficialGhostId,
diff --git a/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx b/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
index 4a044e66c8..82abf95cc7 100644
--- a/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
+++ b/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
@@ -65,7 +65,6 @@ import {
import { resetDraftWorkspaceTargets } from '@/state/newMakerDraft';
import { ghostInstallErrorKey } from '@/cindy-brain/installErrorKey';
import { installGhostFromFile, pickAndUpdateGhost } from '@/cindy-brain/installFlow';
-import { Spinner } from '@/components/ui/spinner';
import { SegmentedControl } from '@/components/ui/segmented-control';
import { cn } from '@/lib/utils';
import { AttentionDot } from '@/components/sidebar/AttentionDot';
@@ -2141,12 +2140,11 @@ export function MarketPluginCard({
aria-describedby={replacementDescription ? replacementDescriptionId : undefined}
className="relative z-[1] min-w-[72px] shrink-0"
>
- {!pending &&
- t(
- item.installState === 'conflict'
- ? 'settings.ghosts.market.replace'
- : 'settings.ghosts.market.install',
- )}
+ {t(
+ item.installState === 'conflict'
+ ? 'settings.ghosts.market.replace'
+ : 'settings.ghosts.market.install',
+ )}
</Button>
) : null}
</div>
@@ -2378,6 +2376,7 @@ export function GhostPluginCard({
variant="secondary"
size="sm"
compact
+ loading={updatePending}
type="button"
onClick={stopAnd(onUpdate)}
disabled={updateBusy}
@@ -2386,21 +2385,10 @@ export function GhostPluginCard({
name: item.name,
version: updateVersion,
})}
- className={cn(
- 'inline-flex h-7 min-w-[72px] items-center justify-center gap-1 rounded-full border border-[var(--border-default)] bg-[var(--surface-elevated)] px-2.5 text-11 font-medium text-[var(--text-primary)]',
- 'transition-colors duration-150 hover:bg-[var(--surface-hover-soft)]',
- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]',
- 'disabled:cursor-wait disabled:opacity-40',
- )}
+ className="min-w-[72px]"
>
- {updatePending ? (
- <Spinner size={12} />
- ) : (
- <>
- <ArrowUp size={11} className="text-[var(--text-secondary)]" aria-hidden="true" />
- {t('settings.ghosts.page.updateTo', { version: updateVersion })}
- </>
- )}
+ <ArrowUp size={11} className="text-[var(--text-secondary)]" aria-hidden="true" />
+ {t('settings.ghosts.page.updateTo', { version: updateVersion })}
</Button>
) : null}
<button
diff --git a/apps/desktop/src/renderer/features/plugin/MarketPluginDetailView.tsx b/apps/desktop/src/renderer/features/plugin/MarketPluginDetailView.tsx
index 649895da59..e9f14ad48d 100644
--- a/apps/desktop/src/renderer/features/plugin/MarketPluginDetailView.tsx
+++ b/apps/desktop/src/renderer/features/plugin/MarketPluginDetailView.tsx
@@ -99,12 +99,8 @@ export function MarketPluginDetailView({
aria-describedby={replacementDescription ? replacementDescriptionId : undefined}
className="plugin-detail-primary-action min-w-[104px] whitespace-nowrap"
>
- {!busy && (
- <>
- <Download size={15} aria-hidden="true" />
- {t(actionKey)}
- </>
- )}
+ <Download size={15} aria-hidden="true" />
+ {t(actionKey)}
</Button>
) : null}
</div>
diff --git a/apps/desktop/src/renderer/features/plugin/MarketplaceSourcesDialog.tsx b/apps/desktop/src/renderer/features/plugin/MarketplaceSourcesDialog.tsx
index a565d454ba..28c0f26397 100644
--- a/apps/desktop/src/renderer/features/plugin/MarketplaceSourcesDialog.tsx
+++ b/apps/desktop/src/renderer/features/plugin/MarketplaceSourcesDialog.tsx
@@ -12,7 +12,6 @@ import { RefreshCw, Trash2, X } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { ConfirmDialog } from '@/components/ui/confirm-dialog';
-import { Spinner } from '@/components/ui/spinner';
import { cn } from '@/lib/utils';
import { extractIpcError } from '@/utils/ipcError';
import type { MarketSourceSummary } from '../../../shared/pluginMarket';
diff --git a/apps/desktop/src/renderer/features/plugin/UpdateAllDialog.tsx b/apps/desktop/src/renderer/features/plugin/UpdateAllDialog.tsx
index a3435b2b4b..315e9b4500 100644
--- a/apps/desktop/src/renderer/features/plugin/UpdateAllDialog.tsx
+++ b/apps/desktop/src/renderer/features/plugin/UpdateAllDialog.tsx
@@ -14,7 +14,6 @@ import { useTranslation } from 'react-i18next';
import { WINDOW_NO_DRAG_STYLE } from '@/components/layout/windowDrag';
import { Spinner } from '@/components/ui/spinner';
-import { cn } from '@/lib/utils';
import { GhostPluginIcon } from './GhostPluginIcon';
import { isBatchFinished, type UpdateAllRow } from './lib/updateAllModel';
diff --git a/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginCard.test.tsx b/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginCard.test.tsx
index b8b9ed6a9c..8a092b9352 100644
--- a/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginCard.test.tsx
+++ b/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginCard.test.tsx
@@ -401,7 +401,7 @@ describe('GhostPluginCard', () => {
).toBe(true);
});
- it('replaces the update pill with a spinner while this card is pending', () => {
+ it('keeps the update label accessible while the shared button shows loading feedback', () => {
render(
<GhostPluginCard
item={commandPlugin}
@@ -419,7 +419,8 @@ describe('GhostPluginCard', () => {
});
expect(update.getAttribute('aria-busy')).toBe('true');
expect(update.querySelector('.animate-spinner')).toBeTruthy();
- expect(update.textContent).toBe('');
+ expect(update.querySelector('.opacity-0')?.textContent).toContain('settings.ghosts.page.updateTo');
+ expect((update as HTMLButtonElement).disabled).toBe(true);
});
it('sends a tool-only plugin to manage and renders no primary button', () => {
@@ -738,7 +739,8 @@ describe('MarketPluginCard', () => {
});
expect(install.getAttribute('aria-busy')).toBe('true');
expect(install.querySelector('.animate-spinner')).toBeTruthy();
- expect(install.textContent).toBe('');
+ expect(install.querySelector('.opacity-0')?.textContent).toBe('settings.ghosts.market.install');
+ expect((install as HTMLButtonElement).disabled).toBe(true);
});
});
diff --git a/apps/desktop/src/renderer/features/plugin/__tests__/MarketPluginDetailView.test.tsx b/apps/desktop/src/renderer/features/plugin/__tests__/MarketPluginDetailView.test.tsx
index 7f684a0f8d..cbfe6adbe7 100644
--- a/apps/desktop/src/renderer/features/plugin/__tests__/MarketPluginDetailView.test.tsx
+++ b/apps/desktop/src/renderer/features/plugin/__tests__/MarketPluginDetailView.test.tsx
@@ -122,6 +122,10 @@ describe('MarketPluginDetailView', () => {
});
expect(action.getAttribute('aria-busy')).toBe('true');
expect(action.querySelector('.animate-spinner')).toBeTruthy();
- expect(action.textContent).toBe('');
+ // Preserve the label width and accessible name while only the spinner is visible.
+ expect(action.firstElementChild?.classList.contains('opacity-0')).toBe(true);
+ expect(action.firstElementChild?.textContent).toBe('settings.ghosts.market.install');
+ expect(action.lastElementChild?.getAttribute('aria-hidden')).toBe('true');
+ expect(action.hasAttribute('disabled')).toBe(true);
});
});
diff --git a/apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/resource-usage.css b/apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/resource-usage.css
index 43601520e6..0d24a58de6 100644
--- a/apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/resource-usage.css
+++ b/apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/resource-usage.css
@@ -88,8 +88,7 @@
}
.resource-usage-sort-button:focus-visible,
-.resource-usage-row:focus-visible,
-.resource-usage-terminate:focus-visible {
+.resource-usage-row:focus-visible {
outline: none;
box-shadow: 0 0 0 2px var(--focus-ring);
}
@@ -236,31 +235,6 @@
white-space: nowrap;
}
-.resource-usage-terminate {
- display: inline-flex;
- min-height: 30px;
- flex: 0 0 auto;
- align-items: center;
- justify-content: center;
- border: 1px solid var(--border-default);
- border-radius: 9999px;
- background: var(--surface-elevated);
- padding: 0 12px;
- color: var(--text-primary);
- font-size: var(--text-12);
- font-weight: 500;
- transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
-}
-
-.resource-usage-terminate:hover:not(:disabled) {
- background: var(--surface-hover);
-}
-
-.resource-usage-terminate:disabled {
- cursor: default;
- opacity: 0.4;
-}
-
@container resource-usage (max-width: 359px) {
.resource-usage-grid {
grid-template-columns: minmax(0, 1fr) 48px 68px;
diff --git a/apps/desktop/src/renderer/features/right-sidebar/plugins/review/ReviewTabBody.tsx b/apps/desktop/src/renderer/features/right-sidebar/plugins/review/ReviewTabBody.tsx
index f494e0a5f5..92204617c6 100644
--- a/apps/desktop/src/renderer/features/right-sidebar/plugins/review/ReviewTabBody.tsx
+++ b/apps/desktop/src/renderer/features/right-sidebar/plugins/review/ReviewTabBody.tsx
@@ -3561,7 +3561,12 @@ export function BatchActionPill({
disabled={!writeAction.canWrite || discardAllPending}
disabledTooltip={!writeAction.canWrite ? writeAction.disabledTooltip : undefined}
onClick={writeAction.onSectionDiscard}
- className="pointer-events-auto border-transparent bg-transparent px-2 text-[var(--text-secondary)] hover:bg-[var(--surface-hover)] hover:text-[var(--text-primary)]"
+ quiet
+ className={cn(
+ 'pointer-events-auto',
+ iconOnly &&
+ 'border-transparent bg-transparent px-2 text-[var(--text-secondary)] hover:bg-[var(--surface-hover)] hover:text-[var(--text-primary)]',
+ )}
iconOnly={iconOnly}
/>
)}
@@ -3573,7 +3578,12 @@ export function BatchActionPill({
disabled={!writeAction.canWrite || allPending}
disabledTooltip={!writeAction.canWrite ? writeAction.disabledTooltip : undefined}
onClick={writeAction.onSectionAction}
- className="pointer-events-auto border-transparent bg-transparent px-2 text-[var(--text-secondary)] hover:bg-[var(--surface-hover)] hover:text-[var(--text-primary)]"
+ quiet
+ className={cn(
+ 'pointer-events-auto',
+ iconOnly &&
+ 'border-transparent bg-transparent px-2 text-[var(--text-secondary)] hover:bg-[var(--surface-hover)] hover:text-[var(--text-primary)]',
+ )}
iconOnly={iconOnly}
/>
)}
@@ -4304,6 +4314,7 @@ function ActionButton({
onClick,
className,
iconOnly = false,
+ quiet = false,
}: {
label: string;
icon: ReactNode;
@@ -4313,6 +4324,7 @@ function ActionButton({
onClick: () => void;
className?: string;
iconOnly?: boolean;
+ quiet?: boolean;
}) {
const button = iconOnly ? (
<button
@@ -4335,6 +4347,7 @@ function ActionButton({
) : (
<Button
variant="secondary"
+ tone={quiet ? 'quiet' : 'default'}
size="xs"
compact
loading={pending}
diff --git a/apps/desktop/src/renderer/features/scheduler/hooks/useDeleteScheduleWithSessions.tsx b/apps/desktop/src/renderer/features/scheduler/hooks/useDeleteScheduleWithSessions.tsx
index a3b7937c53..d014275bb0 100644
--- a/apps/desktop/src/renderer/features/scheduler/hooks/useDeleteScheduleWithSessions.tsx
+++ b/apps/desktop/src/renderer/features/scheduler/hooks/useDeleteScheduleWithSessions.tsx
@@ -6,7 +6,6 @@ import { useTranslation } from 'react-i18next';
import type { Schedule, ScheduleRun } from '@cindy/maker-scheduler';
import { cn } from '@/lib/utils';
-import { Spinner } from '@/components/ui/spinner';
import { toast } from '@/lib/toast';
import * as sessionService from '@/lib/sessionService';
import { makerChatStore } from '@/lib/makerChatStore';
diff --git a/apps/desktop/src/renderer/features/skillhub/PublishDialog.tsx b/apps/desktop/src/renderer/features/skillhub/PublishDialog.tsx
index 8a3d88c0be..bc26d1637c 100644
--- a/apps/desktop/src/renderer/features/skillhub/PublishDialog.tsx
+++ b/apps/desktop/src/renderer/features/skillhub/PublishDialog.tsx
@@ -23,7 +23,6 @@ import * as Select from '@radix-ui/react-select';
import { X, CloudUpload, Globe, Users, Lock, RefreshCw, CircleAlert, Check, ChevronDown, ChevronUp } from 'lucide-react';
import { cn } from '@/lib/utils';
-import { Spinner } from '@/components/ui/spinner';
import { toast } from '@/lib/toast';
import { useAuth } from '@/contexts/AuthContext';
import { getDataOwnerGeneration, isDataOwnerGenerationCurrent, isDataOwnerIdCurrent } from '@/contexts/dataOwnerGeneration';
@@ -1274,10 +1273,7 @@ export function PublishDialog({
{t('skillhub.publishDialog.cancelReview')}
</WhitePillButton>
)}
- <BlackPillButton disabled>
- <span className="inline-flex -translate-y-px">
- <Spinner size={14} strokeWidth={1.75} />
- </span>
+ <BlackPillButton loading={true} disabled>
{workingLabel}
</BlackPillButton>
</>
diff --git a/apps/desktop/src/renderer/features/skillhub/components/MarketInfoEditDialog.tsx b/apps/desktop/src/renderer/features/skillhub/components/MarketInfoEditDialog.tsx
index 8d4086f3eb..06edc0bf2f 100644
--- a/apps/desktop/src/renderer/features/skillhub/components/MarketInfoEditDialog.tsx
+++ b/apps/desktop/src/renderer/features/skillhub/components/MarketInfoEditDialog.tsx
@@ -10,7 +10,6 @@ import * as Dialog from '@radix-ui/react-dialog';
import { X } from 'lucide-react';
import { cn } from '@/lib/utils';
-import { Spinner } from '@/components/ui/spinner';
import { toast } from '@/lib/toast';
import { marketActionErrorMessage } from '../lib/marketErrors';
diff --git a/apps/desktop/src/renderer/features/skillhub/components/VisibilityEditorDialog.tsx b/apps/desktop/src/renderer/features/skillhub/components/VisibilityEditorDialog.tsx
index 4525735330..041f9704d8 100644
--- a/apps/desktop/src/renderer/features/skillhub/components/VisibilityEditorDialog.tsx
+++ b/apps/desktop/src/renderer/features/skillhub/components/VisibilityEditorDialog.tsx
@@ -11,7 +11,6 @@ import * as Dialog from '@radix-ui/react-dialog';
import { Globe, Lock, Users, X } from 'lucide-react';
import { cn } from '@/lib/utils';
-import { Spinner } from '@/components/ui/spinner';
import { toast } from '@/lib/toast';
import { useAuth } from '@/contexts/AuthContext';
import { useSkillhubIdentityPolicy } from '../hooks/useSkillhubIdentityPolicy';