Repository navigation
Description
Description
Description:
When a collaborator has an active multi-block selection, deleting the first or last block of that selection (either by the selecting user themselves, or by another collaborator) causes the entire selection-awareness overlay to disappear — not just for the deleted block, but for the whole selection. This affects both the observer's view and, shortly after, the selecting user's own view once the deletion syncs.
Expected behavior:
Deleting one endpoint block of a multi-block selection should update the awareness overlay to reflect the remaining valid selection, similar to how deleting a middle block does not clear the whole overlay.
Actual behavior:
- On User B's (the deleter's) screen: User A's entire awareness overlay — both the highlight and the avatar — disappears immediately.
- On User A's screen: their own selection also clears shortly after, once the deletion syncs via Yjs.
- Deleting a middle block (not an endpoint) does not reproduce this — only first/last block deletion does.
Root cause (two independent, pre-existing layers):
- Rendering layer —
computeMultiBlockOverlayRects(inpackages/editor/src/components/collaborators-overlay/) looks up selection endpoint blocks via[data-block]DOM selector. When an endpoint block is deleted, the lookup fails and the function returns{}, clearing all rects for the entire selection rather than just the affected endpoint. This mirrors an existing defensive early-return already present on trunk for single-blockWholeBlockselections. - Yjs layer — Once the deletion syncs to the selecting user, their stored
Y.RelativePositionanchor for the deleted endpoint can no longer be resolved.resolveSelectionthrows; the surroundingtry/catchswallows the error silently, clearing awareness on the selecting user's side too.
Additional context:
- Both root causes pre-date the most recent multi-block awareness overlay work and are not introduced by it, though they were surfaced during testing of that work.
- A partial fix is possible on the rendering layer alone (fall back to the remaining valid blocks when an endpoint block is deleted, instead of clearing everything), but a full fix also requires addressing
Y.RelativePositionresolution on the Yjs layer. - Screen recording attached: [attach video here]
Step-by-step reproduction instructions
Steps to reproduce:
- Open a post with multiple blocks in two collaborator sessions (User A and User B) with real-time collaboration enabled.
- User A selects multiple blocks with Ctrl+A (or a drag selection spanning several blocks).
- User B deletes the first or last block within that selection range.
- Observe both User B's screen and User A's screen.
Screenshots, screen recording, code snippet
Screen.Recording.2026-07-04.140734.mp4
Environment info
Environment:
- Gutenberg version: 7.1-alpha-62588
- Real-time collaboration enabled: Yes
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Activity
dilipom13 commentedon Aug 28, 2026
Hello Team
I want to work on the rendering-layer fix for this issue.