Skip to content

Fix : Note position#76344

Open
Vrishabhsk wants to merge 1 commit intoWordPress:trunkfrom
Vrishabhsk:fix/notes-position
Open

Fix : Note position#76344
Vrishabhsk wants to merge 1 commit intoWordPress:trunkfrom
Vrishabhsk:fix/notes-position

Conversation

@Vrishabhsk
Copy link
Copy Markdown
Contributor

What?

Why?

The Notes feature uses @floating-ui/react-dom to position floating comment threads alongside their associated blocks. However, in one scenario the calculated y position was found to become negative:

  1. Hidden blocks - When a block with a note is hidden and then reselected

Negative y values cause the floating note to be positioned outside the visible viewport, making it appear as if the note position was "lost".

How?

Changes to packages/editor/src/components/collab-sidebar/hooks.js

  • Modified useFloatingThread hook to clamp the y position to a minimum of 0
  • Renamed the returned y value from useFloating to floatingY before applying the clamp
  • Added Math.max( 0, floatingY ) to ensure the note is never positioned at a negative coordinate

Preview

Screen.Recording.2026-03-10.at.12.59.22.PM.mov

@github-actions github-actions bot added the [Package] Editor /packages/editor label Mar 10, 2026
@github-actions
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: Vrishabhsk <vrishabhsk@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@carolinan carolinan added [Feature] Notes Phase 3 of the Gutenberg roadmap around block commenting [Type] Bug An existing feature does not function as intended labels Mar 17, 2026
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 [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notes: Some scenarios where positions can be lost

2 participants