Skip to content

List View: Speed up opening by removing a forced style recalculation - #80929

Merged
Mamaduka merged 1 commit into
trunkfrom
perf/list-view-opening-aria-ref
Jul 31, 2026
Merged

List View: Speed up opening by removing a forced style recalculation#80929
Mamaduka merged 1 commit into
trunkfrom
perf/list-view-opening-aria-ref

Conversation

@Mamaduka

@Mamaduka Mamaduka commented Jul 30, 2026

Copy link
Copy Markdown
Member

What?

PR replaces the imperative textContent self-assignment in AriaReferencedText with a key on the element, so React replaces the node instead of updating its text in place.

Why?

AriaReferencedText renders once per List View row. Its useEffect set textContent on the node after every commit, invalidating the style for the whole document. Because that write lands between layout reads, the next reader pays for a full style recalculation, twice per open.

Testing Instructions

Same as in #51035.

  1. Use Firefox.
  2. Create a post and add some blocks (5 paragraphs for instance).
  3. Enable List view.
  4. Try to navigate and delete a block inside the list view. (Using the options menu for deletion is recommended to ignore a known issue of screen readers sometimes skip announcing the focused element after deleting with keyboard shortcut for now.)
  5. Expect the screen readers to announce the correct description for the focused element.

Testing Instructions for Keyboard

Same.

Screenshots or screencast

The last two Perf checks on run CI for listViewOpen metric.

CleanShot 2026-07-30 at 13 37 47 CleanShot 2026-07-30 at 14 24 03

Use of AI Tools

Assisted by Claude.

@Mamaduka Mamaduka self-assigned this Jul 30, 2026
@Mamaduka Mamaduka added [Type] Performance Related to performance efforts [Feature] List View Menu item in the top toolbar to select blocks from a list of links. labels Jul 30, 2026
@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Jul 30, 2026
@Mamaduka
Mamaduka force-pushed the perf/list-view-opening-aria-ref branch from cd5cb5a to 861514a Compare July 30, 2026 09:01
@github-actions

Copy link
Copy Markdown

Size Change: -29 B (0%)

Total Size: 7.76 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 428 kB -29 B (-0.01%)

compressed-size-action

@github-actions

Copy link
Copy Markdown

Flaky tests detected in 861514a.
Some 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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30528988137
📝 Reported issues:

@Mamaduka
Mamaduka marked this pull request as ready for review July 30, 2026 10:28
@Mamaduka
Mamaduka requested a review from ellatrix as a code owner July 30, 2026 10:28
@github-actions

github-actions Bot commented Jul 30, 2026

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: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>

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

@Mamaduka

Copy link
Copy Markdown
Member Author

Did a combined run of all three PRs, perf improvement is almost 50% - #80984.

Screenshot

CleanShot 2026-07-30 at 21 06 20

@andrewserong andrewserong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh clever! Yeah, we're only ever passing a string to this, so this feels like a safe change, and it's testing just as on trunk in Firefox with Voice Over on Mac for me.

@Mamaduka

Copy link
Copy Markdown
Member Author

Thanks for testing, @andrewserong 🙇

@Mamaduka
Mamaduka merged commit 558ef39 into trunk Jul 31, 2026
51 checks passed
@Mamaduka
Mamaduka deleted the perf/list-view-opening-aria-ref branch July 31, 2026 05:44
@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Package] Block editor /packages/block-editor [Type] Performance Related to performance efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants