Repository navigation
[6.x] Save each draft once per autosave and keep its menus - #20649
Merged
riasvdv merged 2 commits intoNov 12, 2026
Merged
Conversation
When a layout refresh answers, the renderer emits the unsaved values it was asked to render. The editor counted that as a new edit and saved the draft a second time, with nothing left to save. Amp-Thread-ID: https://ampcode.com/threads/T-01a1d198-13ad-7182-b555-18b8fcbf088e Co-authored-by: Amp <amp@ampcode.com>
Menu items without an ID were given a random one for the client, and card menus kept the random IDs their items were made with. Every response that sent the same menu again, such as each autosave, made the client recreate all of its items. The HTML path still mints its own IDs. Amp-Thread-ID: https://ampcode.com/threads/T-01a1d198-13ad-7182-b555-18b8fcbf088e Co-authored-by: Amp <amp@ampcode.com>
Contributor
brianjhanson
approved these changes
Nov 12, 2026
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — open Storybook No changed components detected in this Storybook. |
riasvdv
deleted the
rias/cms-2685-6x-each-draft-autosave-blocks-the-entry-editor
branch
November 12, 2026 22:05
riasvdv
added a commit
that referenced
this pull request
Nov 12, 2026
[ci skip] Amp-Thread-ID: https://ampcode.com/threads/T-01a1d198-13ad-7182-b555-18b8fcbf088e Co-authored-by: Amp <amp@ampcode.com>
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
Each autosave of a provisional draft sent a second
save-draftwith nofields, and rebuilt every action menu item on the page.pause in typing ├─ save-draft (fields) └─ update-field-layout # custom fields are reactive └─ renderer re-applies the unsaved values it was asked to render - → counted as a new edit → save-draft (no fields) + → identical to the last mutation, so not an edit action menu items sent to the client - id: $item['id'] ?? 'menu-item-'.mt_rand() # new on every render + id: $item['id'] ?? null # the HTML path still mints its own card menus (ElementHtml::elementCardActionItems) - keep their items' mt_rand() IDs (action-copy-…, action-view-…) + drop them once they've been filtered on, as Ui\Nodes\ActionMenu doesActionListkeys items by theirid, so a newidon every response made Vue recreate the items in each closed menu.Evidence
Workbench Matrix Playground "Populated views" entry, with a provisional draft. Headless Chromium, one character typed, then a pause:
craft-action-items removed and re-addedThese numbers come from an earlier version of this fix that changed
ActionList's keying on the client instead of the server IDs; the server version wasn't measured in the browser. Edited values were still there after a reload.Related issues