From d0042b990eb88c620524fcaec71789ece0103400 Mon Sep 17 00:00:00 2001 From: kozhuhds Date: Fri, 5 Dec 2025 16:06:50 +0100 Subject: [PATCH] feat: adding some comments --- packages/grafana-data/src/types/pluginExtensions.ts | 2 -- .../features/commandPalette/CommandPaletteDynamicRegistry.ts | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/grafana-data/src/types/pluginExtensions.ts b/packages/grafana-data/src/types/pluginExtensions.ts index 94720df2ca7..40c9917ed52 100644 --- a/packages/grafana-data/src/types/pluginExtensions.ts +++ b/packages/grafana-data/src/types/pluginExtensions.ts @@ -419,8 +419,6 @@ export type PluginExtensionCommandPaletteDynamicConfig = { /** * Search provider function that returns results. * Return an empty array to skip results for the current search. - * To conditionally disable the provider, simply return an empty array - * based on your own logic instead of using a separate isActive filter. */ searchProvider: CommandPaletteDynamicSearchProvider; }; diff --git a/public/app/features/commandPalette/CommandPaletteDynamicRegistry.ts b/public/app/features/commandPalette/CommandPaletteDynamicRegistry.ts index 5ba6234d626..bb225935f46 100644 --- a/public/app/features/commandPalette/CommandPaletteDynamicRegistry.ts +++ b/public/app/features/commandPalette/CommandPaletteDynamicRegistry.ts @@ -73,7 +73,10 @@ export class CommandPaletteDynamicRegistry { continue; } - // Use index to differentiate multiple providers from same plugin + // Use index to differentiate multiple providers from same plugin. + // Note: Provider IDs are index-based, so changing the order of configs + // in addCommandPaletteDynamicProvider calls could affect result tracking. + // Plugins should maintain consistent ordering of their providers. const providerId = `${pluginId}/${index}`; if (!(providerId in registry)) {