Skip to content

Expose the seams a bundle needs to own the draft editing surface - #3988

Draft
markus-moser wants to merge 2 commits into
2026.xfrom
feat/draft-ui-extension-points
Draft

Expose the seams a bundle needs to own the draft editing surface#3988
markus-moser wants to merge 2 commits into
2026.xfrom
feat/draft-ui-extension-points

Conversation

@markus-moser

Copy link
Copy Markdown
Contributor

Additive only. Nothing renders or behaves differently until something registers.

Package B, PR 1 of 2. Unblocks the draft-aware save buttons in the changeset bundle.

What

Three SDK exportsuseEditFormContext, useSaveContext (data-object barrel) and use-save-schedules (element barrel).

A bundle replacing the saveButtons slot entry needs the same form and save state the core buttons read. useSave is already exported, but the payload comes from getModifiedDataObjectAttributes() on useEditFormContext, which is not — so today the only way to drive a save from a bundle is to reach into the editor's DOM, which is precisely what having a slot was meant to avoid.

One new slotdataObject.editor.editTab.topBar, rendered beside DraftAlert in root-component.tsx, empty by default.

DraftAlert is hardcoded into renderTopBar, so a bundle that owns pending edits has nowhere to announce them short of portalling onto a testid. The slot is the seam; core does not learn who fills it.

Verification

  • tsc --noEmit — 0 errors
  • eslint on all four touched files — clean
  • jest — 35 suites, 355 tests, all passing
  • Built and loaded in a running Studio; both changes live in the served build

Notes

Consumed by the changeset bundle to replace the change-set footer, which today shows "Save & Publish" for saves that are captured onto a branch and publish nothing. Field decorations (the other extension point that work needs) are deliberately not in this PR.

Additive only — nothing renders or behaves differently.

Two SDK exports (useEditFormContext, useSaveContext) plus use-save-schedules:
a bundle replacing the `saveButtons` slot entry needs the same form and save
state the core buttons read. Without them the only way to drive a save from a
bundle is to reach into the editor's DOM, which is exactly what having a slot
was meant to avoid.

One new slot, dataObject.editor.editTab.topBar, rendered beside DraftAlert. A
bundle that owns pending edits has somewhere to announce them, instead of
portalling onto a testid.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@markus-moser
markus-moser force-pushed the feat/draft-ui-extension-points branch from 9722b53 to e87e4aa Compare August 13, 2026 08:22
@sonarqubecloud

Copy link
Copy Markdown

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