Skip to content

Webpage Integration: Edit Post  #2499

Description

@glaubernicolau

Background
Users can edit posts they've already submitted. The edit screen reuses the Create Post form at /create/{post_id}, pre-populated with the post's current content. Any edid, including title and URL, triggers resubmission to the moderation queue. The live post stays visible until the edited version is approved. Post type is the only field locked after submission.

Figma: https://www.figma.com/design/5j0fQssrV9ipoU16P7hfKy/Website-Deliverables?node-id=1995-46463

Scope
Full-stack: post data pre-population, field lock enforcement, draft persistence, image handling, and resubmission to Wagtail's moderation queue.

Acceptance Criteria

Pre-population

  • On load, fetch existing post data by post_id and populate all form fields.
  • Post type renders disabled/read-only; not sent on resubmission.
  • All other fields (title, body, description, image, related libraries, publish date, URL for Link/Video types) are editable.

Form resubmission

  • On submit, send to the Wagtail API: post title, body content, image (if provided), related library tags (if selected), publish date, Link/Video URL (for those post types).
  • Resubmitted post enters pending moderation. Currently live version stays visible until approved.
  • Post type is excluded from the resubmission payload.

Body text — draft persistence (localStorage)

  • Body edits saved to localStorage as the user types (debounced), keyed by post_id to avoid collisions with Create Post drafts.
  • On load, restore draft from localStorage if one exists for this post_id.
  • Clear the draft from localStorage on successful resubmission.
  • Body content capped at 20,000 characters.

AI-assisted description

  • Same behavior as Create Post: body content or link as input, description generation capped at 1,000 characters.
  • Pre-populate with the existing saved description on load.
  • User can regenerate or manually edit; no rich text.

Image handling

  • Existing image displayed on load, if previously uploaded.
  • User can replace or remove.
  • Accepted formats: PNG, JPEG. Max upload: 5MB. Files over 1MB reduced to <1MB before S3 save (reduction function itself out of scope).
  • For Video post types: Jeremy's thumbnail generator invoked after image upload, same as Create Post.

Related libraries

  • Dropdown populated from the existing libraries endpoint, same as Create Post.
  • Pre-selected with the post's currently saved library tags on load.

Publish date

  • Pre-populated with the post's current publish date.
  • Passed to Wagtail as part of the resubmission payload.

Success state

  • On successful resubmission, load the Posts Feed page with a dismissable banner: "Your post has been updated. It'll be reviewed before the changes go live — you'll receive updates via email."

Failure state

  • On failed resubmission, keep the user on the edit page with form state intact. Show a dismissable banner: "Something went wrong — your draft is saved, so give it another try."

Edit timing requirement

  • A post can be edited only within 6 hours from the original submission time.
  • The window is based on the first submission, not reset on later resubmissions.
  • If the user opens the edit screen before the 6-hour cutoff, they may finish that edit session, but once closed, they cannot reopen it after the cutoff.
  • The restriction should be enforced on the backend, not just the frontend.
  • Any edit should go back through the AI/moderation pipeline.
  • Admins should not edit from the frontend; they should edit only through the Wagtail/admin interface, with no 6-hour limit there.

Out of Scope

  • Moderation workflow within Wagtail
  • WYSIWYG editor implementation
  • Posts feed page
  • Post type changes after submission

Design Reference
Figma — UI Kit Foundations Delivery, node-id=6516-41803 (Edit Blog Post / Edit Link Post, Desktop, Light)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions