Skip to content

Hide the hover inserter below text blocks - #81550

Draft
ellatrix wants to merge 5 commits into
trunkfrom
try/hide-inserter-between-text
Draft

ellatrix wants to merge 5 commits into
trunkfrom
try/hide-inserter-between-text

Conversation

@ellatrix

@ellatrix ellatrix commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

What?

See #81453. The hover inserter between blocks no longer appears where pressing Enter already creates a block: below paragraphs, headings, list items, and other blocks that split.

Why?

Hovering across text keeps flashing an inserter between every line, and it gets in the way while writing. Below a text block it adds nothing: Enter at the end of the block creates an empty block in the same spot, which shows you an inserter + allows you to insert blocks with the slash command.

How?

  1. In the hook that shows the hover inserter, the boundary is hidden when the block above it splits on Enter (the splitting support: paragraph, heading, list item, button) and the container flows vertically. Horizontal rows keep the inserter everywhere, so the Buttons block is unaffected even though buttons split.
  2. Clicking the gap between blocks was handled by the insertion point itself, so where it is now hidden, the click handler takes over: the caret moves to the end of the block below the gap, the same place a click on the visible insertion point puts it.
  3. Drag and drop indicators, the other inserters, the document edges, and keyboard insertion are untouched.

Testing Instructions

  1. Write a few paragraphs. Hovering between them shows no inserter; clicking between them still places the caret.
  2. Add two images. Hovering between them shows the inserter.
  3. Add a Buttons block with two buttons. Hovering between the buttons shows the inserter.
  4. Drag a block around: the drop indicators are unchanged.

Testing Instructions for Keyboard

Unchanged: Enter, the slash inserter, and the toolbar inserters work as before.

Screenshots or screencast

Between two images Between two paragraphs
The inserter appears in the gap between two image blocks No inserter appears in the gap between two paragraphs

🤖 Generated with Claude Code

The plus that appears when hovering the gap between blocks gets in the
way when writing prose. In vertical lists, hide it at any boundary
below a block whose type has the splitting support: pressing Enter at
the end of such a block already creates a block there with the caret
in it. Splitting at the start of a block leaves the caret behind, so
the boundary above such a block keeps the inserter. Horizontal rows
keep it everywhere.

The boundaries before the first block and after the last one now
follow the same rule instead of never showing the inserter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Aug 13, 2026
@ellatrix ellatrix mentioned this pull request Aug 13, 2026
33 of 70 tasks
@github-actions

github-actions Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Size Change: +142 B (0%)

Total Size: 7.72 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 460 kB +142 B (+0.03%)

compressed-size-action

Serialized content strings hid the block structure. Inserting leaves
the last block selected, and its floating toolbar sits where these
tests hover, so the selection is cleared after the setup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ellatrix ellatrix changed the title Show the hover inserter only where typing cannot add a block Hide the hover inserter below text blocks Aug 13, 2026
ellatrix and others added 3 commits August 12, 2026 17:38
The change is a removal: the inserter leaves the gaps below text
blocks. Showing it before the first block and after the last one,
where it never appeared, is a separate idea for a separate change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Clicking the gap between blocks used to be handled by the insertion
point overlay, so hiding it left the click doing nothing. The hover
and click handlers now share the boundary resolution, and a click on
a hidden boundary places the caret at the end of the block below,
exactly like a click on the visible insertion point.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Flaky tests detected in db5eb26.
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/31658493990
📝 Reported tests:

adds and activates a new tab when pressing Enter at the end of a tab label in /test/e2e/specs/editor/blocks/tabs.spec.js, passed after 1 failed attempt.
Error: expect(locator).toHaveCount(expected) failed

Locator:  locator('[name="editor-canvas"]').contentFrame().getByRole('tab')
Expected: 3
Received: 2
Timeout:  5000ms

Call log:
  - Expect "toHaveCount" with timeout 5000ms
  - waiting for locator('[name="editor-canvas"]').contentFrame().getByRole('tab')
    14 × locator resolved to 2 elements
       - unexpected value "2"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/tabs.spec.js:146:25
inserts a block in proper place after having clicked `Browse All` from inline inserter in /test/e2e/specs/editor/various/inserting-blocks.spec.js, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → GET http://localhost:8889/wp-json/wp/v2/blocks?per_page=100&status=publish%2Cfuture%2Cdraft%2Cpending%2Cprivate%2Ctrash
    - user-agent: Playwright/1.62.1 (x64; ubuntu 24.04) node/20.20 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: 7554f43370
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1786758393%7C4C5iHmp5wQ0yBR7LHMWsS4jC4jyUxebQ84BfrLpcaiK%7C8a405ccbcb2d68f6a983281f1535269de70f643c006a2429d5bb402b89e4c8f8; wp-settings-time-1=1786585593

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:112:39)
    at RequestUtils.deleteAllBlocks (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/blocks.ts:23:28)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/inserting-blocks.spec.js:11:22

This branch has not been deployed

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

Labels

[Package] Block editor /packages/block-editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant