Skip to content
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

Initial integration into the new Command Palette #536

Merged
merged 9 commits into from
Jul 17, 2023
Merged

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Jul 13, 2023

Description of the Change

Gutenberg v15.6.0 shipped with a new Command Palette that can be triggered within the site editor (by using the keyboard shortcut command+k). This feature should be shipping with WP 6.3. This PR does some initial integrations into this Command Palette but there are certainly more things we could add here (or in follow-up PRs).

At the moment, there are 4 commands we add here:

  1. A link to the general ClassifAI settings page
  2. Ability to trigger excerpt generation
  3. Ability to trigger title generation
  4. A link that takes you to the new stand-alone image generation screen
Command.Center.mov

How to test the Change

  1. Ensure you're running the Gutenberg plugin, v15.6.0 or greater
  2. Check this PR out and run npm install && npm run build
  3. Create a new post or edit an existing post
  4. Click into the post content (I found I couldn't trigger the command center until I clicked on something) and then use the shortcut command+k
  5. In the modal that pops up, search for ClassifAI: Generate excerpt, ClassifAI: Generate title, ClassifAI: Generate image, or ClassifAI settings
  6. Click on all three separately and ensure they work

Changelog Entry

Added - Initial integration with the new Command Palette API

Credits

Props @dkotter

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 2.3.0 milestone Jul 13, 2023
@dkotter dkotter self-assigned this Jul 13, 2023
@dkotter dkotter requested review from a team and jeffpaul as code owners July 13, 2023 21:58
@dkotter dkotter requested review from a team and iamdharmesh and removed request for a team and jeffpaul July 13, 2023 22:07
Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @dkotter, Code looks good and it tests well. However, I noticed 1 warning about missing dependencies. otherwise all good to proceed with merging this.

Note: My OpenAI key is expired so, not tested title generation etc.. but the command properly triggers the operation for generating titles and excerpt.

includes/Classifai/Plugin.php Outdated Show resolved Hide resolved
src/js/gutenberg-plugins/commands.js Outdated Show resolved Hide resolved
Copy link
Contributor

@ravinderk ravinderk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkotter, do you think we can make our command titles unique? It will be difficult for the admin to differentiate between two commands if they have the same title.

@dkotter dkotter requested a review from iamdharmesh July 14, 2023 14:48
@dkotter
Copy link
Collaborator Author

dkotter commented Jul 14, 2023

@dkotter, do you think we can make our command titles unique? It will be difficult for the admin to differentiate between two commands if they have the same title.

Are you thinking of just adding ClassifAI to the commands? So it would be something like ClassifAI: Generate excerpt?

@ravinderk
Copy link
Contributor

@dkotter, do you think we can make our command titles unique? It will be difficult for the admin to differentiate between two commands if they have the same title.

Are you thinking of just adding ClassifAI to the commands? So it would be something like ClassifAI: Generate excerpt?

@dkotter I was thinking the same.
Adding ClassifAI to the command title will make the command easily discoverable. Admin can quickly get the list of commands supported by this plugin.

@dkotter dkotter requested a review from ravinderk July 14, 2023 15:30
ravinderk
ravinderk previously approved these changes Jul 14, 2023
@dkotter dkotter changed the title Initial integration into the new Command Center Initial integration into the new Command Palette Jul 14, 2023
Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@dkotter dkotter merged commit d3d85c4 into develop Jul 17, 2023
@dkotter dkotter deleted the feature/commands branch July 17, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants