From eea356e7852713a95e8a109506191e998f993272 Mon Sep 17 00:00:00 2001 From: ZiyaZhang <199893125+ZiyaZhang@users.noreply.github.com> Date: Tue, 11 Aug 2026 08:54:29 -0700 Subject: [PATCH] Show module names for dynamic plugins --- .../src/client/PluginSettingsSection.tsx | 16 ++++++++++--- .../ui-plugins/tests/components.spec.tsx | 24 +++++++++---------- .../host/plugin-inventory/README.i18n.yaml | 4 ++-- packages/host/plugin-inventory/README.md | 2 +- packages/host/plugin-inventory/README.zh.md | 2 +- packages/host/plugin-inventory/src/index.ts | 2 +- packages/host/plugin-inventory/src/types.ts | 4 ++-- .../plugin-inventory/tests/inventory.spec.ts | 8 +++---- 8 files changed, 36 insertions(+), 26 deletions(-) diff --git a/packages/client/ui-plugins/src/client/PluginSettingsSection.tsx b/packages/client/ui-plugins/src/client/PluginSettingsSection.tsx index fc04e9b12a..6fdf058c02 100644 --- a/packages/client/ui-plugins/src/client/PluginSettingsSection.tsx +++ b/packages/client/ui-plugins/src/client/PluginSettingsSection.tsx @@ -45,10 +45,19 @@ function phaseLabel( return phase === null ? t('unobserved') : t(PHASE_KEYS[phase]) } +/** Compact a module specifier without guessing whether its Loader id was generated. */ +function moduleShortName(moduleName: string): string { + const unscoped = moduleName.startsWith('@') ? moduleName.slice(moduleName.indexOf('/') + 1) : moduleName + return unscoped + .replace(/^cordis:/, '') + .replace(/^cordis-plugin-/, '') + .replace(/^dsh-(?:host-|client-)?/, '') +} + /** Whether an inventory row matches the local catalog query. */ function matches(entry: PluginInventoryEntry, normalizedQuery: string): boolean { if (normalizedQuery.length === 0) return true - return [entry.displayId, entry.entryId] + return [entry.moduleName, entry.entryId] .some(value => value.toLocaleLowerCase().includes(normalizedQuery)) } @@ -125,6 +134,7 @@ export function PluginSettingsSection({ list, t }: PluginSettingsSectionProps):