Skip to content

Prototype versioned blocks for content pages (#445)#449

Open
Raghaddahi wants to merge 5 commits into
wagtail:mainfrom
Raghaddahi:feature/versioned-blocks-prototype
Open

Prototype versioned blocks for content pages (#445)#449
Raghaddahi wants to merge 5 commits into
wagtail:mainfrom
Raghaddahi:feature/versioned-blocks-prototype

Conversation

@Raghaddahi

@Raghaddahi Raghaddahi commented Jun 21, 2026

Copy link
Copy Markdown
Member

Relates to #445

Description

Prototypes two approaches for versioning StreamField content, per #445:

  1. VersionNoteBlock — dedicated block with version, change_type (added/changed/removed), and content fields, rendered as a highlighted note with icon and badge.
  2. TextBlockVersioned — generic versioned text block using BlockGroup, rendering an optional version badge above the text.

The original TextBlock stays a RichTextBlock so existing text content keeps working; the versioned variant is a separate text_versioned block with its own template, avoiding a data migration.

Worth careful review: the WAGTAIL_VERSIONS list is hardcoded and may need to align with WAGTAIL_GUIDE_VERSIONS, and the markdown export format for the new blocks should be confirmed.

Testing

All tests pass, no lint errors:

make test   # 48 tests, OK
make lint   # all checks passed

Text Block Versioned

image

Version Note Block

image

AI usage

  • Agent: opencode (glm-5.2) assisted with this PR description and the HTML/CSS (templates and SCSS for version-note / version-badge).
  • All code reviewed and tested by @Raghaddahi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant