[Dashboard] Extend plugin data provider API#9149
Conversation
…ponents Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the dashboard's plugin architecture by expanding the data provider API to allow plugins to expose a wider range of functionality, including multiple hooks and UI components. Additionally, it introduces a new extensibility point on the recipe detail page, enabling plugins to seamlessly integrate custom actions into the user interface. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request extends the plugin data provider API to support sharing hooks and components, and adds a new plugin slot on the recipe detail page for custom actions. The changes are well-implemented and align with the goals described. I've added one suggestion to improve the robustness of the data provider registration by adding type checks to prevent potential runtime errors from misconfigured plugins.
| hooks: config.hooks || {}, | ||
| components: config.components || {}, |
There was a problem hiding this comment.
For improved robustness, it's advisable to ensure that config.hooks and config.components are objects before they are assigned. The current || {} operator could allow other truthy, non-object values (like strings or numbers) to be assigned if a plugin is misconfigured. This could lead to runtime errors in other parts of the application that consume these values, for example in usePluginComponents. A more defensive check would prevent such issues.
| hooks: config.hooks || {}, | |
| components: config.components || {}, | |
| hooks: (config.hooks && typeof config.hooks === 'object') ? config.hooks : {}, | |
| components: (config.components && typeof config.components === 'object') ? config.components : {}, |
Summary
registerDataProviderto support passinghooksandcomponentsin addition touseHook, enabling plugins to share multiple hooks and UI components through the data provider registryPluginSlotto the recipe detail page actions area (recipes.detail.actions) so plugins can inject custom action buttonsTest plan
useHookstill works)hooks/componentsfields are accessible viagetDataProvider()PluginSlotrenders in recipe detail page action barCo-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com