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

Feat: multiple prompts #602

Merged
merged 77 commits into from
Nov 3, 2023
Merged

Conversation

ravinderk
Copy link
Contributor

@ravinderk ravinderk commented Oct 19, 2023

Description of the Change

Closes #587

Visuals

image

How to test the Change

  • Admin should be able to add multiple prompts for:
    • Excerpt
    • Title
    • Shrink content prompt
    • Grow content prompt
  • Admin should able to set any prompt as default
  • Admin should able to remove prompt
  • A default prompt should apply when send request to OpenAI CharGPT/

Changelog Entry

Added - Support for multiple prompts with OpenAI ChatGPT service.

Credits

Props @ravinderk, @iamdharmesh.

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.

@ravinderk ravinderk changed the title Feat/multiple prompts setting field Feat: multiple prompts Oct 19, 2023
Copy link
Member

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

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

@ravinderk some feedback from UAT today:

  • update labels/text from "shrink content" / "grow content" to "Expand this text" / "Condense this text" (or "Expand"/"Condense") to better match the actual labels in the block editor
  • Update [green] check mark iconss to be more obvious that they're for setting defaults (green check mark > "Default prompt", check mark > "Set as default prompt")
  • Update trash can icons to be more obvious that they're for deleting prompts (trashcan > "Delete this prompt")
  • Saving prompts only works if there's a title/body to the prompt, so will want to add in some handling for when a title or body is missing so that things can either be saved or throw an error message to ensure an admin fills out title and body to properly save a prompt

@ravinderk
Copy link
Contributor Author

ravinderk commented Nov 2, 2023

@ravinderk some feedback from UAT today:

  • update labels/text from "shrink content" / "grow content" to "Expand this text" / "Condense this text" (or "Expand"/"Condense") to better match the actual labels in the block editor

Done.

Screenshots image image
  • Update [green] check mark iconss to be more obvious that they're for setting defaults (green check mark > "Default prompt", check mark > "Set as default prompt")

Done.

Screenshots image
  • Update trash can icons to be more obvious that they're for deleting prompts (trashcan > "Delete this prompt")

Done. I replaced trashcan icon with Trash text.

Screenshots image
  • Saving prompts only works if there's a title/body to the prompt, so will want to add in some handling for when a title or body is missing so that things can either be saved or throw an error message to ensure an admin fills out title and body to properly save a prompt

Done.
I made prompt title and prompt message form field required and we are now utilizing browser form validation.

Screenshots image image image

cc @jeffpaul

ravinderk and others added 4 commits November 2, 2023 20:26
Use correct selector to select 'Add new prompt' button.
Use correct selctor for prompt form field action items.
…o save those but only use them if nothing custom is added. Remove the required attribute from the prompt and only use that on the title, ensuring we have a default title set so no errors will show on initial save
dkotter
dkotter previously approved these changes Nov 2, 2023
@dkotter dkotter merged commit fa39ea0 into develop Nov 3, 2023
13 checks passed
@dkotter dkotter deleted the feat/multiple-prompts-setting-field branch November 3, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prompt modifications
5 participants