Skip to content

Add Annotated blocks usage report for outdated version content - #470

Open
Raghaddahi wants to merge 1 commit into
mainfrom
feature/block-usage-report
Open

Raghaddahi wants to merge 1 commit into
mainfrom
feature/block-usage-report

Conversation

@Raghaddahi

@Raghaddahi Raghaddahi commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

Relates to #445

Description

Adds a new Annotated blocks usage report to the Wagtail admin (under Reports) listing ContentPages with text_annotated StreamField blocks. Each block's version is compared against WAGTAIL_GUIDE_CURRENT_VERSION (a new setting) and flagged as Needs update when outdated, so editors can find stale version-specific content without manual searching.

Each block links directly to its position in the page editor via #block-index-N, with a small JS helper (block_usage_focus.js, registered via insert_editor_js) that expands and scrolls to the exact block. Block position is used instead of UUID since UUIDs differ between the live page and the latest draft revision.

A second JS/CSS pair (block_usage_report.js/.css) powers a hover-sync effect: hovering any of the Change type / Version / Content cells highlights all three together.

Testing

image image

AI usage

AI (GLM 5.2) generated the code and PR description, reviewed and assisted throughout by me.

@RealOrangeOne
RealOrangeOne temporarily deployed to wagtail-guid-feature-bl-db3lv3 August 14, 2026 03:12 Inactive
@Raghaddahi Raghaddahi self-assigned this Aug 14, 2026

@thibaudcolas thibaudcolas left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is nice but I think it’s too much code / too advanced. We should strive to create reports with Python code only, and if crucial for functionality we can introduce HTML too, but adding CSS/JS for reports feels unwarranted. If there is missing functionality to reports, we should add it to Wagtail core. But first, simplify the interface.

For the functionality, I don’t think the "outdated" check is quite right. It is completely normal to highlight major changes in "old" versions, lots of people will still be using those and appreciate the heads'up. Reporting versioned blocks is helpful, but flagging some of this versioning usage as outdated doesn’t feel right to me. I’d prefer we altogether remove that.

Note this is different from what I had in mind in #445 with a warning message. The warning would be for visitors to the site that use an old Wagtail version, to let them know that version might no longer be supported. That could be worthwhile but I don’t think this is high enough value to warrant building.

@thibaudcolas
thibaudcolas temporarily deployed to wagtail-guid-feature-bl-xvvnfh August 21, 2026 22:24 Inactive
Adds a custom Wagtail report listing ContentPages with text_annotated
blocks, flagging blocks whose recorded version is older than
WAGTAIL_GUIDE_CURRENT_VERSION so editors can find outdated content to
review or update. Each block links directly to its position in the
page editor via a #block-index-N fragment, handled by a small JS
helper registered through insert_editor_js.
@thibaudcolas
thibaudcolas force-pushed the feature/block-usage-report branch from e35adac to 1c42b21 Compare August 21, 2026 22:52
@thibaudcolas
thibaudcolas temporarily deployed to wagtail-guid-feature-bl-xvvnfh August 21, 2026 22:52 Inactive

This branch was previously deployed

2 inactive (1 outdated) deployments
wagtail-guid-feature-bl-xvvnfh — 1c42b214 Deployed Aug 21, 2026 by thibaudcolas
wagtail-guid-feature-bl-db3lv3 — e35adac4 Deployed Aug 14, 2026 by RealOrangeOne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔖 Ready

Development

Successfully merging this pull request may close these issues.

3 participants