[6.x] Render provisional drafts and autosave in the Inertia editor - #19396
Closed
brianjhanson wants to merge 1 commit into
Closed
[6.x] Render provisional drafts and autosave in the Inertia editor#19396brianjhanson 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-drafts
branch
from
August 11, 2026 19:56
c68db72 to
d6007bb
Compare
brianjhanson
force-pushed
the
feature/inertia-edit-drafts
branch
from
August 12, 2026 14:53
d6007bb to
3960578
Compare
brianjhanson
force-pushed
the
feature/inertia-edit-drafts
branch
from
August 12, 2026 16:14
3960578 to
56e578e
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
Renders provisional drafts in the Inertia editor and autosaves into them, which is what makes the port usable: the legacy editor creates a provisional draft the moment anyone types, so before this every previously-edited entry fell through to the old screen.
EditEntryControllernow only defers toEditElementControllerfor named drafts and revisions. Provisional drafts render here, with a notice and a Discard control, andsaveUrl/applyDraftUrllet the client pick its target at submit time — autosave can create a draft partway through editing a canonical element, and from that point saving means applying the draft rather than saving the element underneath it.useElementAutosaveposts to the sharedelements/save-draftaction, debounced and serialized so a burst of typing collapses into one trailing request. It is driven by the Form renderers' change callbacks rather than a watch on the Inertia form, because the form starts empty and gains its keys dynamically. Re-baselining after a save is suspended so it can't recreate the draft the save just consumed, and the draft id resyncs from the server after each visit. With edits safe in a draft, the unsaved-changes prompt now only fires when autosave hasn't caught up.Also fixes a save-blocking bug from the meta-fields PR: the
DateTimecontrol defaults to a 30-minute increment, so an entry whose post time fell between steps failed native form validation and the Save button silently did nothing. The legacy editor never hit this because it submits through JS. Post and expiry dates now accept the stored precision.