From 17ce0910c4e0d50fbf57ca6ead4a13dec4a37c02 Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Fri, 11 Sep 2026 18:27:11 +0800 Subject: [PATCH] fix(web): use installation records for plugin management --- apps/web/tests/scaffold.ts | 2 +- .../client/ui-plugin-manager/README.i18n.yaml | 4 +-- packages/client/ui-plugin-manager/README.md | 2 ++ .../client/ui-plugin-manager/README.zh.md | 2 ++ .../src/client/PluginManagerPage.tsx | 10 +++---- .../src/client/presentation.ts | 2 +- .../tests/components.client.spec.tsx | 26 +++++++++---------- .../tests/manager-store.client.spec.ts | 2 -- .../tests/preset-section.client.spec.tsx | 2 -- 9 files changed, 25 insertions(+), 27 deletions(-) diff --git a/apps/web/tests/scaffold.ts b/apps/web/tests/scaffold.ts index c9a61773a1..c92bf1995c 100644 --- a/apps/web/tests/scaffold.ts +++ b/apps/web/tests/scaffold.ts @@ -738,7 +738,7 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise loadProfile('dsh', 'scaffold', INSTALL_ANCHOR, harnessHome) const profile = readProfile() - const compose = (current: Profile): ComposedStack => composeProfileStack('web e2e scaffold', current.layers, [ + const compose = (current: Profile): ComposedStack => composeProfileStack(current.layers, [ { label: 'scaffold', patches }, { label: current.patchPath, patches: current.patches }, ]) diff --git a/packages/client/ui-plugin-manager/README.i18n.yaml b/packages/client/ui-plugin-manager/README.i18n.yaml index 18e7f99c0d..cf85a5c97d 100644 --- a/packages/client/ui-plugin-manager/README.i18n.yaml +++ b/packages/client/ui-plugin-manager/README.i18n.yaml @@ -2,5 +2,5 @@ # side as of the last confirmed-consistent state. Both languages carry equal authority; # after editing either side, bring the other along and re-record with: # pnpm run verify-translation-pairing --write packages/client/ui-plugin-manager/README.md -README.md: c34f69ba170a147f6313c21354c9e5667ac6d709 -README.zh.md: 387ca469f17f6978340fc8d424d943b5bd6757a2 +README.md: 5c2346183e79049433bedc4cfbc87f96e13da752 +README.zh.md: 50c428417d36a20a16d22b234d57aca059a6cf71 diff --git a/packages/client/ui-plugin-manager/README.md b/packages/client/ui-plugin-manager/README.md index c34f69ba17..5c2346183e 100644 --- a/packages/client/ui-plugin-manager/README.md +++ b/packages/client/ui-plugin-manager/README.md @@ -52,6 +52,8 @@ The page separates enablement, running phase and current issues. A missing servi ## Understand the implementation +Package management uses the profile’s dependency records: installed bundles can be toggled and installed packages removed; installation-owned bundles remain locked. This distinction does not select startup failure policy. +
Implementation internals — click to expand diff --git a/packages/client/ui-plugin-manager/README.zh.md b/packages/client/ui-plugin-manager/README.zh.md index 387ca469f1..50c428417d 100644 --- a/packages/client/ui-plugin-manager/README.zh.md +++ b/packages/client/ui-plugin-manager/README.zh.md @@ -52,6 +52,8 @@ kind: "package-reference" ## 理解实现 +插件管理依据 profile 的依赖记录:已安装组合包可启停,已安装包可移除,随安装提供的组合包保持锁定。这一区分不决定启动失败策略。 +
实现细节——点击展开 diff --git a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx index 78baf45610..a5c2993d1a 100644 --- a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx +++ b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx @@ -366,7 +366,7 @@ function EnableSwitch({ pkg, title, t, busy, onSetEnabled }: { readonly onSetEnabled: (enabled: boolean) => void }): ReactNode { if (pkg.kind !== 'bundle') return null - const builtin = pkg.trust === 'builtin' + const builtin = !pkg.installed return ( !pkg.rows.some(row => row.entryId === issue.entryId)) // A row's switch acts at once only on an external pack composed on a // profile that applies patches while it runs; elsewhere the rows stay read-only. - const switchable = bundle && !builtin && pkg.enabled && pkg.liveReload + const switchable = bundle && pkg.installed && pkg.enabled && pkg.liveReload return (