Repository navigation
Conversation
🤖 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +374 B (0%) Total Size: 8.68 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
🏁 Flaky testsSome 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. List in
|
| const MIN_BUFFER_ROWS = 10; | ||
| const MAX_BUFFER_ROWS = 40; |
There was a problem hiding this comment.
These were tuned with a perf probe. A minimum of 20 or 30 dropped more frames (28 or 50 against 19). A maximum of 70 halved the dropped frames, but each one got longer (54ms against 42ms).
| if ( coversRows( listWindow, first, last, 0 ) ) { | ||
| setFixedListWindow( nextWindow ); | ||
| } else { | ||
| flushSync( () => setFixedListWindow( nextWindow ) ); | ||
| } |
There was a problem hiding this comment.
Always using flushSync would let us drop the ref, but it measured worse: jank went up 31%, and dropped frames doubled with a 4x CPU throttle. startTransition for the deferred case made no difference.
|
|
||
| const { getBlock, getSelectedBlockClientIds } = | ||
| useSelect( blockEditorStore ); | ||
| const { visibleBlockCount } = useSelect( |
There was a problem hiding this comment.
The new hook doesn't need the total row count, so List View no longer subscribes to the global block count.
Move the window in chunks and follow whichever ancestor scrolls the list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Set the content with editor.setContent, check for blank rows with a viewport assertion, and mark the tests to remove before merge. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
6590639 to
044bdf1
Compare
Read the focused row when the window moves and keep it rendered, so scrolling it out of view does not drop focus. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested on macOS (Chrome). Followed the testing instructions with a post of 200 paragraphs:
Everything works cleanly and as described. Screen.Recording.2026-11-19.at.3.43.54.PM.mp4 |
|
Thanks, @noruzzamans! The List View open metric changes also look promising. Screenshot
|
Drop the itemInView closure left over from useFixedWindowList, and cover native scrolling across browsers with the wheel test alone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
That ~22% speedup on listViewOpen is great to see! |
| const [ fixedListWindow, setFixedListWindow ] = useState< FixedListWindow >( | ||
| () => ( { | ||
| start: 0, | ||
| end: Math.ceil( window.innerHeight / BLOCK_LIST_ITEM_HEIGHT ), | ||
| } ) | ||
| ); |
There was a problem hiding this comment.
Reposting, since the earlier comment got detached when this was inlined. Sizing the first window from innerHeight avoids reading layout while the list opens. The cost is about 3 extra rows on a 1080px viewport, which opens about 1ms slower than trunk. 720px and 1440px open faster.
| const focusedRow = | ||
| ownerDocument.activeElement?.closest< HTMLElement >( | ||
| '[data-block]' | ||
| ); |
There was a problem hiding this comment.
The first attempt kept the focused block in state and passed it through context, which re-rendered the whole tree on every focus move. Reading it here costs nothing, since the tree already re-renders when the window moves. A scroll probe measured the same main-thread work with and without the pin. Trunk has the same focus drop, so this isn't a regression fix for the new hook.
| const blockInView = | ||
| blockListPosition >= start && blockListPosition < end; |
There was a problem hiding this comment.
itemInView was a leftover from the useFixedWindowList API. A plain range does the same job and measured no difference in the scroll probe.
It is the only test that checks the key still pages the list now that the browser handles it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
lancewillett
left a comment
There was a problem hiding this comment.
Before removing the temporary E2E cases, could you keep one browser test for useListViewWindow? Open the dropdown far down a scrolled page, scroll its panel 1,000 pixels, and assert that row 35 is visible.
In a local Chrome comparison, the first row appeared on open in all three runs with both hooks. After scrolling, row 35 was missing in all three runs with the hook from before #87019 and visible in all three with this PR. That assertion catches the regression and lets us remove the temporary editor scenario. Dropdown assertions
AI review · gpt-6
Starting to observe the scroll container from inside the observer's own callback made the browser report a ResizeObserver loop error on mount. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Thanks for the review, @lancewillett! Added Writing the test surfaced a |
The page scroll could land before the panel was clipped, which grows the window past the row the test checked. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>


What?
See #87019
Replaces
useFixedWindowListin List View withuseListViewWindow, a hook colocated with the component. Home, End, Page Up and Page Down pressed in another field no longer scroll the list, a list panel that grows without a window resize no longer leaves blank rows, and a focused row keeps focus when it scrolls out of view.Why?
The old hook moved the render window for every row scrolled, which re-rendered the whole tree each time. It also listened for navigation keys on the window and re-measured only on window resize. List View was its only consumer.
How?
The window now moves in chunks: only when fewer than 10 spare rows remain past the viewport, and then far enough to render 40. Scroll is captured on the document so the hook follows whichever ancestor scrolls the list, a
ResizeObserverwatches the list's ancestors, and navigation keys are left toTreeGridand the browser. When the window moves, the hook also records the focused row, whichListViewBranchkeeps mounted. This is a minor optimization for scrolling long lists; each window move is a longer frame than before, so very fast scrolling can drop a few more frames.useFixedWindowListitself is unchanged.Testing Instructions
max-height: 200pxto.editor-list-view-sidebar, scroll the list down, then remove the rule. Rows fill the taller panel.Testing Instructions for Keyboard
Use of AI Tools
Assisted by Claude.