Suggest mode 6c: Render block-move pending state in canvas and sidebar#77979
Suggest mode 6c: Render block-move pending state in canvas and sidebar#77979adamsilverstein wants to merge 6 commits intosuggest-mode-6c-move-mechanismfrom
Conversation
Brings the visual treatment for block-move suggestions: - style.scss adds the pending-move treatment: 70% opacity plus a dotted green outline. The dotted style distinguishes it from the dashed pending-insert (the block existed before — only its position is suggested) and the solid bracket used by pending attribute edits. - suggestion-summary.js adds a "Move block: <name>" line via the same friendlyBlockName helper used by the other structural ops. - suggestion-diff.js adds BlockMoveDiff, which renders a "Moved <name> from <position> to <position>" sentence so reviewers can verify the proposed motion without the canvas open. Block content stays the same — only its position changed — so a content diff would just be noise. 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: +280 B (0%) Total Size: 7.92 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 5712f21. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25408893969
|
…into suggest-mode-6c-move-ui
The dotted outline plus 70% opacity alone was not strong enough to unambiguously communicate "this is a preview" on the reviewer's screen. On a fresh load the moved block can read like a regular drag-and-drop result, especially in intents that don't tint the canvas with Suggest- mode chrome. Add a small green tab pinned to the top-left corner that reads "Suggested move" so the preview state is obvious from the canvas without having to open the sidebar.
The structural-marker class HOC reads metadata.suggestion.type from the block-editor store and is intentionally not gated on isSuggestMode — a reviewer in Edit intent must still see the pending-remove strikethrough, the pending-insert dashed outline, and the pending-move dotted outline, since the marker is the only visual signal that a structural change is proposed but not yet applied. The existing test coverage stopped at the marker→class mapping table, so a regression in the gating could have shipped silently. Lift the HOC to a named export (was previously only registered as a filter) and add cases for each marker type in both Edit and Suggest intents.
What
Adds the visual treatment for block-move suggestions (#77434, task 6c). Pairs with the mechanism PR (#77978).
metadata.suggestion = { type: 'pending-move' }renders at 70% opacity with a dotted green outline at its new position. Three distinct outline styles communicate three distinct kinds of structural change: solid bracket (attribute edit), dashed (insert), dotted (move).How
style.scss: pending-move styling (70% opacity + dotted green outline).suggestion-summary.js: handlesblock-moveops with a "Move block: " line.suggestion-diff.js:BlockMoveDiffrenders a from→to descriptor.Testing
This is the final PR in the stack — once merged, structural suggestions for insert / remove / move are fully shipped under issue #77434. Phase 6d (Yjs
AttributionManager-backed) tracks separately.Stack
Refs #77434, #73411.