Skip to content

Render block-insert pending state - #77973

Closed
adamsilverstein wants to merge 5 commits into
suggest-mode-6b-insert-mechanismfrom
suggest-mode-6b-insert-ui
Closed

adamsilverstein wants to merge 5 commits into
suggest-mode-6b-insert-mechanismfrom
suggest-mode-6b-insert-ui

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented May 5, 2026 •

Copy link
Copy Markdown
Member

What

Adds the visual treatment for block-insert-after suggestions (#77434, task 6b). Pairs with the mechanism PR (#77971).

  • A block flagged with metadata.suggestion = { type: 'pending-insert' } renders at 70% opacity with a dashed green outline.
  • The notes sidebar shows an "Insert block: paragraph" summary line and an underlined preview of the inserted block's content.

How

  • style.scss: pending-insert styling (70% opacity + dashed green outline).
  • suggestion-summary.js: handles block-insert-after ops with an "Insert block: " line.
  • suggestion-diff.js: BlockInsertDiff renders the captured snapshot via collectBlockText with <ins> styling.

Testing

  • 137 unit tests pass. Lint and stylelint clean.
  • For full-stack testing instructions, see the foundations PR (#77967).

Stack

  1. #77967 — Schema v2 bump (foundations)
  2. #77968 — Capture block-remove (mechanism)
  3. #77970 — Render block-remove preview (UI)
  4. #77971 — Capture block-insert-after (mechanism)
  5. #77973 — Render block-insert-after preview (UI)
  6. #77978 — Capture block-move (mechanism)
  7. #77979 — Render block-move preview (UI)

Refs #77434, #73411.

@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions Bot added the [Package] Editor /packages/editor label May 5, 2026
@github-actions

github-actions Bot commented May 5, 2026 •

Copy link
Copy Markdown

Size Change: +98 B (0%)

Total Size: 7.52 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 485 kB +7 B (0%)
build/styles/editor/style-rtl.css 31.1 kB +24 B (+0.08%)
build/styles/editor/style-rtl.min.css 26.5 kB +21 B (+0.08%)
build/styles/editor/style.css 31.2 kB +25 B (+0.08%)
build/styles/editor/style.min.css 26.5 kB +21 B (+0.08%)

compressed-size-action

@github-actions

github-actions Bot commented May 5, 2026 •

Copy link
Copy Markdown

Flaky tests detected in 6125134.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/28184704005
📝 Reported issues:

@adamsilverstein
adamsilverstein force-pushed the suggest-mode-6b-insert-mechanism branch from 9a1fb2d to 4cd8b0d Compare June 17, 2026 21:12
@adamsilverstein
adamsilverstein force-pushed the suggest-mode-6b-insert-ui branch from ba2a3b7 to 37984e4 Compare June 17, 2026 21:12
@adamsilverstein
adamsilverstein force-pushed the suggest-mode-6b-insert-mechanism branch from 4cd8b0d to e2f987d Compare June 17, 2026 21:20
@adamsilverstein
adamsilverstein force-pushed the suggest-mode-6b-insert-ui branch from 37984e4 to 96a19c0 Compare June 17, 2026 21:20
…debar

Brings the visual treatment for block-insert-after suggestions:

- style.scss adds the pending-insert treatment: 70% opacity plus a
  dashed green outline. The dashed style distinguishes it from the
  solid bracket used by pending attribute edits — both treatments can
  apply to the same block when a user inserts and then immediately
  edits its attributes.

- suggestion-summary.js adds an "Insert block: <name>" line via the
  same friendlyBlockName helper that handles block-remove. Falls
  back to "block" when the op carries no name.

- suggestion-diff.js adds BlockInsertDiff, which renders the captured
  block snapshot's text via collectBlockText with <ins> styling. When
  the inserted block has no text yet (an empty paragraph), falls back
  to a "New block: <name>" label so the sidebar isn't blank.

Refs #77434.
@adamsilverstein
adamsilverstein force-pushed the suggest-mode-6b-insert-mechanism branch from e2f987d to 7925cae Compare June 18, 2026 06:31
@adamsilverstein
adamsilverstein force-pushed the suggest-mode-6b-insert-ui branch from 96a19c0 to 26727b9 Compare June 18, 2026 06:32
@adamsilverstein adamsilverstein changed the title Suggest mode 6b: Render block-insert-after pending state in canvas and sidebar Suggest mode: Render block-insert pending state Jun 30, 2026
@adamsilverstein adamsilverstein changed the title Suggest mode: Render block-insert pending state Render block-insert pending state Jun 30, 2026
@adamsilverstein

Copy link
Copy Markdown
Member Author

Superseded by the fresh-stack restructure of Suggest mode (#73411).

The feature has been re-sliced from this 16-deep stack onto current trunk as a clean 2-PR stack:

The whole feature now sits behind a Suggestion Mode experiment (Settings → Experiments → Collaboration). Closing in favour of the new stack — details: #73411 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Notes Phase 3 of the Gutenberg roadmap around block commenting [Package] Editor /packages/editor [Status] In Progress Tracking issues with work in progress [Type] Feature New feature to highlight in changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant