[6.x] Add header and alternate save actions to the Inertia editor - #19397
Closed
brianjhanson wants to merge 1 commit into
Closed
[6.x] Add header and alternate save actions to the Inertia editor#19397brianjhanson wants to merge 1 commit into
brianjhanson wants to merge 1 commit into
Conversation
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — |
brianjhanson
force-pushed
the
feature/inertia-edit-header-actions
branch
from
August 11, 2026 19:56
a9b97ed to
7ffe12d
Compare
brianjhanson
force-pushed
the
feature/inertia-edit-header-actions
branch
from
August 12, 2026 14:53
7ffe12d to
461c643
Compare
brianjhanson
force-pushed
the
feature/inertia-edit-header-actions
branch
from
August 12, 2026 16:14
461c643 to
e7ef092
Compare
brianjhanson
marked this pull request as ready for review
August 12, 2026 16:19
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 toelements/save-draftwithdropProvisionalso 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()serializesgetAltActions()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.