Suggest mode 6c: Capture and apply block-move suggestions (mechanism)#77978
Suggest mode 6c: Capture and apply block-move suggestions (mechanism)#77978adamsilverstein wants to merge 4 commits intosuggest-mode-6b-insert-uifrom
Conversation
Moves in Suggest mode now flow through the apply-and-tag pipeline: the block stays at its new position, the metadata.suggestion = pending-move marker carries the from-parent + from-anchor + from- index, and auto-save persists a block-move operation. The detection heuristic combines two signals: any block whose parent changed is a cross-parent move; within the same parent, blocks NOT in the LCS of old vs new sibling order are reordered moves. The LCS step prevents tagging blocks whose index just shifted as a side-effect of another block moving past them — moving B from index 1 to 3 in [A,B,C,D] tags only B, not the C+D that filled the gap. Apply clears the marker (the block is already at its proposed location). Reject clears the marker and dispatches moveBlockToPosition to revert to the from-parent + from-index. Both paths run with bypass so the interceptor doesn't fight them. Refs #77434.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +588 B (+0.01%) Total Size: 7.92 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 6f205be. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25407196070
|
…suggest-mode-6c-move-mechanism # Conflicts: # packages/editor/src/components/suggestion-mode/provider.js
What
Adds the data-layer mechanism for block-move suggestions (#77434, task 6c). In Suggest mode a moved block stays at its new position but is tagged with
metadata.suggestion = { type: 'pending-move', fromAnchorClientId, fromParentClientId, fromIndex }. Auto-save persists as ablock-moveop; Apply clears the marker; Reject runsmoveBlockToPositionto revert.Visual treatment lands in the next PR (#77979).
How
Move detection uses two signals:
[A,B,C,D]tags only B.Testing
Stack
Refs #77434, #73411.