Repository navigation
Add Annotated blocks usage report for outdated version content - #470
Raghaddahi wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.
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.
e35adac to
1c42b21
Compare
Relates to #445
Description
Adds a new Annotated blocks usage report to the Wagtail admin (under Reports) listing ContentPages with
text_annotatedStreamField blocks. Each block's version is compared againstWAGTAIL_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 viainsert_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
AI usage
AI (GLM 5.2) generated the code and PR description, reviewed and assisted throughout by me.