Article editor UX regression: duplicated SEO panels + required defaults blocking draft creation #53

Closed
opened 2026-03-04 21:29:40 +00:00 by codex_a · 0 comments
Owner

Problem

Creating a new article in Wagtail currently has significant editor friction:

  • SEO/promote UI appears duplicated/confusing
  • slug must be manually entered or validation fails
  • author must be manually selected or validation fails
  • category must be manually selected or validation fails
  • summary must be manually entered or validation fails

This is the opposite of a writer-friendly draft flow.

Investigation Findings

1) SEO tab is duplicating overlapping panel groups

Current ArticlePage.edit_handler uses:

  • Page.promote_panels + SeoMixin.seo_panels

In practice this renders overlapping fields twice in the SEO tab:

  • slug, seo_title, search_description, show_in_menus appear more than once

Relevant code:

  • apps/blog/models.py (ArticlePage.edit_handler)

Runtime inspection confirms duplicate resolved panel fields.

2) Form requires multiple fields with no defaults

ArticlePage admin form currently marks these as required:

  • slug
  • author
  • category
  • summary

and all of them initialize as None on create.

So a writer cannot save a basic draft with title/body only.

3) Category default in save() is too late for form validation

ArticlePage.save() has fallback logic for category (general), but model form validation runs first, so required-form errors block reaching save() when category is blank.

4) No current-user author defaulting

Author supports user = OneToOneField(User, ...), but create/edit flow does not currently preselect author based on the logged-in editor.

Proposed Solution (Step-by-Step)

Step 1: Fix panel composition to remove duplication

Refactor SEO tab to avoid combining overlapping promote/SEO panel sources.

Recommended:

  • Keep one canonical SEO panel configuration only (no duplicated slug / SEO blocks)
  • Ensure editor sees each field once

Step 2: Make draft creation forgiving with server-side fallbacks

Introduce a custom ArticlePage admin form (base_form_class) to centralize defaulting:

  • slug:
    • allow blank at form level
    • if missing, auto-generate from title in clean() (server-side)
  • author:
    • default to Author linked to current request.user
    • if missing linked Author, create one deterministically (or fallback to configured default author)
  • category:
    • default to general category
  • summary:
    • allow blank at form level
    • auto-generate from prose body (exclude code blocks; use existing body_text helper)

Step 3: Keep model-level safety nets

Retain/adjust save() safeguards so non-admin creation paths still get sane defaults.

Step 4: Add regression tests

Add tests that verify:

  • new article draft can be saved with title/body only
  • exactly one slug input/panel appears in editor
  • slug is auto-generated when omitted
  • author defaults to current editor (or deterministic fallback)
  • category defaults to general
  • summary auto-generated when omitted

Acceptance Criteria

  • Writer can create and save a draft without manually filling slug/author/category/summary.
  • SEO tab no longer shows duplicated/overlapping promote blocks.
  • No validation error is thrown for missing slug/author/category/summary on first draft save.
  • Generated defaults are deterministic and editable afterwards.
  • Existing publishing/search/feed behavior remains unchanged.
## Problem Creating a new article in Wagtail currently has significant editor friction: - SEO/promote UI appears duplicated/confusing - slug must be manually entered or validation fails - author must be manually selected or validation fails - category must be manually selected or validation fails - summary must be manually entered or validation fails This is the opposite of a writer-friendly draft flow. ## Investigation Findings ### 1) SEO tab is duplicating overlapping panel groups Current `ArticlePage.edit_handler` uses: - `Page.promote_panels + SeoMixin.seo_panels` In practice this renders overlapping fields twice in the SEO tab: - `slug`, `seo_title`, `search_description`, `show_in_menus` appear more than once Relevant code: - `apps/blog/models.py` (`ArticlePage.edit_handler`) Runtime inspection confirms duplicate resolved panel fields. ### 2) Form requires multiple fields with no defaults `ArticlePage` admin form currently marks these as required: - `slug` - `author` - `category` - `summary` and all of them initialize as `None` on create. So a writer cannot save a basic draft with title/body only. ### 3) Category default in `save()` is too late for form validation `ArticlePage.save()` has fallback logic for category (`general`), but model form validation runs first, so required-form errors block reaching `save()` when category is blank. ### 4) No current-user author defaulting `Author` supports `user = OneToOneField(User, ...)`, but create/edit flow does not currently preselect author based on the logged-in editor. ## Proposed Solution (Step-by-Step) ### Step 1: Fix panel composition to remove duplication Refactor SEO tab to avoid combining overlapping promote/SEO panel sources. Recommended: - Keep one canonical SEO panel configuration only (no duplicated `slug` / SEO blocks) - Ensure editor sees each field once ### Step 2: Make draft creation forgiving with server-side fallbacks Introduce a custom `ArticlePage` admin form (`base_form_class`) to centralize defaulting: - `slug`: - allow blank at form level - if missing, auto-generate from title in `clean()` (server-side) - `author`: - default to `Author` linked to current `request.user` - if missing linked Author, create one deterministically (or fallback to configured default author) - `category`: - default to `general` category - `summary`: - allow blank at form level - auto-generate from prose body (exclude code blocks; use existing `body_text` helper) ### Step 3: Keep model-level safety nets Retain/adjust `save()` safeguards so non-admin creation paths still get sane defaults. ### Step 4: Add regression tests Add tests that verify: - new article draft can be saved with title/body only - exactly one slug input/panel appears in editor - slug is auto-generated when omitted - author defaults to current editor (or deterministic fallback) - category defaults to `general` - summary auto-generated when omitted ## Acceptance Criteria - Writer can create and save a draft without manually filling slug/author/category/summary. - SEO tab no longer shows duplicated/overlapping promote blocks. - No validation error is thrown for missing slug/author/category/summary on first draft save. - Generated defaults are deterministic and editable afterwards. - Existing publishing/search/feed behavior remains unchanged.
mark closed this issue 2026-03-04 22:47:21 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nohype/main-site#53