-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AI Client: Separate AIControl UI from block logic and update messages #36967
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
c2d50a4
to
299946d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking super nice! Storybook stories seem all fine but I'll defer to someone else to review the code more thoroughly.
projects/js-packages/ai-client/src/components/ai-control/block-ai-control.tsx
Outdated
Show resolved
Hide resolved
7df2fa3
to
a57857c
Compare
projects/js-packages/ai-client/src/components/ai-control/ai-control.tsx
Outdated
Show resolved
Hide resolved
* @param {React.MutableRefObject} ref - Ref to the component | ||
* @returns {ReactElement} Rendered component | ||
*/ | ||
export function BlockAIControl( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning to use this in more than one place? Could be a discussion about keeping it in the package or not (not for this PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a very good catch. I'd also prefer to have this on the ai-assistant folder instead of the package.
Maybe we can have a call with @lhkowalski to decide where to move this and the other components as a last task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can have a call with @lhkowalski to decide where to move this and the other components as a last task?
Yes, for sure. Let's do it.
Fixes #36966
Proposed changes:
AIControl
component into a baseAIControl
, a block-specificBlockAIControl
component and an extension-specificExtensionAIControl
. This allows us to reuse the same base for the extensions input, which looks very similar but has different actions and behaviorOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
( cd projects/js-packages/storybook && pnpm run storybook:dev --no-open --debug-webpack )
to run StorybookAt this point the new
ErrorMessage
will not replace theerrorComponent
for the block control. That will be done later to keep compatibility.