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

Add AI Block consent toggle #1864

Merged
merged 2 commits into from
Sep 12, 2023
Merged

Add AI Block consent toggle #1864

merged 2 commits into from
Sep 12, 2023

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Sep 11, 2023

Closes #.

Summary

Added consent toggle for AI Block. The consent uses the already present value of 'otter_blocks_logger_flag'

Behaviour:

  • Toggle will not appear for people who have already accepted.
  • If the button close is used, we will use the browser storage to store the preference. The toggle will reappear if the user cleans up the values or uses another browser.

Screenshots

image


Test instructions

⚠️ You will need an OpenAI Key.

  1. Create an AI Block and make a first request.
  2. When the request is done, the consent toggle should appear.
  3. If you press the Close button, the toggle should appear when you make another block. If you change the browser, the toggle should be visible since this is working at the browser level.
  4. If you accept the consent, the toggle will disappear, and it will not be visible even if you change the browser since this is working at the server level.

ℹ️ When testing, ensure this value is NOT ON by default in the Dashboard. People who already made consent for this will not see the toggle.

image


Checklist before the final review

  • Included E2E or unit tests for the changes in this PR.
  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Sep 11, 2023
@Soare-Robert-Daniel Soare-Robert-Daniel added the pr-checklist-skip Allow this Pull Request to skip checklist. label Sep 11, 2023
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review September 11, 2023 12:47
@pirate-bot
Copy link
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 274.74 KB 274.74 KB 0 B (0.00%)
Blocks 1.46 MB 1.46 MB 1.57 KB (0.10%)
CSS 89.24 KB 89.24 KB 0 B (0.00%)
Dashboard 127.6 KB 127.6 KB 0 B (0.00%)
Export Import 87.13 KB 87.13 KB 0 B (0.00%)
Pro 345.85 KB 345.85 KB 0 B (0.00%)

@pirate-bot
Copy link
Contributor

Plugin build for 16ef2f5 is ready 🛎️!

@pirate-bot
Copy link
Contributor

E2E Summary

Typing

Test Average Time (ms) Standard Deviation (ms) Median Time (ms) Quantile for soft limit (%) Quantile for hard limit (%)
Typing 174.86 30.09 180.43 0 (60ms) 0 (80ms)
Values above 60ms "0 - 146.25, 1 - 155.24, 2 - 217.80, 3 - 220.48, 4 - 133.41, 5 - 127.38, 6 - 137.39, 7 - 181.01, 8 - 200.35, 9 - 179.45, 10 - 186.74, 11 - 192.88, 12 - 159.01, 13 - 180.43, 14 - 231.44, 15 - 180.50, 16 - 191.31, 17 - 167.43, 18 - 133.78"

@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Sep 12, 2023
@irinelenache
Copy link
Contributor

@Soare-Robert-Daniel Tested and the consent toggle works as expected 👍

@HardeepAsrani HardeepAsrani merged commit b78ff88 into next Sep 12, 2023
32 checks passed
@HardeepAsrani HardeepAsrani deleted the feat/consent-tracking branch September 12, 2023 11:01
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 2.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants