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。

feat(plugins): 插件市场更新显性化 (#425)

xxxccea453ffeb650
diff --git a/apps/desktop/src/renderer/features/plugin/GhostPluginDetailView.tsx b/apps/desktop/src/renderer/features/plugin/GhostPluginDetailView.tsx
index 31f04be562..a0da6c50a2 100644
--- a/apps/desktop/src/renderer/features/plugin/GhostPluginDetailView.tsx
+++ b/apps/desktop/src/renderer/features/plugin/GhostPluginDetailView.tsx
@@ -68,6 +68,9 @@ interface GhostPluginDetailViewProps {
onUse: () => void;
onUpdate: () => void;
updateLabel?: string;
+ /** 市场存在新版本时的目标版本号;设置后头部展示显著的更新按钮。 */
+ updateVersion?: string;
+ updateBusy?: boolean;
onUninstall: () => void;
toggleDisabled: boolean;
}
@@ -125,6 +128,8 @@ export function GhostPluginDetailView({
onUse,
onUpdate,
updateLabel,
+ updateVersion,
+ updateBusy = false,
onUninstall,
toggleDisabled,
}: GhostPluginDetailViewProps) {
@@ -212,6 +217,21 @@ export function GhostPluginDetailView({
className="plugin-detail-actions flex shrink-0 items-center gap-3"
style={WINDOW_NO_DRAG_STYLE}
>
+ {updateVersion ? (
+ <button
+ type="button"
+ onClick={onUpdate}
+ disabled={updateBusy}
+ className={cn(
+ 'inline-flex h-10 items-center justify-center rounded-full border border-[var(--border-default)] bg-[var(--surface-elevated)] px-5 text-13 font-medium text-[var(--text-primary)]',
+ 'transition-[background-color,border-color,transform,opacity] duration-150 hover:border-[var(--text-tertiary)] hover:bg-[var(--surface-hover-soft)] active:scale-[0.98]',
+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]',
+ 'disabled:cursor-wait disabled:opacity-40 disabled:active:scale-100',
+ )}
+ >
+ {t('settings.ghosts.market.updateTo', { version: updateVersion })}
+ </button>
+ ) : null}
<button
type="button"
onClick={onUse}
@@ -250,6 +270,7 @@ export function GhostPluginDetailView({
>
<DropdownMenuItem
onSelect={onUpdate}
+ disabled={updateBusy}
className="h-10 rounded-lg px-3 text-13 focus:bg-[var(--surface-hover-soft)]"
>
{updateLabel ?? t('settings.ghosts.detail.updateFromFile')}
diff --git a/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx b/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
index 5d1b4e2b69..a1095065ea 100644
--- a/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
+++ b/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
@@ -72,7 +72,11 @@ import './plugin-motion.css';
const MAX_VISIBLE_INSTALLED_GHOSTS = 5;
type PluginPresentationFilter = 'all' | PluginPresentationOrigin;
-type PresentedGhostPluginItem = GhostPluginListItem & { origin: PluginPresentationOrigin };
+type PresentedGhostPluginItem = GhostPluginListItem & {
+ origin: PluginPresentationOrigin;
+ /** 市场存在更新时的市场记录;列表卡片据此显示更新徽标与直达入口。 */
+ marketUpdate: PluginMarketItem | null;
+};
const PRESENTATION_FILTERS: readonly PluginPresentationFilter[] = [
'all',
@@ -103,6 +107,26 @@ export function GhostPluginPage() {
const [originFilter, setOriginFilter] = useState<PluginPresentationFilter>('all');
const [marketDetail, setMarketDetail] = useState<PluginMarketDetail | null>(null);
const [marketBusyId, setMarketBusyId] = useState<string | null>(null);
+ // 市场操作的同步互斥锁。React state 在提交前有窗口期,快速连点会让多个回调
+ // 都读到 null;ref 先到先得,state 只驱动按钮禁用等 UI 展示。每次占锁都返回
+ // 唯一 lease,避免账号/模式切换后的旧异步流程误释放新流程持有的同 pluginId 锁。
+ const marketBusyLockRef = useRef<{ pluginId: string } | null>(null);
+ const acquireMarketBusy = useCallback((pluginId: string) => {
+ if (marketBusyLockRef.current !== null) return null;
+ const lease = { pluginId };
+ marketBusyLockRef.current = lease;
+ setMarketBusyId(pluginId);
+ return lease;
+ }, []);
+ const releaseMarketBusy = useCallback((lease: { pluginId: string }) => {
+ if (marketBusyLockRef.current !== lease) return;
+ marketBusyLockRef.current = null;
+ setMarketBusyId((current) => (current === lease.pluginId ? null : current));
+ }, []);
+ const isMarketBusyLeaseActive = useCallback(
+ (lease: { pluginId: string }) => marketBusyLockRef.current === lease,
+ [],
+ );
const marketRefreshRequestRef = useRef(0);
const marketDetailRequestRef = useRef(0);
const refreshMarket = useCallback(async (preserveOnError = false) => {
@@ -135,6 +159,7 @@ export function GhostPluginPage() {
useEffect(() => {
setMarketSnapshot(null);
setMarketDetail(null);
+ marketBusyLockRef.current = null;
setMarketBusyId(null);
marketDetailRequestRef.current += 1;
void refreshMarket();
@@ -218,10 +243,20 @@ export function GhostPluginPage() {
ghost.manifest.id !== 'cindy-mivo' ||
!ghosts.some((candidate) => candidate.manifest.id === 'xd-mivo'),
)
- .map((ghost) => ({
- ...toGhostPluginListItem(ghost),
- origin: pluginPresentationOrigin(marketByGhostId.get(ghost.manifest.id)),
- })),
+ .map((ghost) => {
+ const marketItem = marketByGhostId.get(ghost.manifest.id) ?? null;
+ return {
+ ...toGhostPluginListItem(ghost),
+ origin: pluginPresentationOrigin(marketItem),
+ // 迁移账本(legacy-unresolved)会让 main 把同版本 release 也判成
+ // update-available;列表入口只对版本号确实变化的更新亮牌。
+ marketUpdate:
+ marketItem?.installState === 'update-available' &&
+ marketItem.version !== ghost.manifest.version
+ ? marketItem
+ : null,
+ };
+ }),
[ghosts, marketByGhostId],
);
const installedItems = useMemo(
@@ -344,22 +379,27 @@ export function GhostPluginPage() {
[ghosts, t],
);
- const handleUpdate = useCallback(async () => {
- if (!selectedDetail) return;
- if (selectedMarketUpdate) {
- setMarketBusyId(selectedMarketUpdate.pluginId);
+ // 市场更新流程由列表卡片和详情页共用:先取目标 release 的完整 manifest 做
+ // 权限 diff,经用户确认后才安装,不做静默升级。
+ const handleMarketUpdate = useCallback(
+ async (ghostId: string) => {
+ const marketItem = marketByGhostId.get(ghostId);
+ if (!marketItem || marketItem.installState !== 'update-available') return;
+ const installedGhost = ghosts.find((ghost) => ghost.manifest.id === ghostId) ?? null;
+ // 列表每张卡都有直达入口,同步互斥防止并发更新互相覆盖忙碌状态。
+ const marketBusyLease = acquireMarketBusy(marketItem.pluginId);
+ if (!marketBusyLease) return;
try {
- const next = await window.electronAPI.pluginMarket.detail(
- selectedMarketUpdate.pluginId,
- );
+ const next = await window.electronAPI.pluginMarket.detail(marketItem.pluginId);
+ if (!isMarketBusyLeaseActive(marketBusyLease)) return;
const diff = diffGhostPermissionItems(
- selectedGhost?.manifest ?? next.manifest,
+ installedGhost?.manifest ?? next.manifest,
next.manifest,
);
const approved = await confirm({
title: t('settings.ghosts.updateConfirm.title', { name: next.name }),
description: t('settings.ghosts.updateConfirm.body', {
- from: selectedGhost?.manifest.version ?? selectedDetail.version,
+ from: installedGhost?.manifest.version ?? next.version,
to: next.version,
}),
content: <GhostPermissionDiffView diff={diff} />,
@@ -367,11 +407,11 @@ export function GhostPluginPage() {
confirmText: t('settings.ghosts.updateConfirm.confirm'),
cancelText: t('settings.ghosts.updateConfirm.cancel'),
});
- if (!approved) return;
- const result = await window.electronAPI.pluginMarket.install(
- selectedMarketUpdate.pluginId,
- { allowPermissionExpansion: diff.added.length > 0 },
- );
+ if (!approved || !isMarketBusyLeaseActive(marketBusyLease)) return;
+ const result = await window.electronAPI.pluginMarket.install(marketItem.pluginId, {
+ allowPermissionExpansion: diff.added.length > 0,
+ });
+ if (!isMarketBusyLeaseActive(marketBusyLease)) return;
toast.success(
t('settings.ghosts.toast.updated', {
name: result.ghost.manifest.name,
@@ -380,22 +420,33 @@ export function GhostPluginPage() {
);
await refreshMarket();
} catch (error) {
- toast.error(t(pluginMarketErrorKey(error)));
+ if (isMarketBusyLeaseActive(marketBusyLease)) {
+ toast.error(t(pluginMarketErrorKey(error)));
+ }
} finally {
- setMarketBusyId(null);
+ releaseMarketBusy(marketBusyLease);
}
+ },
+ [
+ acquireMarketBusy,
+ confirm,
+ ghosts,
+ isMarketBusyLeaseActive,
+ marketByGhostId,
+ refreshMarket,
+ releaseMarketBusy,
+ t,
+ ],
+ );
+
+ const handleUpdate = useCallback(async () => {
+ if (!selectedDetail) return;
+ if (selectedMarketUpdate) {
+ await handleMarketUpdate(selectedDetail.id);
return;
}
await pickAndUpdateGhost(selectedDetail.id, { t, confirm, confirmWithCheckbox });
- }, [
- confirm,
- confirmWithCheckbox,
- refreshMarket,
- selectedDetail,
- selectedGhost,
- selectedMarketUpdate,
- t,
- ]);
+ }, [confirm, confirmWithCheckbox, handleMarketUpdate, selectedDetail, selectedMarketUpdate, t]);
const handleInstall = useCallback(async () => {
const picked = await window.electronAPI.ghosts.pickFile().catch(() => null);
@@ -508,20 +559,30 @@ export function GhostPluginPage() {
const handleSelectMarket = useCallback(
async (pluginId: string) => {
+ // 与 handleMarketUpdate 共用同一互斥锁:更新进行中不叠加其它市场操作。
+ const marketBusyLease = acquireMarketBusy(pluginId);
+ if (!marketBusyLease) return;
const requestId = ++marketDetailRequestRef.current;
- setMarketBusyId(pluginId);
try {
const detail = await window.electronAPI.pluginMarket.detail(pluginId);
- if (requestId === marketDetailRequestRef.current) setMarketDetail(detail);
+ if (
+ requestId === marketDetailRequestRef.current &&
+ isMarketBusyLeaseActive(marketBusyLease)
+ ) {
+ setMarketDetail(detail);
+ }
} catch (error) {
- if (requestId === marketDetailRequestRef.current) {
+ if (
+ requestId === marketDetailRequestRef.current &&
+ isMarketBusyLeaseActive(marketBusyLease)
+ ) {
toast.error(t(pluginMarketErrorKey(error)));
}
} finally {
- if (requestId === marketDetailRequestRef.current) setMarketBusyId(null);
+ releaseMarketBusy(marketBusyLease);
}
},
- [t],
+ [acquireMarketBusy, isMarketBusyLeaseActive, releaseMarketBusy, t],
);
const refreshVisibleMarketDetail = useCallback(async (pluginId: string) => {
@@ -555,19 +616,23 @@ export function GhostPluginPage() {
const handleInstallFromMarket = useCallback(async () => {
if (!marketDetail) return;
- const confirmed = await confirm({
- title: t('settings.ghosts.market.installConfirmTitle', {
- name: marketDetail.name,
- }),
- description: t('settings.ghosts.market.installConfirmDescription'),
- confirmText: t('settings.ghosts.market.install'),
- cancelText: t('settings.ghosts.installConfirm.cancel'),
- autoFocusConfirm: true,
- });
- if (!confirmed) return;
- setMarketBusyId(marketDetail.pluginId);
+ // 确认框等待期间也持有 lease。账号/模式切换会清除当前 lease,
+ // 旧确认回调恢复后必须先验权,不能在新会话里继续安装。
+ const marketBusyLease = acquireMarketBusy(marketDetail.pluginId);
+ if (!marketBusyLease) return;
try {
+ const confirmed = await confirm({
+ title: t('settings.ghosts.market.installConfirmTitle', {
+ name: marketDetail.name,
+ }),
+ description: t('settings.ghosts.market.installConfirmDescription'),
+ confirmText: t('settings.ghosts.market.install'),
+ cancelText: t('settings.ghosts.installConfirm.cancel'),
+ autoFocusConfirm: true,
+ });
+ if (!confirmed || !isMarketBusyLeaseActive(marketBusyLease)) return;
const result = await window.electronAPI.pluginMarket.install(marketDetail.pluginId);
+ if (!isMarketBusyLeaseActive(marketBusyLease)) return;
toast.success(
t('settings.ghosts.toast.installedAsleep', {
name: result.ghost.manifest.name,
@@ -577,11 +642,21 @@ export function GhostPluginPage() {
setSelectedId(result.ghost.manifest.id);
await refreshMarket();
} catch (error) {
- toast.error(t(pluginMarketErrorKey(error)));
+ if (isMarketBusyLeaseActive(marketBusyLease)) {
+ toast.error(t(pluginMarketErrorKey(error)));
+ }
} finally {
- setMarketBusyId(null);
+ releaseMarketBusy(marketBusyLease);
}
- }, [confirm, marketDetail, refreshMarket, t]);
+ }, [
+ acquireMarketBusy,
+ confirm,
+ isMarketBusyLeaseActive,
+ marketDetail,
+ refreshMarket,
+ releaseMarketBusy,
+ t,
+ ]);
if (marketDetail) {
return (
@@ -618,6 +693,12 @@ export function GhostPluginPage() {
? t('settings.ghosts.market.update')
: undefined
}
+ updateVersion={
+ selectedMarketUpdate && selectedMarketUpdate.version !== selectedDetail.version
+ ? selectedMarketUpdate.version
+ : undefined
+ }
+ updateBusy={selectedMarketUpdate !== null && marketBusyId !== null}
onUninstall={() => void handleUninstall()}
toggleDisabled={scopeDir !== null && selectedGhost !== null && !selectedGhost.enabled}
/>
@@ -810,6 +891,11 @@ export function GhostPluginPage() {
sourceLabel={t(`settings.ghosts.page.origin.${item.origin}`)}
onSelect={() => setSelectedId(item.id)}
onAction={() => void handleUseGhost(item.id)}
+ updateVersion={item.marketUpdate?.version}
+ updateBusy={item.marketUpdate !== null && marketBusyId !== null}
+ onUpdate={
+ item.marketUpdate ? () => void handleMarketUpdate(item.id) : undefined
+ }
effectiveEnabled={effectiveEnabled(item.id, item.enabled)}
toggleDisabled={scopeDir !== null && !item.enabled}
onToggle={(enabled) => void handleToggle(item.id, enabled)}
@@ -819,7 +905,7 @@ export function GhostPluginPage() {
<MarketPluginCard
key={item.pluginId}
item={item}
- busy={marketBusyId === item.pluginId}
+ busy={marketBusyId !== null}
onSelect={() => void handleSelectMarket(item.pluginId)}
onIconLoadError={handleMarketIconLoadError}
/>
@@ -1003,6 +1089,9 @@ export function GhostPluginCard({
sourceLabel,
onSelect,
onAction,
+ onUpdate,
+ updateVersion,
+ updateBusy = false,
onToggle,
effectiveEnabled,
toggleDisabled = false,
@@ -1011,6 +1100,10 @@ export function GhostPluginCard({
sourceLabel?: string;
onSelect: () => void;
onAction: () => void;
+ /** 市场存在新版本时的直达更新入口;与 updateVersion 同时提供。 */
+ onUpdate?: () => void;
+ updateVersion?: string;
+ updateBusy?: boolean;
onToggle?: (enabled: boolean) => void;
effectiveEnabled?: boolean;
toggleDisabled?: boolean;
@@ -1035,8 +1128,15 @@ export function GhostPluginCard({
>
<GhostPluginIcon iconDataUrl={item.iconDataUrl} iconId={item.id} iconName={item.name} />
<span className="flex min-w-0 flex-1 flex-col self-stretch pt-0.5">
- <span className="truncate text-15 font-medium text-[var(--text-primary)]">
- {item.name}
+ <span className="flex min-w-0 items-center gap-2">
+ <span className="truncate text-15 font-medium text-[var(--text-primary)]">
+ {item.name}
+ </span>
+ {updateVersion ? (
+ <span className="shrink-0 rounded-full bg-[var(--surface-chip)] px-2 py-0.5 text-10 font-medium leading-4 text-[var(--text-secondary)]">
+ {t('settings.ghosts.market.updateAvailable')}
+ </span>
+ ) : null}
</span>
<span className="mt-1 flex min-w-0 items-center gap-1.5 text-11 text-[var(--text-tertiary)]">
{sourceLabel ? (
@@ -1063,21 +1163,39 @@ export function GhostPluginCard({
aria-label={t('settings.ghosts.enableAria', { name: item.name })}
/>
) : null}
- <button
- type="button"
- onClick={onAction}
- disabled={!(effectiveEnabled ?? item.enabled) || !item.canUse}
- className={cn(
- 'inline-flex h-8 shrink-0 items-center justify-center self-center rounded-lg border border-[var(--border-default)] bg-transparent px-3 text-12 font-medium text-[var(--text-primary)]',
- 'transition-[background-color,border-color,transform,opacity] duration-150',
- 'hover:border-[var(--text-tertiary)] hover:bg-[var(--surface-hover-soft)] active:scale-[0.98]',
- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]',
- 'disabled:cursor-not-allowed disabled:opacity-40 disabled:active:scale-100',
- )}
- aria-label={t('settings.ghosts.page.useAria', { name: item.name })}
- >
- {t('settings.ghosts.page.useAction')}
- </button>
+ {updateVersion && onUpdate ? (
+ <button
+ type="button"
+ onClick={onUpdate}
+ disabled={updateBusy}
+ className={cn(
+ 'inline-flex h-8 shrink-0 items-center justify-center self-center rounded-lg border border-[var(--border-default)] bg-transparent px-3 text-12 font-medium text-[var(--text-primary)]',
+ 'transition-[background-color,border-color,transform,opacity] duration-150',
+ 'hover:border-[var(--text-tertiary)] hover:bg-[var(--surface-hover-soft)] active:scale-[0.98]',
+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]',
+ 'disabled:cursor-wait disabled:opacity-40 disabled:active:scale-100',
+ )}
+ aria-label={t('settings.ghosts.market.updateAria', { name: item.name })}
+ >
+ {t('settings.ghosts.market.updateAction')}
+ </button>
+ ) : (
+ <button
+ type="button"
+ onClick={onAction}
+ disabled={!(effectiveEnabled ?? item.enabled) || !item.canUse}
+ className={cn(
+ 'inline-flex h-8 shrink-0 items-center justify-center self-center rounded-lg border border-[var(--border-default)] bg-transparent px-3 text-12 font-medium text-[var(--text-primary)]',
+ 'transition-[background-color,border-color,transform,opacity] duration-150',
+ 'hover:border-[var(--text-tertiary)] hover:bg-[var(--surface-hover-soft)] active:scale-[0.98]',
+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]',
+ 'disabled:cursor-not-allowed disabled:opacity-40 disabled:active:scale-100',
+ )}
+ aria-label={t('settings.ghosts.page.useAria', { name: item.name })}
+ >
+ {t('settings.ghosts.page.useAction')}
+ </button>
+ )}
</div>
</article>
);
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 11bb0c1a53..205327a5e2 100644
--- a/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginCard.test.tsx
+++ b/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginCard.test.tsx
@@ -58,6 +58,56 @@ describe('GhostPluginCard', () => {
expect(onAction).not.toHaveBeenCalled();
});
+ it('surfaces the market update state with a badge and a direct update action', () => {
+ const onAction = vi.fn();
+ const onUpdate = vi.fn();
+ render(
+ <GhostPluginCard
+ item={installedPlugin}
+ onSelect={vi.fn()}
+ onAction={onAction}
+ onUpdate={onUpdate}
+ updateVersion="1.1.1"
+ />,
+ );
+
+ expect(screen.getByText('settings.ghosts.market.updateAvailable')).toBeTruthy();
+ // Metadata keeps only the installed version; the pending version stays out of
+ // the crowded metadata row (surfaced by the badge and the detail header instead).
+ expect(screen.getByText('v1.0.0')).toBeTruthy();
+ expect(screen.queryByText('v1.1.1')).toBeNull();
+
+ const updateButton = screen.getByRole('button', {
+ name: 'settings.ghosts.market.updateAria',
+ });
+ fireEvent.click(updateButton);
+ expect(onUpdate).toHaveBeenCalledTimes(1);
+ expect(onAction).not.toHaveBeenCalled();
+ // The direct Use entry is replaced by Update while a new release is pending.
+ expect(screen.queryByRole('button', { name: 'settings.ghosts.page.useAria' })).toBeNull();
+ });
+
+ it('keeps the update action interactive while Use is locked, and blocks it when busy', () => {
+ const onUpdate = vi.fn();
+ render(
+ <GhostPluginCard
+ item={{ ...installedPlugin, enabled: false, canUse: false }}
+ onSelect={vi.fn()}
+ onAction={vi.fn()}
+ onUpdate={onUpdate}
+ updateVersion="1.1.1"
+ updateBusy
+ />,
+ );
+
+ const updateButton = screen.getByRole('button', {
+ name: 'settings.ghosts.market.updateAria',
+ }) as HTMLButtonElement;
+ expect(updateButton.disabled).toBe(true);
+ fireEvent.click(updateButton);
+ expect(onUpdate).not.toHaveBeenCalled();
+ });
+
it('disables Use when an installed plugin has no command', () => {
render(
<GhostPluginCard
diff --git a/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginDetailSections.test.tsx b/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginDetailSections.test.tsx
index b47c2c2120..4afcfa7cfa 100644
--- a/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginDetailSections.test.tsx
+++ b/apps/desktop/src/renderer/features/plugin/__tests__/GhostPluginDetailSections.test.tsx
@@ -157,6 +157,49 @@ describe('Ghost plugin detail sections', () => {
expect(backButton?.className).toContain('-ml-3');
});
+ it('disables every market update entry while an update is busy', async () => {
+ vi.stubGlobal(
+ 'ResizeObserver',
+ class {
+ observe() {}
+ unobserve() {}
+ disconnect() {}
+ },
+ );
+ const onUpdate = vi.fn();
+
+ render(
+ <GhostPluginDetailView
+ ghost={null}
+ detail={detail}
+ panelStatus="Docked"
+ onBack={vi.fn()}
+ onToggle={vi.fn()}
+ onUse={vi.fn()}
+ onUpdate={onUpdate}
+ updateLabel="Update from market"
+ updateVersion="1.2.4"
+ updateBusy
+ onUninstall={vi.fn()}
+ toggleDisabled={false}
+ />,
+ );
+
+ expect(
+ (screen.getByRole('button', {
+ name: 'settings.ghosts.market.updateTo',
+ }) as HTMLButtonElement).disabled,
+ ).toBe(true);
+ fireEvent.pointerDown(
+ screen.getByRole('button', { name: 'settings.ghosts.detail.moreActions' }),
+ { button: 0, ctrlKey: false },
+ );
+ const menuUpdate = screen.getByRole('menuitem', { name: 'Update from market' });
+ expect(menuUpdate.getAttribute('aria-disabled')).toBe('true');
+ fireEvent.click(menuUpdate);
+ expect(onUpdate).not.toHaveBeenCalled();
+ });
+
it('uses one metadata color and orders author, then version', () => {
const { container } = render(<GhostPluginMetadata author="Cindy" version="1.1.4" />);
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index 7def7936e3..4da146f071 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -2279,6 +2279,10 @@
"install": "Install",
"details": "Details",
"update": "Update from market",
+ "updateAvailable": "Update available",
+ "updateAction": "Update",
+ "updateAria": "Update {{name}}",
+ "updateTo": "Update to v{{version}}",
"installed": "Installed",
"conflict": "Plugin ID conflict",
"unavailable": "The plugin market is temporarily unavailable. Installed plugins remain available.",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index 7f70ce0eb3..72e9d0a371 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -2278,6 +2278,10 @@
"install": "インストール",
"details": "詳細",
"update": "マーケットから更新",
+ "updateAvailable": "更新あり",
+ "updateAction": "更新",
+ "updateAria": "{{name}}を更新",
+ "updateTo": "v{{version}} に更新",
"installed": "インストール済み",
"conflict": "プラグイン ID の競合",
"unavailable": "プラグインマーケットを一時的に利用できません。インストール済みプラグインは引き続き利用できます。",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index f90bc3479d..28cec1506c 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -2278,6 +2278,10 @@
"install": "설치",
"details": "상세",
"update": "마켓에서 업데이트",
+ "updateAvailable": "업데이트 가능",
+ "updateAction": "업데이트",
+ "updateAria": "{{name}} 업데이트",
+ "updateTo": "v{{version}}(으)로 업데이트",
"installed": "설치됨",
"conflict": "플러그인 ID 충돌",
"unavailable": "플러그인 마켓을 일시적으로 사용할 수 없습니다. 설치된 플러그인은 계속 사용할 수 있습니다.",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index 5c9e9df5da..ec75d62885 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -2278,6 +2278,10 @@
"install": "安装",
"details": "详情",
"update": "从市场更新",
+ "updateAvailable": "可更新",
+ "updateAction": "更新",
+ "updateAria": "更新 {{name}}",
+ "updateTo": "更新到 v{{version}}",
"installed": "已安装",
"conflict": "插件标识冲突",
"unavailable": "插件市场暂时不可用;已安装插件仍可正常管理和使用。",