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 1 commit into
Conversation
|
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: +559 B (+0.01%) Total Size: 8.59 MB 📦 View Changed
|
|
Flaky tests detected in 6f205be. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25407196070
|
43aa1d1 to
e1d5977
Compare
6f205be to
43d6215
Compare
e1d5977 to
2968668
Compare
43d6215 to
7d1657c
Compare
2968668 to
ba2a3b7
Compare
7d1657c to
75a6a73
Compare
ba2a3b7 to
37984e4
Compare
75a6a73 to
0828f5c
Compare
37984e4 to
96a19c0
Compare
0828f5c to
9fec5ed
Compare
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.
96a19c0 to
26727b9
Compare
9fec5ed to
b0d4b37
Compare
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.