Add Annotated blocks usage report for outdated version content - #470
Open
Raghaddahi wants to merge 1 commit into
Open
Add Annotated blocks usage report for outdated version content#470Raghaddahi wants to merge 1 commit into
Raghaddahi wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.