Skip to content

Real-time collaboration: Remove block client IDs from Awareness, fix …#76090

Closed
alecgeatches wants to merge 1 commit intowp/7.0from
merge/rtc-relative-block-positioning
Closed

Real-time collaboration: Remove block client IDs from Awareness, fix …#76090
alecgeatches wants to merge 1 commit intowp/7.0from
merge/rtc-relative-block-positioning

Conversation

@alecgeatches
Copy link
Copy Markdown
Contributor

What?

Backport #75590 to wp/7.0.

…"Show Template" view (#75590)

* Use relative position .parent traversal instead of block client ID when sharing and drawing awareness information

* Fix "Show Template" mode by mapping remote positions into absolute block paths

* Add tests for block resolution for post-editor-awareness

* Remove inner blockPathResolver, use getBlockPathForLocalClientId utility funciton

* Make utility function naming a bit easier to follow - change "getAbsolutePositionIndex()" to "convertSelectionStateToAbsolute()", have it return "localClientId" instead of "blockClientId"

* Move block lookup functions into block-lookup utils file, improve types

* Remove EditorStoreBlock from exported types

* Compare relative positions with Yjs built-in function

* Replace areSelectionsStatesEqual() relative position comparison with compareRelativePositions() as well

* Fix types and tests from crdt-user-selections

* Add a guard to avoid getting blocks when path is empty

* Rename "useConvertSelectionStateToAbsolute" to "useResolvedSelection"

* Add unit tests for getBlockPathInYdoc, resolveBlockClientIdByPath, avoid exporting inner helper functions
@alecgeatches alecgeatches self-assigned this Mar 3, 2026
@alecgeatches alecgeatches requested a review from nerrad as a code owner March 3, 2026 15:16
@github-actions github-actions bot added [Package] Core data /packages/core-data [Package] Editor /packages/editor labels Mar 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

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: alecgeatches <alecgeatches@git.wordpress.org>

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

@chriszarate
Copy link
Copy Markdown
Contributor

No longer necessary.

@chriszarate chriszarate closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Core data /packages/core-data [Package] Editor /packages/editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants