diff --git a/.changeset/eager-toes-rest.md b/.changeset/eager-toes-rest.md new file mode 100644 index 0000000000..bf5a167264 --- /dev/null +++ b/.changeset/eager-toes-rest.md @@ -0,0 +1,23 @@ +--- +'@backstage/core-plugin-api': patch +'@backstage/core-app-api': patch +--- + +Add optional `description` field to plugin-level feature flags. + +Plugin developers can now provide an optional description for their feature flags: + +```ts +export const myPlugin = createPlugin({ + id: 'my-plugin', + featureFlags: [ + { + name: 'show-beta-feature', + description: 'Enables the new beta dashboard view', + }, + ], +}); + +If no description is provided, the default "Registered in {pluginId} plugin" message is shown. + +``` diff --git a/packages/core-app-api/src/app/AppManager.tsx b/packages/core-app-api/src/app/AppManager.tsx index 98067267b5..f9a992cb6e 100644 --- a/packages/core-app-api/src/app/AppManager.tsx +++ b/packages/core-app-api/src/app/AppManager.tsx @@ -336,6 +336,7 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be for (const flag of plugin.getFeatureFlags()) { featureFlagsApi.registerFlag({ name: flag.name, + description: flag.description, pluginId: plugin.getId(), }); } diff --git a/packages/core-plugin-api/src/plugin/types.ts b/packages/core-plugin-api/src/plugin/types.ts index 3ba7706e16..057f493530 100644 --- a/packages/core-plugin-api/src/plugin/types.ts +++ b/packages/core-plugin-api/src/plugin/types.ts @@ -73,6 +73,8 @@ export type BackstagePlugin< export type PluginFeatureFlagConfig = { /** Feature flag name */ name: string; + /** Feature flag description */ + description?: string; }; /**