Skip to content

Enhancement: document aware container labels - #1218

Merged
dkotter merged 8 commits into
WordPress:developfrom
Infinite-Null:enhancement/document-aware-container-labels
Oct 27, 2026
Merged

dkotter merged 8 commits into
WordPress:developfrom
Infinite-Null:enhancement/document-aware-container-labels

Conversation

@Infinite-Null

@Infinite-Null Infinite-Null commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What?

Follow up to #1175 (review)

Enhances block container label generation by providing document-level context (post title, section hierarchy, and surrounding container blocks) to the model. This allows the AI to generate structural and editorial role labels rather than merely summarizing inner content.

Why?

Previously, the model only received the isolated text content of the target container. Without knowing where the container sits within the page or what other sections exist, the model had to rely solely on local text, often producing descriptive summaries rather than functional, navigational List View labels.

Screencast:

Screen.Recording.2026-10-24.at.6.29.58.PM.mov

Here is the example of document context in above video:

{
"document_context": "Title: Hello world! Section 1: Our Work \u267b\ufe0f Sustainable Materials We use carefully selected, sustainable materials to reduce our environmental impact. \u2713 Section 2 (Target Block): Our Work \u267b\ufe0f Sustainable Materials We use carefully selected, sustainable materials to reduce our environmental impact. \u2713 Section 3 [Current Label: Reducing Our Environmental Impact]: \u267b\ufe0f Sustainable Materials We use carefully selected, sustainable materials to reduce our environmental impact. \u2713 Built fo Section 4 [Current Label: Reducing Our Environmental Footprint]: \u267b\ufe0f Sustainable Materials We use carefully selected, sustainable materials to reduce our environmental impact. Section 5 [Current Label: Built for Everyday Use]: \u2713 Built for Everyday Use Practical, durable designs made to fit seamlessly into your everyday routine. Section 6 [Current Label: Less Waste Production Practices]: \ud83c\udf31 Made with Less Waste We focus on thoughtful production and reducing unnecessary waste at every step. Section 7: Sustainable product showcase Discover our approach to creating products that combine quality, functionality, and sustain Section 8: Discover our approach to creating products that combine quality, functionality, and sustainability. Discover our approac Section 9: Discover our approach to creating products that combine quality, functionality, and sustainability. Section 10: Discover our approach to creating products that combine quality, functionality, and sustainability."
}

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Sonnet 4.6
Used for: Validating bug, suggesting a fix.

Changelog Entry

Changed - Enhance block container label generation to be document-aware.

Open WordPress Playground Preview

@Infinite-Null
Infinite-Null requested a review from a team October 24, 2026 13:01
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.73%. Comparing base (c5f7a6f) to head (25d825b).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1218      +/-   ##
=============================================
+ Coverage      84.71%   84.73%   +0.01%     
- Complexity      3723     3725       +2     
=============================================
  Files            149      149              
  Lines          14257    14271      +14     
=============================================
+ Hits           12078    12092      +14     
  Misses          2179     2179              
Flag Coverage Δ
unit 84.73% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Infinite-Null

Infinite-Null commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi @dkotter, I've implemented the document-aware container label generation changes based on your suggestion here. The model now receives document-level context to help generate more meaningful, structural labels.

Could you please review the changes when you get a chance? Thanks for the suggestion!

@jeffpaul jeffpaul added this to the 1.5.0 milestone Oct 26, 2026
@jeffpaul jeffpaul moved this from Triage to Needs review in WordPress AI Roadmap Oct 26, 2026
…t up-to-date content to send in case something changes between runs. Cache some data to help with performance
@dkotter
dkotter merged commit 999ba50 into WordPress:develop Oct 27, 2026
36 checks passed
@github-project-automation github-project-automation Bot moved this from Needs review to Done in WordPress AI Roadmap Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants