Skip to content

[6.x] Add header and alternate save actions to the Inertia editor - #19397

Closed
brianjhanson wants to merge 1 commit into
feature/inertia-edit-draftsfrom
feature/inertia-edit-header-actions
Closed

[6.x] Add header and alternate save actions to the Inertia editor#19397
brianjhanson wants to merge 1 commit into
feature/inertia-edit-draftsfrom
feature/inertia-edit-header-actions

Conversation

@brianjhanson

@brianjhanson brianjhanson commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the header buttons and the alternate save actions beside the Save button.

headerActions() covers "Create a draft" (a canonical element the user may branch, posting to elements/save-draft with dropProvisional so a named draft is created rather than the provisional one being promoted) and "Save as a new …" for users who can't save the element but may duplicate it. formActions() serializes getAltActions() into the Save button's menu — Save and continue editing, Save and add another, Save as a new … — with redirects encrypted the way the save controllers expect to decrypt them.

Both render through FormActions, which already supported additional buttons and action items. The layout's own default action is switched off for this screen, since the element supplies its own "Save and continue editing" and the two would otherwise both appear.

submitAction() routes every one of these through the existing save pipeline rather than reimplementing submission per action: a pending-action reference overrides the target URL and merges the action's params for exactly one submission, so they inherit the elevated-session handling, error plumbing, and processing state already in place. Action params take precedence over the provisional-draft targeting, which is what lets "Create a draft" opt out of it.

Actions posting to a shared elements/* endpoint now carry the generic identity params those endpoints resolve by. The type-specific save controllers key off their own params, so a request built for one is not understood by the other — this previously surfaced as a 400 when applying a draft, and again here.

Applying a named draft and reverting a revision belong beside these buttons, but those screens still render through the legacy editor, so they arrive with the draft and revision work rather than as buttons nothing can reach.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/uiopen Storybook

No changed components detected in this Storybook.

resources/js⚠️ deploy failure, no preview available

@brianjhanson brianjhanson changed the title Add header and alternate save actions to the Inertia editor [6.x] Add header and alternate save actions to the Inertia editor Aug 11, 2026
@brianjhanson
brianjhanson force-pushed the feature/inertia-edit-header-actions branch from a9b97ed to 7ffe12d Compare August 11, 2026 19:56
@brianjhanson
brianjhanson force-pushed the feature/inertia-edit-header-actions branch from 7ffe12d to 461c643 Compare August 12, 2026 14:53
@brianjhanson
brianjhanson force-pushed the feature/inertia-edit-header-actions branch from 461c643 to e7ef092 Compare August 12, 2026 16:14
@brianjhanson
brianjhanson marked this pull request as ready for review August 12, 2026 16:19
@brianjhanson

Copy link
Copy Markdown
Contributor Author

Superseded by #19425, which flattens this stack into a single PR against 6.x — this PR is one of its commits, description and all.

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