Skip to content

Conversation

@joelclimbsthings
Copy link
Contributor

@joelclimbsthings joelclimbsthings commented Jun 23, 2023

Submission Review Guidelines:

Changes proposed in this Pull Request:

Adding basic settings page to store settings involved with AI features. The ones currently added are those anticipated to be capture during onboarding, as you can see in the original issue.

Closes #38746

Screenshots

image

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Checkout branch
  2. Activate WooAI plugin in your environment
  3. Navigate to WooCommerce -> Settings -> Advanced -> Features
  4. Screen should appear as in screenshot above.
  5. Fields should be disabled when "Enable" checkbox in unchecked.
  6. Tone description should update as you change the selection.
  7. Update settings, and submit.
  8. Settings should persist.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2023

Test Results Summary

Commit SHA: 4fbecf2

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 53s
E2E Tests1900018020818m 49s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@joelclimbsthings joelclimbsthings requested a review from a team June 23, 2023 19:56
@joelclimbsthings joelclimbsthings self-assigned this Jun 23, 2023
@joelclimbsthings joelclimbsthings added plugin: woo-ai Issues related to the Woo AI features plugin. focus: ai labels Jun 23, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2023

Hi @tommyshellberg,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@joelclimbsthings joelclimbsthings marked this pull request as ready for review June 23, 2023 19:56
@tommyshellberg
Copy link
Contributor

tommyshellberg commented Jun 27, 2023

Nice work here, it's a solid start for a settings page! 💯
Some general comments:

  • Given that these AI features are so new, what do we think about explaining a bit more about where these settings come from and what will use them (reference the Woo AI plugin perhaps)? Perhaps that could be done using a new blurb below:
  • I feel like the copy here could be improved:

Tell us a bit more about your business, and our AI will get to work on generating your content, images, and look and feel of your store. And if it’s not quite right you can always customize it later.
It almost gives the impression that after someone saves this settings page, some work will automatically get done.

ChatGPT helped me write this:

This is the core of the Woo AI plugin where your inputs help shape your WooCommerce experience. Share details about your business and your brand's unique style, and our advanced AI can use this to generate cohesive content and visuals that align with your brand's identity. The information you provide here helps to craft a unified and tailored experience for your customers. And remember, you always have full control to refine and adjust the settings as per your evolving needs.

  • The What does your store sell? input strips out all HTML tags which is great, but the description input allows some tags. It does strip out the riskier tags, but, unless the description is displayed somewhere, I think it’s best to just strip out all tags so we don’t have to worry about them getting sent to the LLM at all. It may just contribute to noise when generating content.
  • I like that you added the placeholder for the “describe your store” input - What if we move “e.g. organic fruit and vegetables” to be the input field’s placeholder value? This would look more consistent with the other field below it. 🤔
    It looks like textarea uses esc_html() and wp_kses_post() by default, but we could filter the $value before it's saved in the database using one of a couple of filters.

@joelclimbsthings
Copy link
Contributor Author

Thanks for the review @tommyshellberg , I believe I've address the feedback. I'm a little unfamiliar with the field sanitization logic, and I don't see many examples in the monorepo, so let me know if that's what you had in mind.

@tommyshellberg
Copy link
Contributor

Thanks for the review @tommyshellberg , I believe I've address the feedback. I'm a little unfamiliar with the field sanitization logic, and I don't see many examples in the monorepo, so let me know if that's what you had in mind.

Nice work here! It looks really nice now 👍
There's only one thing left I have a concern about.
I was thinking of using something like wp_strip_all_tags rather than esc_html() since we don't need to display this information anywhere (we just want the text content to help train a model).
It's hard for me to imagine why they'd need to input tags into that text field in order to describe their business so it seems safer to just strip all tags out completely.

Copy link
Contributor

@tommyshellberg tommyshellberg left a comment

Choose a reason for hiding this comment

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

One minor nitpick but this is ready to ship. 🚢
Nice work!

@joelclimbsthings
Copy link
Contributor Author

Thanks @tommyshellberg , updated with wp_strip_all_tags(). 👍🏻

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jul 10, 2023
Copy link
Contributor

@tommyshellberg tommyshellberg left a comment

Choose a reason for hiding this comment

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

~This looks good to me, thanks for addressing the feedback! 🚢 ~
Sorry, I ran into a couple of small things while looking at the second part of this work.

@joelclimbsthings
Copy link
Contributor Author

Thanks @tommyshellberg , I made those tweaks as well 👍

Copy link
Contributor

@tommyshellberg tommyshellberg left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@joelclimbsthings joelclimbsthings merged commit b7e7d66 into trunk Jul 13, 2023
@joelclimbsthings joelclimbsthings deleted the add/ai-settings-38746 branch July 13, 2023 00:12
@github-actions github-actions bot added this to the 8.0.0 milestone Jul 13, 2023
@beaulebens
Copy link
Contributor

I realized two things;

  1. We should sync up with the Jetpack folks, because I know they are adding (added?) the ability to change the tone of your writing -- not sure if they have a global setting, or if it's a "per interaction" type thing.
  2. This UI doesn't show up on Woo Express, I think because the Features panel is being manipulated to hide certain things, as part of moving it under Settings > WooCommerce (notice it's inverted).
Screenshot 2023-08-07 at 6 04 45 PM

@tommyshellberg
Copy link
Contributor

It looks like the tone setting for the AI Assistant is per-block:
Screenshot 2023-08-08 at 09 07 25

As for the UI issue, I'm seeing the settings:
Screenshot 2023-08-08 at 09 09 21

Is it possible your Woo Express site has a broken Jetpack connection? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woo-ai Issues related to the Woo AI features plugin. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Settings screen with Admin for Woo AI

4 participants