Repository navigation
Notes: keep a floating thread in place when its block is hidden - #81549
adamsilverstein wants to merge 12 commits into
Conversation
A block hidden at the current viewport renders nothing once it is deselected, so its note threads lose the element they anchor to. Add a pure helper that resolves the gap such a block leaves between its rendered neighbours, centred where the block itself sits while selected (back in the DOM, collapsed to zero height), so callers have a rect to position those threads with.
Threads whose block has no rendered element came back from the board with no rect, so the position loop skipped them and they fell to their static position at the top of the notes panel. Substitute the boundary rect for those threads inside the existing rAF read batch, and stop getFirstBlockElement returning a hidden block's null entry, which cost the board its scroll container.
A thread anchored to a hidden block sits next to content it does not belong to and highlights nothing on hover, with no explanation. Show the same notice the block inspector uses - while the block is out of the DOM and while it is selected but still invisible - and give the thread an accessible name that carries the state to screen readers.
Measure against a noted block that is not the first one: a thread that lost its anchor parks at the top of the panel, which coincidentally matches a first block's position.
|
Size Change: +477 B (+0.01%) Total Size: 7.92 MB 📦 View Changed
|
Resolve CHANGELOG conflict by keeping both Unreleased bug-fix entries.
|
Flaky tests detected in 569b024. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/33116216951 refuses the drop and uploads nothing in
|
Take trunk's board store and floating board hook from #83485; the hidden-block anchor is rebuilt on top of them in the following commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFNXAzK5ogseY5tCtU2x53
The floating board now measures in the store's ResizeObserver pass (#83485), so the stand-in anchor for a block with no rendered element moves there from the old rAF batch. Threads register their block's client ID and the store keeps the document's block order, so it can place the thread between the neighbours that are rendered. With every noted block hidden, the store finds the canvas root from the threads' document instead. Neighbours inside collapsed content are skipped, since they still report their expanded box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFNXAzK5ogseY5tCtU2x53
The floating alignment tests moved to block-notes-floating.spec.js on trunk, so the hidden-block cases follow them and reuse its helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFNXAzK5ogseY5tCtU2x53
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +466 B (+0.01%) Total Size: 8.51 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
Resolve the note-position sort conflict by keeping trunk's toSorted() and the branch's comment about hidden blocks sharing a boundary rect. Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
The 15.2.0 release renamed the Unreleased heading, stranding this PR's entry under a published version and failing the changelog check. Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
Rebuilt on top of #83485 with Claude, which also rewrote this description:
AI Use
Code and description both came out of a session with 🤖 Claude Code, including the rebuild on #83485. I will review and test.