Skip to content

feat(editor_v2): edit API page details as fields, not YAML - #3000

Open
phrogwrld wants to merge 1 commit into
v2-rewritefrom
editor-v2-page-details-fields
Open

phrogwrld wants to merge 1 commit into
v2-rewritefrom
editor-v2-page-details-fields

Conversation

@phrogwrld

Copy link
Copy Markdown
Contributor

Stacked on #2991 (version history). Review that first; once it merges, this PR's base moves to v2-rewrite.

Summary

A content API page keeps its details (title, introduction, description, path, category, visibility and form) in api_v2's own columns. Until now the editor round-tripped them through YAML frontmatter. With this PR, the editor edits them as fields and converts only the Markdown body.

  • Fields: src/workspace/page-details.ts (the PageDetails type, detailsOf, sameDetails, detailsProblems) and page-details-panel.tsx. The details autosave beside the body, and each field keeps its own undo.
  • Body-only codec: an API page's Markdown view shows only its body. A body that hasn't changed is saved exactly as the API sent it.
  • Browser drafts are unchanged: they keep their YAML frontmatter.
  • History: the version preview renders the version's title and introduction above its body. Restore takes the version's own fields.
  • Download my version: now saves the whole unsaved page as page.json, in the shape a save sends: { ...details, body_markdown }. Before, it saved only the body, which would have lost unsaved details.

Test plan

  • apps/editor_v2: format, lint, typecheck, boundaries, the full suite (1068), and build with VITE_API_ORIGIN set
  • Browser, on a content API page:
    • edit the title, introduction and details;
    • Save or Publish;
    • check that History previews and restores a version's details;
    • check that "Download my version" includes the details;
    • check that a browser draft still edits its YAML.

A content API page keeps its details in api_v2's columns, so the editor
now edits them as fields beside the body and converts only the Markdown
body. Browser drafts keep their YAML frontmatter. Download my version
saves the whole unsaved page, details and body, as JSON, since the body
alone would lose the details.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Amplify PR previews

App Status URL
forms ⏭ Not affected —
landing ⏭ Not affected —
chat ⏭ Not affected —
form-builder ⏭ Not affected —
analytics ⏭ Not affected —

Commit: 22c8311 · Branches auto-delete when this PR closes.

ℹ️ feature-flagging uses a single shared preview slot at a fixed URL (preview.feature-flagging.sandbox.alpha.gov.bb) — GitHub login works, but only one FF preview exists at a time (the most recent FF PR build wins). It reads/writes sandbox flag data.

Base automatically changed from editor-v2-version-history to v2-rewrite October 16, 2026 18:21

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant