[6.x] Actions#18749
Merged
brianjhanson merged 29 commits intofeature/inertia-uifrom Apr 28, 2026
Merged
Conversation
… a semantic element
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement global skip links
riasvdv
reviewed
Apr 28, 2026
| { | ||
| return [ | ||
| ...parent::safeActionMenuItems(), | ||
| [ |
Contributor
There was a problem hiding this comment.
Would it make sense here to have some kind of action object builder?
new ActionMenuItem()
->icon('clipboard')
->label(t('Copy handle'))
// ...
Contributor
Author
There was a problem hiding this comment.
For sure, I still have dreams of a PHP component system, I just haven't put any of it together yet.
In this particular case, these docs are out of date. I just forgot to remove it
Contributor
There was a problem hiding this comment.
I still have dreams of a PHP component system
:)
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.
There's a problem I've been wrestling. How do you determine server side what code should be run on the client? There are a few libraries that take a run at this. HTMX, Datastar, Stimulus, and probably roughly 1,000 more. Each of these could have gotten the job done, but in the end we're rolling our own, at least for the moment. The main reason being that we already kind of were.
In Craft 5 (and before) you're able to pass an array of items into the
disclosureMenumethod of thecraft\helpers\Cpclass. If you know the specific encantation to make them work. A sample item might look something like this{ "label": "Edit Entry", "icon": "pen-to-square", "action": "entries/save-entry", "params": {"entryId": 42}, "description": "Save changes to this entry", "confirm": "Are you sure you want to save?", "redirect": "entries", "destructive": false, "disabled": false, "hidden": false, "selected": false, "requireElevatedSession": true }I chose to build on this solution rather than implement something entirely new mostly for the ease of migration. Moving a few properties around felt easier than refactoring to a new library.
With this PR, actions have a handful of canonical types you can use to dictate functionality.
clipboardhttpeventCustomEventonwindowdownloadAction Typescript definition
The
confirmfield onhttpandeventprimitives shows a native browser confirmation dialog before proceeding.Using
<craft-action-item/>you can pass one of these actions into theactionparam to dictate the functionality.If you'd like your action to provide feedback, you can provide that as a separate param.
Feedback config
A complete example might look something like
Powers moments like this
CleanShot.2026-04-28.at.08.41.01.mp4