Skip to content

feat: Ability to create and place content via Gutenberg API#100

Merged
Stefan0x merged 8 commits intodevfrom
feature/create-content-ability
Mar 22, 2026
Merged

feat: Ability to create and place content via Gutenberg API#100
Stefan0x merged 8 commits intodevfrom
feature/create-content-ability

Conversation

@Stefan0x
Copy link
Copy Markdown
Collaborator

@Stefan0x Stefan0x commented Mar 21, 2026

What does this PR do?

Adds a new content-generate ability that fills a Gutenberg page with AI-generated block content. The ability makes a separate streaming LLM call (via the loaded WebLLM/external engine) to generate a JSON array of Gutenberg block definitions, then converts them to real blocks using wp.blocks.createBlock() and inserts them into the editor via wp.data.dispatch('core/block-editor').resetBlocks().

Includes robust JSON parsing that handles Qwen 3 tags, truncated responses, and malformed array output (],[ normalization). Falls back to a structured template when no model is loaded or the output format fails.

When used outside the editor, it should return a navigation message "hint" without calling the LLM. (WIP)

Type

  • New ability
  • New workflow
  • Bug fix
  • Enhancement
  • Docs

How to test

  1. Navigate to any page/post in the block editor (e.g. wp-admin/post.php?post=1&action=edit)
  2. Open the AI Assistant sidebar
  3. Type "fill this page with content about how to cook pancakes"
  4. Confirm the action when prompted
  5. Verify that AI-generated blocks (headings, paragraphs, lists) appear in the editor
  6. Verify you can undo with Ctrl+Z / Cmd+Z
  7. Navigate to the main WP Admin dashboard and try the same command — verify you get an instant "navigate to the
    editor" message without any loading delay
  8. If no AI model is loaded, verify that a placeholder template is inserted with a note to customize

@Stefan0x Stefan0x added hackathon CloudFest Hackathon 2026 ability New ability implementation labels Mar 21, 2026
@Stefan0x Stefan0x self-assigned this Mar 21, 2026
@Stefan0x Stefan0x changed the base branch from main to dev March 21, 2026 09:23
@Stefan0x Stefan0x changed the title feat: Ability to create and place content via Gutenberg API (WIP) feat: Ability to create and place content via Gutenberg API Mar 22, 2026
@Stefan0x Stefan0x merged commit 9f49943 into dev Mar 22, 2026
1 of 4 checks passed
@Stefan0x Stefan0x deleted the feature/create-content-ability branch March 22, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ability New ability implementation hackathon CloudFest Hackathon 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant