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: address review — 批次账号世代绑定/入口保底/单项收束/装入面板迁移/Spinner 规范

Chris684045febcc8
diff --git a/apps/desktop/src/main/right-sidebar-window/__tests__/ipc.test.ts b/apps/desktop/src/main/right-sidebar-window/__tests__/ipc.test.ts
index 16ec15ca05..172a352106 100644
--- a/apps/desktop/src/main/right-sidebar-window/__tests__/ipc.test.ts
+++ b/apps/desktop/src/main/right-sidebar-window/__tests__/ipc.test.ts
@@ -227,36 +227,6 @@ describe('right-sidebar-window IPC', () => {
).rejects.toThrow(/command.absPath required/);
});
- it('validates and forwards open-ghost-tab commands (ghostId 走身份卡同一校验)', async () => {
- const controller = makeController();
- const { handler, mainWebContents } = registerController(controller);
-
- await handler(
- { sender: mainWebContents },
- {
- command: { type: 'open-ghost-tab', sessionId: 's1', ghostId: 'tab-demo-a' },
- allowOpen: true,
- },
- );
- expect(controller.routeCommand).toHaveBeenCalledWith({
- command: { type: 'open-ghost-tab', sessionId: 's1', ghostId: 'tab-demo-a' },
- allowOpen: true,
- });
-
- // 野值(路径穿越形状 / 缺失)进不了命令通道。
- for (const ghostId of ['../escape', 'UPPER', '', undefined]) {
- await expect(
- handler(
- { sender: mainWebContents },
- {
- command: { type: 'open-ghost-tab', sessionId: 's1', ghostId },
- allowOpen: true,
- },
- ),
- ).rejects.toThrow(/ghostId/);
- }
- });
-
it('drops commands from secondary renderers but still validates their payloads', async () => {
const controller = makeController();
const { handler } = registerController(controller);
diff --git a/apps/desktop/src/main/right-sidebar-window/ipc.ts b/apps/desktop/src/main/right-sidebar-window/ipc.ts
index 0e4c7e5312..5a2c777586 100644
--- a/apps/desktop/src/main/right-sidebar-window/ipc.ts
+++ b/apps/desktop/src/main/right-sidebar-window/ipc.ts
@@ -18,7 +18,6 @@ import type {
RsbWindowContext,
} from '../../shared/rightSidebarWindow.js';
import { parseConversationSearchJump } from '../../shared/conversationSearchJump.js';
-import { isValidGhostId } from '../../shared/ghost.js';
import type { RsbWindowController } from './controller.js';
const log = createLogger('right-sidebar-window-ipc');
@@ -55,13 +54,6 @@ function parseCommand(raw: unknown): RsbWindowCommand {
}
return { type: 'open-web-browser', sessionId: r.sessionId, url: r.url };
}
- if (r.type === 'open-ghost-tab') {
- // ghostId 复用身份卡同一校验(小写/数字/连字符,1–32),野值不进命令通道。
- if (!isValidGhostId(r.ghostId)) {
- throwIpcError('INVALID_PARAMS', 'command.ghostId must be a valid ghost id');
- }
- return { type: 'open-ghost-tab', sessionId: r.sessionId, ghostId: r.ghostId };
- }
if (r.type === 'ensure-orca-workers-tab') {
const hasFocusWorkerSessionId =
Object.prototype.hasOwnProperty.call(r, 'focusWorkerSessionId') &&
diff --git a/apps/desktop/src/renderer/cindy-brain/__tests__/installFlow.test.tsx b/apps/desktop/src/renderer/cindy-brain/__tests__/installFlow.test.tsx
index 73b1d77288..78d3bcc705 100644
--- a/apps/desktop/src/renderer/cindy-brain/__tests__/installFlow.test.tsx
+++ b/apps/desktop/src/renderer/cindy-brain/__tests__/installFlow.test.tsx
@@ -8,13 +8,10 @@ import { confirmAndInstallGhost } from '../installFlow';
vi.mock('@/lib/toast', () => ({
toast: { success: vi.fn(), error: vi.fn() },
}));
-// node 环境无 window:logger 与真实的开页签实现(拉起 right-sidebar store 链)都桩掉。
+// node 环境无 window:logger 桩掉。
vi.mock('@/lib/logger', () => ({
createLogger: () => ({ debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn() }),
}));
-vi.mock('../../features/right-sidebar/lib/openGhostTabInSidebar', () => ({
- openGhostTabInSidebar: vi.fn(async () => undefined),
-}));
const baseManifest = {
schemaVersion: 2 as const,
@@ -98,7 +95,7 @@ describe('installFlow · 装入确认', () => {
});
});
-describe('installFlow · tab 型插件「立即开启并打开页签」', () => {
+describe('installFlow · tab 型插件「立即开启并打开面板」', () => {
const tabManifest = {
schemaVersion: 2 as const,
id: 'tab-demo-a',
@@ -112,8 +109,7 @@ describe('installFlow · tab 型插件「立即开启并打开页签」', () =>
function tabDeps(overrides: {
checked?: boolean;
- sessionId?: string | null;
- openGhostTab?: (sessionId: string, ghostId: string) => Promise<void>;
+ openPluginPanel?: (ghostId: string) => void;
}) {
const confirmWithCheckbox = vi.fn(async () => ({
ok: true,
@@ -124,25 +120,22 @@ describe('installFlow · tab 型插件「立即开启并打开页签」', () =>
t: ((key: string) => key) as never,
confirm: vi.fn(async () => true),
confirmWithCheckbox,
- ...(overrides.sessionId !== undefined
- ? { getSidebarSessionId: () => overrides.sessionId ?? null }
- : {}),
- ...(overrides.openGhostTab ? { openGhostTab: overrides.openGhostTab } : {}),
+ ...(overrides.openPluginPanel ? { openPluginPanel: overrides.openPluginPanel } : {}),
},
confirmWithCheckbox,
};
}
- it('tab 清单 + 有会话 + 勾选 → enable 装入并打开 ghost:<id> 页签,勾选文案换 open 版', async () => {
+ it('tab 清单 + 勾选 → enable 装入并打开插件页面板,勾选文案换 openPanel 版', async () => {
const { install } = setupWindow(tabManifest);
- const openGhostTab = vi.fn(async () => undefined);
- const { deps: d, confirmWithCheckbox } = tabDeps({ sessionId: 's1', openGhostTab });
+ const openPluginPanel = vi.fn();
+ const { deps: d, confirmWithCheckbox } = tabDeps({ openPluginPanel });
await confirmAndInstallGhost('/tmp/tab.cindy', d);
expect(confirmWithCheckbox).toHaveBeenCalledWith(
expect.objectContaining({
- checkboxLabel: 'settings.ghosts.installConfirm.enableNowOpenTab',
+ checkboxLabel: 'settings.ghosts.installConfirm.enableNowOpenPanel',
// 2026-07-25 起"立即开启"默认勾选:装入即带电,取消勾选才沉睡。
checkboxDefaultChecked: true,
}),
@@ -151,43 +144,38 @@ describe('installFlow · tab 型插件「立即开启并打开页签」', () =>
enable: true,
expectedPackageSha256: 'a'.repeat(64),
});
- expect(openGhostTab).toHaveBeenCalledWith('s1', 'tab-demo-a');
+ expect(openPluginPanel).toHaveBeenCalledWith('tab-demo-a');
expect(toast.success).toHaveBeenCalledTimes(1);
});
- it('不勾选 → 沉睡装入,不打开页签', async () => {
+ it('不勾选 → 沉睡装入,不打开面板', async () => {
setupWindow(tabManifest);
- const openGhostTab = vi.fn(async () => undefined);
- const { deps: d } = tabDeps({ checked: false, sessionId: 's1', openGhostTab });
+ const openPluginPanel = vi.fn();
+ const { deps: d } = tabDeps({ checked: false, openPluginPanel });
await confirmAndInstallGhost('/tmp/tab.cindy', d);
- expect(openGhostTab).not.toHaveBeenCalled();
+ expect(openPluginPanel).not.toHaveBeenCalled();
});
- it('无会话入口(getter 缺省/返回 null)→ 勾选文案保持旧版,勾了也不打开', async () => {
+ it('入口未提供 openPluginPanel → 勾选文案保持旧版,不许诺打开', async () => {
setupWindow(tabManifest);
- const openGhostTab = vi.fn(async () => undefined);
+ const { deps: d, confirmWithCheckbox } = tabDeps({});
+
+ await confirmAndInstallGhost('/tmp/tab.cindy', d);
- const noGetter = tabDeps({ openGhostTab });
- await confirmAndInstallGhost('/tmp/tab.cindy', noGetter.deps);
- expect(noGetter.confirmWithCheckbox).toHaveBeenCalledWith(
+ expect(confirmWithCheckbox).toHaveBeenCalledWith(
expect.objectContaining({ checkboxLabel: 'settings.ghosts.installConfirm.enableNow' }),
);
-
- const nullGetter = tabDeps({ sessionId: null, openGhostTab });
- await confirmAndInstallGhost('/tmp/tab.cindy', nullGetter.deps);
-
- expect(openGhostTab).not.toHaveBeenCalled();
});
- it('停靠形态(position: left)勾选只带电,不打开页签', async () => {
+ it('停靠形态(position: left)勾选只带电,不打开面板', async () => {
setupWindow({
...tabManifest,
panel: { html: 'panel.html', position: 'left' as const },
});
- const openGhostTab = vi.fn(async () => undefined);
- const { deps: d, confirmWithCheckbox } = tabDeps({ sessionId: 's1', openGhostTab });
+ const openPluginPanel = vi.fn();
+ const { deps: d, confirmWithCheckbox } = tabDeps({ openPluginPanel });
await confirmAndInstallGhost('/tmp/dock.cindy', d);
@@ -197,42 +185,6 @@ describe('installFlow · tab 型插件「立即开启并打开页签」', () =>
checkboxDefaultChecked: true,
}),
);
- expect(openGhostTab).not.toHaveBeenCalled();
- });
-
- it('打开页签失败只记日志:装入成功 toast 不改口、不冒错误', async () => {
- setupWindow(tabManifest);
- const openGhostTab = vi.fn(async () => {
- throw new Error('sidebar exploded');
- });
- const { deps: d } = tabDeps({ sessionId: 's1', openGhostTab });
-
- await confirmAndInstallGhost('/tmp/tab.cindy', d);
-
- expect(toast.success).toHaveBeenCalledTimes(1);
- expect(toast.error).not.toHaveBeenCalled();
- });
-
- it('安装期间切换会话(getter 变 null)→ 不打开页签(避免写入旧会话)', async () => {
- setupWindow(tabManifest);
- const openGhostTab = vi.fn(async () => undefined);
- let currentSession: string | null = 's1';
- const confirmWithCheckbox = vi.fn(async () => {
- // 模拟用户在确认弹窗期间切走会话
- currentSession = null;
- return { ok: true, checked: true };
- });
- const deps = {
- t: ((key: string) => key) as never,
- confirm: vi.fn(async () => true),
- confirmWithCheckbox,
- getSidebarSessionId: () => currentSession,
- openGhostTab,
- };
-
- await confirmAndInstallGhost('/tmp/tab.cindy', deps);
-
- expect(openGhostTab).not.toHaveBeenCalled();
- expect(toast.success).toHaveBeenCalledTimes(1);
+ expect(openPluginPanel).not.toHaveBeenCalled();
});
});
diff --git a/apps/desktop/src/renderer/cindy-brain/installFlow.tsx b/apps/desktop/src/renderer/cindy-brain/installFlow.tsx
index fc0a5df0b3..016bca4e54 100644
--- a/apps/desktop/src/renderer/cindy-brain/installFlow.tsx
+++ b/apps/desktop/src/renderer/cindy-brain/installFlow.tsx
@@ -1,7 +1,6 @@
import type { TFunction } from 'i18next';
import type { ReactNode } from 'react';
-import { createLogger } from '@/lib/logger';
import { toast } from '@/lib/toast';
import { extractIpcError } from '@/utils/ipcError';
import {
@@ -11,7 +10,6 @@ import {
type GhostTrustInfo,
type InstalledGhost,
} from '../../shared/ghost';
-import { openGhostTabInSidebar } from '../features/right-sidebar/lib/openGhostTabInSidebar';
import { GhostInstallReview, GhostUpdateReview } from './GhostPermissionList';
import { ghostInstallErrorKey } from './installErrorKey';
@@ -57,19 +55,16 @@ interface InstallFlowDeps {
checkboxDefaultChecked?: boolean;
}) => Promise<{ ok: boolean; checked: boolean }>;
/**
- * 当前右侧栏会话 id;无会话视图的入口(插件页)不传或返回 null。
- * 只在「tab 型插件 + 勾选立即开启」时消费:装完自动展开右侧栏并打开页签。
+ * 打开插件页内的页签面板(面板收束后 tab 型插件的唯一宿主)。只在
+ * 「tab 型插件 + 勾选立即开启」时消费:插件页原地开面板,其它入口
+ * 导航到 /plugins?panel=<id>。不传 = 该入口不许诺"打开"。
*/
- getSidebarSessionId?: () => string | null;
- /** 打开/聚焦插件页签;缺省 openGhostTabInSidebar,测试注入用。 */
- openGhostTab?: (sessionId: string, ghostId: string) => Promise<void>;
+ openPluginPanel?: (ghostId: string) => void;
}
/** 意识装入/更新确认框统一宽度:权限清单是富内容,默认 400px 折行到累。 */
const GHOST_CONFIRM_MAX_WIDTH = 520;
-const installFlowLog = createLogger('ghost-install-flow');
-
/** 同 id 已装清单查询(sendSync,极小)。 */
function findInstalled(id: string): InstalledGhost | null {
try {
@@ -160,10 +155,10 @@ export async function confirmAndInstallGhost(
// "立即开启"勾选(2026-07-25 Lizi 定案,改自 2026-07-09 的默认不勾):
// 默认勾选 = 装入即带电;用户显式取消勾选才装成沉睡。确认弹窗本身
// 仍是授权边界 —— 权限清单如实展示,点"装入"即同意运行。
- // tab 型插件(panel.position:'tab')在有会话可落时,勾选语义升级为
- // 「立即开启并打开页签」——文案与真实行为一致,无会话入口不许诺"打开"。
- const sidebarSessionId = deps.getSidebarSessionId?.() ?? null;
- const willOpenTab = manifest.panel?.position === 'tab' && sidebarSessionId !== null;
+ // tab 型插件(panel.position:'tab')在入口能打开插件页面板时,勾选语义
+ // 升级为「立即开启并打开面板」——面板收束后页签面板只住在插件页,
+ // 不再创建右侧栏 ghost 页签;入口给不出面板宿主就不许诺"打开"。
+ const willOpenPanel = manifest.panel?.position === 'tab' && deps.openPluginPanel !== undefined;
const { ok, checked: enable } = await confirmWithCheckbox({
title: t('settings.ghosts.installConfirm.title', { name: manifest.name }),
content: (
@@ -178,8 +173,8 @@ export async function confirmAndInstallGhost(
confirmText: t('settings.ghosts.installConfirm.confirm'),
cancelText: t('settings.ghosts.installConfirm.cancel'),
checkboxLabel: t(
- willOpenTab
- ? 'settings.ghosts.installConfirm.enableNowOpenTab'
+ willOpenPanel
+ ? 'settings.ghosts.installConfirm.enableNowOpenPanel'
: 'settings.ghosts.installConfirm.enableNow',
),
checkboxDefaultChecked: true,
@@ -198,26 +193,9 @@ export async function confirmAndInstallGhost(
? t('settings.ghosts.toast.installed', { name: ghost.manifest.name })
: t('settings.ghosts.toast.installedAsleep', { name: ghost.manifest.name }),
);
- if (enable && willOpenTab) {
- // 兑现勾选文案:展开右侧栏并打开/聚焦页签(侧栏抽离时路由到子窗口)。
- // main 在 install() resolve 前已广播 ghosts:changed,Tab 注册表通常已就位;
- // 极端竞态下 Shell 的 PlaceholderBody 兜底,注册到位即自愈。
- // 打开失败不回滚安装,只记日志——装入本身已成功,toast 不改口。
- // 重新读取会话 ID——用户可能在确认弹窗/安装期间切换了会话,
- // 用安装完成时的当前会话,而非弹窗出现时的快照。
- const currentSessionId = deps.getSidebarSessionId?.() ?? null;
- if (currentSessionId !== null) {
- const openGhostTab = deps.openGhostTab ?? openGhostTabInSidebar;
- try {
- await openGhostTab(currentSessionId, ghost.manifest.id);
- } catch (err) {
- installFlowLog.warn('open ghost tab after install failed', {
- ghostId: ghost.manifest.id,
- sessionId: currentSessionId,
- err,
- });
- }
- }
+ if (enable && willOpenPanel) {
+ // 兑现勾选文案:进入插件页并打开该插件的页签面板。
+ deps.openPluginPanel?.(ghost.manifest.id);
}
} catch (err) {
toast.error(t(ghostInstallErrorKey(extractIpcError(err)?.code)));
diff --git a/apps/desktop/src/renderer/components/layout/GlobalDropImportListener.tsx b/apps/desktop/src/renderer/components/layout/GlobalDropImportListener.tsx
index dd0898ab73..751be6e7b0 100644
--- a/apps/desktop/src/renderer/components/layout/GlobalDropImportListener.tsx
+++ b/apps/desktop/src/renderer/components/layout/GlobalDropImportListener.tsx
@@ -29,7 +29,7 @@
* 影响)。window 级 dragover 必须 preventDefault,否则 drop 事件不触发且
* Electron 会尝试导航到文件 URL。
*/
-import { useEffect, useRef, useState } from 'react';
+import { useCallback, useEffect, useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
@@ -49,17 +49,10 @@ type DragHint = 'cindy' | 'share';
export interface GlobalDropImportListenerProps {
onOpenShareImport: (filePath: string) => void;
- /**
- * 当前右侧栏会话 id 的 getter(MainLayout 的 rightSidebarSessionIdRef 读值,
- * prop 身份稳定)。装入 tab 型插件勾选「立即开启」时用来自动打开页签;
- * 无会话视图返回 null = 跳过自动打开。
- */
- getRightSidebarSessionId?: () => string | null;
}
export function GlobalDropImportListener({
onOpenShareImport,
- getRightSidebarSessionId,
}: GlobalDropImportListenerProps) {
const [dragHint, setDragHint] = useState<DragHint | null>(null);
const dragDepthRef = useRef(0);
@@ -69,6 +62,12 @@ export function GlobalDropImportListener({
const navigate = useNavigate();
const { t } = useTranslation();
const { confirm, confirmWithCheckbox } = useConfirmDialog();
+ // 装入 tab 型插件勾选「立即开启并打开面板」的兑现:面板收束后页签面板
+ // 只住在插件页,从任意视图导航过去并经 ?panel= 深链打开。
+ const openPluginPanel = useCallback(
+ (ghostId: string) => navigate(`/plugins?panel=${encodeURIComponent(ghostId)}`),
+ [navigate],
+ );
// 双击 .cindy 的转交消费:挂载时取一次(冷启动双击,main 已缓存)+ 订阅
// 信号(已运行时双击)。取到路径即走与按钮/拖入完全相同的确认装入编排。
@@ -80,7 +79,7 @@ export function GlobalDropImportListener({
t,
confirm,
confirmWithCheckbox,
- getSidebarSessionId: getRightSidebarSessionId,
+ openPluginPanel,
});
}
};
@@ -88,7 +87,7 @@ export function GlobalDropImportListener({
return window.electronAPI.ghosts.onInstallRequested(() => {
void consumePending().catch((err) => log.warn('consume pending cindy install failed', err));
});
- }, [confirm, confirmWithCheckbox, getRightSidebarSessionId, t]);
+ }, [confirm, confirmWithCheckbox, openPluginPanel, t]);
useEffect(() => {
// 悬停识别:单文件且 MIME 命中才给遮罩。
@@ -152,7 +151,7 @@ export function GlobalDropImportListener({
t,
confirm,
confirmWithCheckbox,
- getSidebarSessionId: getRightSidebarSessionId,
+ openPluginPanel,
});
return;
}
@@ -211,7 +210,7 @@ export function GlobalDropImportListener({
window.removeEventListener('dragover', onDragOver);
window.removeEventListener('drop', onDrop);
};
- }, [confirm, confirmWithCheckbox, getRightSidebarSessionId, navigate, onOpenShareImport, t]);
+ }, [confirm, confirmWithCheckbox, navigate, onOpenShareImport, openPluginPanel, t]);
return (
<>
diff --git a/apps/desktop/src/renderer/components/layout/MainLayout.tsx b/apps/desktop/src/renderer/components/layout/MainLayout.tsx
index f53b292c93..c9206cd3f4 100644
--- a/apps/desktop/src/renderer/components/layout/MainLayout.tsx
+++ b/apps/desktop/src/renderer/components/layout/MainLayout.tsx
@@ -262,9 +262,6 @@ export function MainLayout() {
const [rightSidebarSessionId, setRightSidebarSessionId] = useState<string | null>(null);
const rightSidebarSessionIdRef = useRef(rightSidebarSessionId);
rightSidebarSessionIdRef.current = rightSidebarSessionId;
- // 给树内远端消费方(如 GlobalDropImportListener 的装入编排)的稳定 getter:
- // 读 ref 拿最新值,prop 身份不随会话切换变化,不触发下游 effect 重挂。
- const getRightSidebarSessionId = useCallback(() => rightSidebarSessionIdRef.current, []);
const declareRightSidebarSessionId = useCallback(
(sessionId: string | null, opts: RightSidebarSessionDeclarationOptions = {}) => {
rightSidebarSessionIdRef.current = sessionId;
@@ -1393,10 +1390,7 @@ export function MainLayout() {
{/* FeiShu Bot conflict dialog -- subscribes to main process push and surfaces a global modal */}
<FeishuConflictDialogHost />
{/* 窗口级拖拽兜底:拖 .cshare 进窗口空白处 → 会话导入向导 */}
- <GlobalDropImportListener
- onOpenShareImport={openShareImport}
- getRightSidebarSessionId={getRightSidebarSessionId}
- />
+ <GlobalDropImportListener onOpenShareImport={openShareImport} />
{shareImportRequest && (
<SessionShareImportWizard
key={shareImportRequest.id}
diff --git a/apps/desktop/src/renderer/components/layout/SidebarWindowLayout.tsx b/apps/desktop/src/renderer/components/layout/SidebarWindowLayout.tsx
index 5a06d6ab4b..79320ad249 100644
--- a/apps/desktop/src/renderer/components/layout/SidebarWindowLayout.tsx
+++ b/apps/desktop/src/renderer/components/layout/SidebarWindowLayout.tsx
@@ -57,8 +57,8 @@ interface SidebarWindowContext {
export function SidebarWindowLayout() {
const { t } = useTranslation();
useDeviceLinkRemoteProjects();
- // 意识页签注册:子窗口没有 LayoutRoot,必须自行初始化 ghost 面板/页签注册表
- // 并订阅 ghosts:changed,否则 open-ghost-tab 命令路由到这里时 kind 未注册。
+ // 意识面板注册:子窗口没有 LayoutRoot,必须自行初始化 ghost 面板注册表
+ // 并订阅 ghosts:changed(停靠形态所需;历史持久化的 ghost 页签也靠它识别 kind)。
ensureGhostPanelsRegistered();
useGhostPanelsSync();
const isMac = window.electronAPI?.platform === 'darwin';
diff --git a/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx b/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
index 362d035e84..094cda54bb 100644
--- a/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
+++ b/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
@@ -85,6 +85,7 @@ import { isBatchFinished, updateRoundKey } from './lib/updateAllModel';
import {
approveUpdateExpansion,
getUpdateAllBatchState,
+ reconcileUpdateAllBatch,
setUpdateAllBatchHooks,
skipUpdateExpansion,
startUpdateAllBatch,
@@ -333,6 +334,17 @@ export function GhostPluginPage() {
next.delete('ghost');
setSearchParams(next, { replace: true });
}, [searchParams, setSearchParams]);
+ // /plugins?panel=<id> 深链:打开该插件的页签面板(装入流程「立即开启并
+ // 打开面板」从其它视图跳转进来)。合法性由 openPanelGhost 统一裁决:
+ // 非 tab 形态或未启用的目标会被下方失效 effect 自动清掉。
+ useEffect(() => {
+ const target = searchParams.get('panel');
+ if (!target) return;
+ setOpenPanelId(target);
+ const next = new URLSearchParams(searchParams);
+ next.delete('panel');
+ setSearchParams(next, { replace: true });
+ }, [searchParams, setSearchParams]);
const marketItems = marketSnapshot?.items ?? [];
const customSourceNames = useMemo(
() => marketSnapshot?.customSourceNames ?? [],
@@ -497,9 +509,6 @@ export function GhostPluginPage() {
[installedItems],
);
const currentRoundKey = useMemo(() => updateRoundKey(marketItems), [marketItems]);
- const bannerVisible =
- updatableInstalledItems.length > 0 &&
- (currentRoundKey === '' || ignoredRound !== currentRoundKey);
const handleIgnoreRound = useCallback(() => {
try {
window.localStorage.setItem(IGNORED_UPDATE_ROUND_KEY, currentRoundKey);
@@ -515,6 +524,18 @@ export function GhostPluginPage() {
const updateRows = updateBatch.rows;
const batchRunning = updateBatch.running;
const [updateDialogOpen, setUpdateDialogOpen] = useState(false);
+ // 与外部事实对账:已装清单变化(单项更新/文件更新/卸载)收束对应批量行,
+ // 账号或模式切换作废整批——旧账号发起的批次绝不落到新账号数据上。
+ useEffect(() => {
+ reconcileUpdateAllBatch();
+ }, [ghosts, mode, dataOwnerId]);
+ // 有未完结批次(含待确认项)时横幅必须在场:它是重开批量弹窗的唯一入口,
+ // 「忽略本轮」不得顺带藏掉待确认项的批准/跳过路径。
+ const hasUnfinishedBatch = updateRows !== null && !isBatchFinished(updateRows);
+ const bannerVisible =
+ hasUnfinishedBatch ||
+ (updatableInstalledItems.length > 0 &&
+ (currentRoundKey === '' || ignoredRound !== currentRoundKey));
const selectedGhost = selectedId
? (ghosts.find((ghost) => ghost.manifest.id === selectedId) ?? null)
: null;
@@ -687,7 +708,16 @@ export function GhostPluginPage() {
const handleInstall = useCallback(async () => {
const picked = await window.electronAPI.ghosts.pickFile().catch(() => null);
if (!picked || 'canceled' in picked) return;
- await confirmAndInstallGhost(picked.filePath, { t, confirm, confirmWithCheckbox });
+ await confirmAndInstallGhost(picked.filePath, {
+ t,
+ confirm,
+ confirmWithCheckbox,
+ // 已在插件页:tab 型插件勾选「立即开启并打开面板」后原地开面板。
+ openPluginPanel: (ghostId) => {
+ setSelectedId(null);
+ setOpenPanelId(ghostId);
+ },
+ });
}, [confirm, confirmWithCheckbox, t]);
const handleRetryLegacyRecovery = useCallback(async () => {
diff --git a/apps/desktop/src/renderer/features/plugin/UpdateAllDialog.tsx b/apps/desktop/src/renderer/features/plugin/UpdateAllDialog.tsx
index f9e419e60d..1149ce7982 100644
--- a/apps/desktop/src/renderer/features/plugin/UpdateAllDialog.tsx
+++ b/apps/desktop/src/renderer/features/plugin/UpdateAllDialog.tsx
@@ -9,10 +9,11 @@
import { useState } from 'react';
import * as Dialog from '@radix-ui/react-dialog';
-import { Check, Loader2, X } from 'lucide-react';
+import { Check, X } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { WINDOW_NO_DRAG_STYLE } from '@/components/layout/windowDrag';
+import { Spinner } from '@/components/ui/spinner';
import { GhostPermissionDiffView } from '@/cindy-brain/GhostPermissionList';
import { cn } from '@/lib/utils';
import { GhostPluginIcon } from './GhostPluginIcon';
@@ -42,7 +43,7 @@ function RowStatus({ row }: { row: UpdateAllRow }) {
if (row.status === 'installing') {
return (
<span className="flex items-center gap-1.5 text-12 text-[var(--text-secondary)]">
- <Loader2 size={13} className="animate-spin" aria-hidden="true" />
+ <Spinner size={13} />
{t('settings.ghosts.updateAll.statusInstalling')}
</span>
);
diff --git a/apps/desktop/src/renderer/features/plugin/__tests__/updateAllController.test.ts b/apps/desktop/src/renderer/features/plugin/__tests__/updateAllController.test.ts
index bc0ee01deb..b726920c43 100644
--- a/apps/desktop/src/renderer/features/plugin/__tests__/updateAllController.test.ts
+++ b/apps/desktop/src/renderer/features/plugin/__tests__/updateAllController.test.ts
@@ -16,12 +16,17 @@ vi.mock('@/cindy-brain/useInstalledGhosts', () => ({
readInstalledGhostsSnapshot: () => installedGhosts,
}));
+import {
+ __testing as dataOwnerTesting,
+ setDataOwnerGeneration,
+} from '@/contexts/dataOwnerGeneration';
import type { GhostManifest } from '../../../../shared/ghost';
import type { PluginMarketDetail, PluginMarketItem } from '../../../../shared/pluginMarket';
import {
__resetUpdateAllBatchForTest,
approveUpdateExpansion,
getUpdateAllBatchState,
+ reconcileUpdateAllBatch,
startUpdateAllBatch,
} from '../lib/updateAllController';
@@ -81,6 +86,8 @@ async function waitForSettledBatch(): Promise<void> {
beforeEach(() => {
__resetUpdateAllBatchForTest();
+ dataOwnerTesting.reset();
+ setDataOwnerGeneration('owner-a');
detailMock.mockReset();
installMock.mockClear();
installedGhosts = [{ manifest: manifest({ version: '1.0.0' }) }];
@@ -153,6 +160,54 @@ describe('updateAllController', () => {
expect(installMock).not.toHaveBeenCalled();
});
+ it('voids the batch when the data owner changes during the detail round-trip', async () => {
+ let releaseDetail: (() => void) | undefined;
+ detailMock.mockImplementation(
+ () =>
+ new Promise((resolve) => {
+ releaseDetail = () => {
+ setDataOwnerGeneration('owner-b');
+ resolve({
+ ...marketItem({}),
+ manifest: manifest({}),
+ readme: null,
+ } as unknown as PluginMarketDetail);
+ };
+ }),
+ );
+
+ startUpdateAllBatch([marketItem({})]);
+ await vi.waitFor(() => expect(releaseDetail).toBeDefined());
+ releaseDetail?.();
+ await vi.waitFor(() => expect(getUpdateAllBatchState().running).toBe(false));
+
+ // 旧账号发起的批次在身份切换后整体作废,不得写入新账号数据。
+ expect(getUpdateAllBatchState().rows).toBeNull();
+ expect(installMock).not.toHaveBeenCalled();
+ });
+
+ it('reconcile settles held rows updated externally and voids stale-owner batches', async () => {
+ stubDetail({
+ manifest: manifest({ network: { hosts: ['api.example.com'] } }),
+ sourceType: 'server',
+ });
+ startUpdateAllBatch([marketItem({})]);
+ await waitForSettledBatch();
+ expect(getUpdateAllBatchState().rows?.[0]?.status).toBe('needs-confirm');
+
+ // 单项/文件更新把插件装到了目标版本 → 待确认行收束为完成,不再重复安装。
+ installedGhosts = [{ manifest: manifest({ version: '1.1.0' }) }];
+ reconcileUpdateAllBatch();
+ expect(getUpdateAllBatchState().rows?.[0]?.status).toBe('done');
+ expect(installMock).not.toHaveBeenCalled();
+
+ // 账号切换后对账直接作废整批。
+ startUpdateAllBatch([]);
+ setDataOwnerGeneration('owner-b');
+ reconcileUpdateAllBatch();
+ expect(getUpdateAllBatchState().rows).toBeNull();
+ });
+
it('keeps pending confirmations readable after the page unsubscribes (unmount)', async () => {
stubDetail({
manifest: manifest({ network: { hosts: ['api.example.com'] } }),
diff --git a/apps/desktop/src/renderer/features/plugin/lib/updateAllController.ts b/apps/desktop/src/renderer/features/plugin/lib/updateAllController.ts
index 8472130299..a6e9950cef 100644
--- a/apps/desktop/src/renderer/features/plugin/lib/updateAllController.ts
+++ b/apps/desktop/src/renderer/features/plugin/lib/updateAllController.ts
@@ -15,6 +15,11 @@
import { i18n } from '@/i18n';
import { toast } from '@/lib/toast';
import { readInstalledGhostsSnapshot } from '@/cindy-brain/useInstalledGhosts';
+import {
+ getDataOwnerGeneration,
+ isDataOwnerGenerationCurrent,
+ type DataOwnerGeneration,
+} from '@/contexts/dataOwnerGeneration';
import { diffGhostPermissionItems, type GhostManifest } from '../../../../shared/ghost';
import type { PluginMarketItem } from '../../../../shared/pluginMarket';
import { pluginMarketErrorKey } from './pluginMarketErrorKey';
@@ -40,6 +45,8 @@ interface UpdateAllBatchHooks {
let state: UpdateAllBatchState = { rows: null, running: false };
let finishToastShown = false;
let hooks: UpdateAllBatchHooks = {};
+/** 批次启动时的账号世代:身份切换后旧批次整体作废,绝不跨账号安装。 */
+let batchOwner: DataOwnerGeneration | null = null;
const listeners = new Set<() => void>();
function emit(next: UpdateAllBatchState): void {
@@ -48,7 +55,20 @@ function emit(next: UpdateAllBatchState): void {
}
function patchRow(pluginId: string, patch: Partial<UpdateAllRow>): void {
- emit({ ...state, rows: updateRow(state.rows ?? [], pluginId, patch) });
+ // 批次已被清空(如账号切换作废)时,迟到的行迁移直接丢弃。
+ if (state.rows === null) return;
+ emit({ ...state, rows: updateRow(state.rows, pluginId, patch) });
+}
+
+function batchOwnerCurrent(): boolean {
+ return batchOwner !== null && isDataOwnerGenerationCurrent(batchOwner);
+}
+
+/** 账号/模式切换后作废整个批次(runner 在下一个检查点自行退出)。 */
+function voidStaleBatch(): void {
+ batchOwner = null;
+ finishToastShown = true; // 作废批次不再补发完成 toast。
+ emit({ rows: null, running: false });
}
export function subscribeUpdateAllBatch(listener: () => void): () => void {
@@ -104,6 +124,7 @@ export function startUpdateAllBatch(marketUpdates: readonly PluginMarketItem[]):
readInstalledGhostsSnapshot().map((ghost) => [ghost.manifest.id, ghost.manifest.version]),
);
finishToastShown = false;
+ batchOwner = getDataOwnerGeneration();
emit({ rows: buildUpdateAllRows(marketUpdates, installedVersionById), running: false });
void runQueue();
}
@@ -114,11 +135,21 @@ async function runQueue(): Promise<void> {
emit({ ...state, running: true });
try {
for (;;) {
+ if (!batchOwnerCurrent()) {
+ voidStaleBatch();
+ break;
+ }
const next = (state.rows ?? []).find((row) => row.status === 'pending');
if (!next) break;
patchRow(next.pluginId, { status: 'installing' });
try {
const detail = await window.electronAPI.pluginMarket.detail(next.pluginId);
+ // detail 往返期间可能切换账号:install 会以当前账号执行,旧批次
+ // 绝不能把上一个账号发起的更新落到新账号数据上。
+ if (!batchOwnerCurrent()) {
+ voidStaleBatch();
+ break;
+ }
const installedManifest = installedManifestOf(next.ghostId);
if (!installedManifest) {
// 批量期间插件已被卸载:绝不拿市场 manifest 兜底继续安装
@@ -158,14 +189,25 @@ async function runQueue(): Promise<void> {
/** 用户在弹窗里同意某个扩权项后继续安装。 */
export async function approveUpdateExpansion(pluginId: string): Promise<void> {
+ if (!batchOwnerCurrent()) {
+ voidStaleBatch();
+ return;
+ }
const row = state.rows?.find((candidate) => candidate.pluginId === pluginId);
if (!row || row.status !== 'needs-confirm' || !row.releaseId) return;
- if (installedManifestOf(row.ghostId) === null) {
+ const installed = installedManifestOf(row.ghostId);
+ if (installed === null) {
// 待确认期间插件被卸载:同意也不重装,按跳过收束。
patchRow(pluginId, { status: 'skipped' });
maybeFinishToast();
return;
}
+ if (installed.version === row.toVersion) {
+ // 等待确认期间已通过单项/文件更新装到目标版本:不再重复下载安装。
+ patchRow(pluginId, { status: 'done' });
+ maybeFinishToast();
+ return;
+ }
patchRow(pluginId, { status: 'installing' });
try {
await window.electronAPI.pluginMarket.install(pluginId, {
@@ -183,16 +225,51 @@ export async function approveUpdateExpansion(pluginId: string): Promise<void> {
/** 用户在弹窗里跳过某个扩权项。 */
export function skipUpdateExpansion(pluginId: string): void {
+ if (!batchOwnerCurrent()) {
+ voidStaleBatch();
+ return;
+ }
const row = state.rows?.find((candidate) => candidate.pluginId === pluginId);
if (!row || row.status !== 'needs-confirm') return;
patchRow(pluginId, { status: 'skipped' });
maybeFinishToast();
}
+/**
+ * 与外部事实对账:账号切换 → 整批作废;待确认行的插件被卸载 → 跳过、
+ * 已被单项/文件更新装到目标版本 → 记为完成(不再提供重复安装入口)。
+ * 页面在已装清单或身份变化时调用。
+ */
+export function reconcileUpdateAllBatch(): void {
+ if (state.rows === null) return;
+ if (!batchOwnerCurrent()) {
+ voidStaleBatch();
+ return;
+ }
+ let rows = state.rows;
+ let changed = false;
+ for (const row of state.rows) {
+ if (row.status !== 'needs-confirm') continue;
+ const installed = installedManifestOf(row.ghostId);
+ if (installed === null) {
+ rows = updateRow(rows, row.pluginId, { status: 'skipped' });
+ changed = true;
+ } else if (installed.version === row.toVersion) {
+ rows = updateRow(rows, row.pluginId, { status: 'done' });
+ changed = true;
+ }
+ }
+ if (changed) {
+ emit({ ...state, rows });
+ maybeFinishToast();
+ }
+}
+
/** 仅测试用:清空模块级批次状态与回调注册。 */
export function __resetUpdateAllBatchForTest(): void {
state = { rows: null, running: false };
finishToastShown = false;
hooks = {};
+ batchOwner = null;
listeners.clear();
}
diff --git a/apps/desktop/src/renderer/features/right-sidebar/lib/__tests__/executeSidebarCommand.test.ts b/apps/desktop/src/renderer/features/right-sidebar/lib/__tests__/executeSidebarCommand.test.ts
index d686583e49..9326cf09c1 100644
--- a/apps/desktop/src/renderer/features/right-sidebar/lib/__tests__/executeSidebarCommand.test.ts
+++ b/apps/desktop/src/renderer/features/right-sidebar/lib/__tests__/executeSidebarCommand.test.ts
@@ -72,12 +72,9 @@ describe('executeSidebarCommand', () => {
focusTab: false,
});
await executeSidebarCommand({ type: 'close-orca-workers-tab', sessionId: 's1' });
- await executeSidebarCommand({ type: 'open-ghost-tab', sessionId: 's1', ghostId: 'tab-demo-a' });
expect(ensureHydrated).toHaveBeenCalledWith('s1');
expect(addOrFocusSingletonTab).toHaveBeenCalledWith('s1', 'terminal');
- // 插件页签:与 terminal 同款单例语义,kind 为 ghost:<id>。
- expect(addOrFocusSingletonTab).toHaveBeenCalledWith('s1', 'ghost:tab-demo-a');
expect(openUrlInSidebarBrowser).toHaveBeenCalledWith('s1', 'https://example.com/');
expect(openDirInSidebarFileBrowser).toHaveBeenCalledWith('s1', 'src');
expect(openFileInSidebarFileBrowser).toHaveBeenCalledWith('s1', 'src/App.tsx');
diff --git a/apps/desktop/src/renderer/features/right-sidebar/lib/__tests__/openGhostTabInSidebar.test.ts b/apps/desktop/src/renderer/features/right-sidebar/lib/__tests__/openGhostTabInSidebar.test.ts
deleted file mode 100644
index 5964300fbf..0000000000
--- a/apps/desktop/src/renderer/features/right-sidebar/lib/__tests__/openGhostTabInSidebar.test.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-// @vitest-environment jsdom
-
-/**
- * openGhostTabInSidebar — 覆盖宿主裁决三分支(仿 openInSidebarBrowser.test):
- * - attached:ensureHydrated → addOrFocusSingletonTab(ghost:<id>) → 请求可见
- * - routed:命令已到子窗口,本地只请求可见(持久化折叠态)
- * - queued / stale-context:不动本地 store 也不请求可见
- */
-
-import { beforeEach, describe, expect, it, vi } from 'vitest';
-
-vi.mock('../../store', () => ({
- addOrFocusSingletonTab: vi.fn(async () => ({ id: 't_1', kind: 'ghost:tab-demo-a', state: null })),
- ensureHydrated: vi.fn(async () => undefined),
-}));
-vi.mock('../sidebarCommands', () => ({
- requestRightSidebarVisibility: vi.fn(),
-}));
-vi.mock('../detachedSidebarRouting', () => ({
- routeSidebarCommand: vi.fn(async () => 'attached'),
-}));
-
-import { addOrFocusSingletonTab, ensureHydrated } from '../../store';
-import { requestRightSidebarVisibility } from '../sidebarCommands';
-import { routeSidebarCommand } from '../detachedSidebarRouting';
-import { openGhostTabInSidebar } from '../openGhostTabInSidebar';
-
-describe('openGhostTabInSidebar', () => {
- beforeEach(() => {
- vi.clearAllMocks();
- vi.mocked(routeSidebarCommand).mockResolvedValue('attached');
- });
-
- it('attached:先 hydrate 再单例聚焦 ghost:<id>,最后请求侧栏可见', async () => {
- await openGhostTabInSidebar('s1', 'tab-demo-a');
-
- expect(routeSidebarCommand).toHaveBeenCalledWith({
- type: 'open-ghost-tab',
- sessionId: 's1',
- ghostId: 'tab-demo-a',
- });
- expect(ensureHydrated).toHaveBeenCalledWith('s1');
- expect(vi.mocked(ensureHydrated).mock.invocationCallOrder[0]).toBeLessThan(
- vi.mocked(addOrFocusSingletonTab).mock.invocationCallOrder[0],
- );
- expect(addOrFocusSingletonTab).toHaveBeenCalledWith('s1', 'ghost:tab-demo-a');
- expect(requestRightSidebarVisibility).toHaveBeenCalledWith('open', { sessionId: 's1' });
- });
-
- it('routed:命令交给子窗口,本地不写 store、仍请求可见', async () => {
- vi.mocked(routeSidebarCommand).mockResolvedValueOnce('routed');
-
- await openGhostTabInSidebar('remote-lead', 'tab-demo-a');
-
- expect(ensureHydrated).not.toHaveBeenCalled();
- expect(addOrFocusSingletonTab).not.toHaveBeenCalled();
- expect(requestRightSidebarVisibility).toHaveBeenCalledWith('open', {
- sessionId: 'remote-lead',
- });
- });
-
- it.each(['queued', 'stale-context'] as const)('%s:不写本地也不请求可见', async (routeResult) => {
- vi.mocked(routeSidebarCommand).mockResolvedValueOnce(routeResult);
-
- await openGhostTabInSidebar('stale', 'tab-demo-a');
-
- expect(ensureHydrated).not.toHaveBeenCalled();
- expect(addOrFocusSingletonTab).not.toHaveBeenCalled();
- expect(requestRightSidebarVisibility).not.toHaveBeenCalled();
- });
-
- it('addOrFocusSingletonTab 失败时向上抛,不请求可见(调用方兜错)', async () => {
- vi.mocked(addOrFocusSingletonTab).mockRejectedValueOnce(new Error('boom'));
- await expect(openGhostTabInSidebar('s1', 'tab-demo-a')).rejects.toThrow('boom');
- expect(requestRightSidebarVisibility).not.toHaveBeenCalled();
- });
-});
diff --git a/apps/desktop/src/renderer/features/right-sidebar/lib/executeSidebarCommand.ts b/apps/desktop/src/renderer/features/right-sidebar/lib/executeSidebarCommand.ts
index 788b0571db..4622df841d 100644
--- a/apps/desktop/src/renderer/features/right-sidebar/lib/executeSidebarCommand.ts
+++ b/apps/desktop/src/renderer/features/right-sidebar/lib/executeSidebarCommand.ts
@@ -1,6 +1,5 @@
/** 执行 main 已裁决并推给当前 renderer host 的 RSB command。 */
-import { ghostPanelKind } from '../../../../shared/ghost';
import type { RsbWindowCommand } from '../../../../shared/rightSidebarWindow';
import { addOrFocusSingletonTab, ensureHydrated } from '../store';
import {
@@ -51,12 +50,6 @@ export async function executeSidebarCommand(command: RsbWindowCommand): Promise<
});
return;
}
- if (command.type === 'open-ghost-tab') {
- // 插件页签与 review/terminal 同款单例语义:已开则聚焦,未开则新建。
- await ensureHydrated(command.sessionId);
- await addOrFocusSingletonTab(command.sessionId, ghostPanelKind(command.ghostId));
- return;
- }
await ensureHydrated(command.sessionId);
await addOrFocusSingletonTab(command.sessionId, 'terminal');
}
diff --git a/apps/desktop/src/renderer/features/right-sidebar/lib/openGhostTabInSidebar.ts b/apps/desktop/src/renderer/features/right-sidebar/lib/openGhostTabInSidebar.ts
deleted file mode 100644
index c9556d9764..0000000000
--- a/apps/desktop/src/renderer/features/right-sidebar/lib/openGhostTabInSidebar.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * openGhostTabInSidebar —— "打开/聚焦插件页签"的统一入口。
- *
- * 装入流程(installFlow 勾选「立即开启」)等远端调用点通过它把一个
- * panel.position:'tab' 的插件页签带到用户面前:
- * 1. 先经 routeSidebarCommand 请 main 裁决宿主 —— 侧栏抽离成独立窗口时命令
- * 被路由过去,由子窗口的 executeSidebarCommand 落地;
- * 2. attached(内嵌)形态本地执行:ensureHydrated 消除与 Shell 异步 list
- * 拉取的竞态(同 openInSidebarBrowser 的注释),再 addOrFocusSingletonTab
- * —— 插件页签每会话单例,已开则聚焦;
- * 3. 请求右侧栏可见("已打开 → no-op"由 MainLayout 订阅端自行判断)。
- */
-
-import { ghostPanelKind } from '../../../../shared/ghost';
-import { addOrFocusSingletonTab, ensureHydrated } from '../store';
-import { routeSidebarCommand } from './detachedSidebarRouting';
-import { requestRightSidebarVisibility } from './sidebarCommands';
-
-/** 在指定 session 的右侧栏里打开/聚焦某插件的页签,并确保侧边栏可见。 */
-export async function openGhostTabInSidebar(sessionId: string, ghostId: string): Promise<void> {
- const routeResult = await routeSidebarCommand({
- type: 'open-ghost-tab',
- sessionId,
- ghostId,
- });
- if (routeResult !== 'attached') {
- if (routeResult !== 'routed') return;
- requestRightSidebarVisibility('open', { sessionId });
- return;
- }
- await ensureHydrated(sessionId);
- await addOrFocusSingletonTab(sessionId, ghostPanelKind(ghostId));
- requestRightSidebarVisibility('open', { sessionId });
-}
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index 0b0193b380..0b2b277e53 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -3290,7 +3290,7 @@
"meta": "Version {{version}}. Installs locally and can be uninstalled anytime.",
"metaWithAuthor": "By {{author}} · Version {{version}}. Installs locally and can be uninstalled anytime.",
"enableNow": "Enable right after install",
- "enableNowOpenTab": "Enable and open its tab right after install",
+ "enableNowOpenPanel": "Enable and open its panel right after install",
"expandDescription": "Show Full Description",
"collapseDescription": "Hide Full Description"
},
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index 56ca174682..fac9ae86e9 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -3289,7 +3289,7 @@
"meta": "バージョン {{version}}。ローカルにインストールされ、いつでもアンインストールできます。",
"metaWithAuthor": "作者 {{author}} · バージョン {{version}}。ローカルにインストールされ、いつでもアンインストールできます。",
"enableNow": "インストール後すぐに有効化",
- "enableNowOpenTab": "インストール後すぐに有効化してタブを開く",
+ "enableNowOpenPanel": "インストール後すぐに有効化してパネルを開く",
"expandDescription": "紹介全文を表示",
"collapseDescription": "紹介を折りたたむ"
},
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 652d49b1ae..07bdfa3c7d 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -3289,7 +3289,7 @@
"meta": "버전 {{version}}. 로컬에 설치되며 언제든 제거할 수 있습니다.",
"metaWithAuthor": "제작자 {{author}} · 버전 {{version}}. 로컬에 설치되며 언제든 제거할 수 있습니다.",
"enableNow": "설치 후 바로 활성화",
- "enableNowOpenTab": "설치 후 바로 활성화하고 탭 열기",
+ "enableNowOpenPanel": "설치 후 바로 활성화하고 패널 열기",
"expandDescription": "전체 소개 보기",
"collapseDescription": "소개 접기"
},
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 7d994a79c8..dc412dc0a8 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -3289,7 +3289,7 @@
"meta": "版本 {{version}}。将安装到本机,可随时卸载。",
"metaWithAuthor": "作者 {{author}} · 版本 {{version}}。将安装到本机,可随时卸载。",
"enableNow": "安装后立即生效",
- "enableNowOpenTab": "安装后立即生效并打开页签",
+ "enableNowOpenPanel": "安装后立即生效并打开面板",
"expandDescription": "展开完整介绍",
"collapseDescription": "收起介绍"
},
diff --git a/apps/desktop/src/shared/rightSidebarWindow.ts b/apps/desktop/src/shared/rightSidebarWindow.ts
index 733fc7142f..1717ffe351 100644
--- a/apps/desktop/src/shared/rightSidebarWindow.ts
+++ b/apps/desktop/src/shared/rightSidebarWindow.ts
@@ -33,8 +33,6 @@ export interface RsbWindowContext {
export type RsbWindowCommand =
| { type: 'open-terminal'; sessionId: string }
| { type: 'open-web-browser'; sessionId: string; url: string }
- /** 打开/聚焦插件页签(panel.position:'tab',每会话单例;装入即开与未来入口共用)。 */
- | { type: 'open-ghost-tab'; sessionId: string; ghostId: string }
| {
type: 'ensure-orca-workers-tab';
sessionId: string;