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):