Skip to content

feat: modal & ai actions#2860

Open
Soare-Robert-Daniel wants to merge 5 commits into
developmentfrom
feat/content-ai
Open

feat: modal & ai actions#2860
Soare-Robert-Daniel wants to merge 5 commits into
developmentfrom
feat/content-ai

Conversation

@Soare-Robert-Daniel

@Soare-Robert-Daniel Soare-Robert-Daniel commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Closes https://github.com/Codeinwp/otter-internals/issues/280

Summary

  • Display the generated results in the modal
  • Add custom AI toolbar actions
  • Add magic tags

Screenshots

CleanShot 2026-06-11 at 17 05 31@2x CleanShot 2026-06-11 at 17 19 03@2x

Test instructions


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 Jun 11, 2026
@pirate-bot pirate-bot added pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label) pr-checklist-complete The Pull Request checklist is complete. (automatic label) and removed pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label) labels Jun 11, 2026
generatedHtml: string,
sourceBlocks: BlockProps<unknown>[]
) => {
const plainText = generatedHtml.replace( /<[^>]+>/g, '' ).trim();
@@ -0,0 +1,64 @@
const stripTags = ( html ) => html.replace( /<[^>]+>/g, '' ).trim();
@pirate-bot

pirate-bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.27 KB 178.27 KB 0 B (0.00%)
Blocks 1.51 MB 1.53 MB 20.57 KB (1.33%)
CSS 7.87 KB 7.87 KB 0 B (0.00%)
Dashboard 111.06 KB 175.39 KB 64.33 KB (57.92%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.7 KB 4.7 KB 0 B (0.00%)
Pro 322.45 KB 322.93 KB 496 B (0.15%)

@pirate-bot

pirate-bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Plugin build for 58810c5 is ready 🛎️!

@pirate-bot

pirate-bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":393,"q50":424.8,"q75":426.4,"cnt":10}, firstPaint: {"q25":514.5,"q50":634.2,"q75":757.5,"cnt":10}, domContentLoaded: {"q25":3216.5,"q50":3280.65,"q75":3304,"cnt":10}, loaded: {"q25":3218.9,"q50":3282.7,"q75":3306.2,"cnt":10}, firstContentfulPaint: {"q25":3724,"q50":3765.45,"q75":3798.5,"cnt":10}, firstBlock: {"q25":14016.4,"q50":14090.4,"q75":14183.3,"cnt":10}, type: {"q25":26.42,"q50":28.13,"q75":29.85,"cnt":10}, typeWithoutInspector: {"q25":25.47,"q50":25.81,"q75":27.8,"cnt":10}, typeWithTopToolbar: {"q25":32.46,"q50":34.05,"q75":35.41,"cnt":10}, typeContainer: {"q25":16.11,"q50":16.38,"q75":18.13,"cnt":10}, focus: {"q25":118.19,"q50":122.64,"q75":123.3,"cnt":10}, inserterOpen: {"q25":36.51,"q50":37.01,"q75":37.46,"cnt":10}, inserterSearch: {"q25":12.28,"q50":12.48,"q75":12.84,"cnt":10}, inserterHover: {"q25":10.37,"q50":10.6,"q75":11.2,"cnt":20}, loadPatterns: {"q25":1503.14,"q50":1531.19,"q75":1615.16,"cnt":10}, listViewOpen: {"q25":202.87,"q50":212.08,"q75":224.93,"cnt":10}

Resolve conflicts integrating the multi-backend AI work (WP AI Client /
Connectors) with the content-ai toolbar/modal refactor:

- AI settings stay in the dedicated AI dashboard tab; ported the
  multi-backend "WordPress AI"/Connectors panel, provider-status notices,
  and legacy OpenAI-key fallback into AI.js.
- Editor toolbar gate now uses isAIBackendConfigured().
- Adapt prompt response consumers (modal, content-generator, block
  generation) to the normalized {ok, content, usedTokens} contract; drop
  the deleted ChatResponse type.
- Merge e2e specs/config and keep both server-side AI and captcha HTTP
  stubs; dashboard specs cover the multi-backend states on the AI tab.
- Guard rest_sanitize_boolean inputs in toolbar-action sanitization.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants