Skip to content

Interactivity API: Show the new page's server content in kept data-wp-html elements - #86416

Merged
luisherranz merged 24 commits into
trunkfrom
fix/interactivity-data-wp-html-kept-element-server-content
Nov 6, 2026
Merged

luisherranz merged 24 commits into
trunkfrom
fix/interactivity-data-wp-html-kept-element-server-content

Conversation

@luisherranz

Copy link
Copy Markdown
Member

What?

Follow-up to #84889 and #84924.

A data-wp-html element that client-side navigation keeps in a router region now shows the new page's server-rendered content when its value on the new page is { "wpServerHtml": true } or pending, instead of the content it had on the previous page. This removes the known limitation that #84889 added to the wp-html reference.

Why?

Navigation keeps the DOM element at the same place in a router region, and the directive left a kept element's content alone for these two values. So after navigating, the element went on showing the previous page's content while the new page's HTML held different content for it. A data-wp-html element the navigation creates, and a kept data-wp-text element with a pending value, already showed the new page's content.

How?

  • toVdom() already keeps a script-free snapshot of each data-wp-html element's server content (Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types #84924). It now also records whether a snapshot comes from the document's markup or from <template> content, and a package-internal getHtmlServerContent() returns only the first kind, so kept data-wp-each items never show their template's content.
  • A kept element whose vnode carries a different snapshot than at its previous commit is given the new content for the navigation that brought it: the update that renders the new page, and the data-wp-watch callbacks that update notifies, which run one frame later. A callback that copies the server representation into the element's value, as the guides recommend, therefore works too.
  • While that lasts, if the element's value is the marker or pending, the directive copies the snapshot's nodes with importNode(). Copying nodes isn't a Trusted Types sink, so showing the content writes no HTML string and calls no policy. The content comes only from the new page's server-rendered HTML, without its <script> elements.
  • Each element records which server content it shows, and the directive copies new content only when it differs. The comparison is isEqualNode() plus the contents of <template> elements, which isEqualNode() ignores. An element showing unchanged content keeps its nodes, along with changes scripts or the visitor made to them after the page hydrated, such as an opened <details> or an added class.
  • Tokens, null and invalid values, hydration, elements the navigation creates, elements outside router regions and data-wp-each items keep their behavior. The router is unchanged.
  • The wp-html reference and the @wordpress/interactivity changelog describe the new outcome.

Limitations and follow-ups

  • Follow-up: with a getter that reads getServerContext(), a value that goes from the marker on the previous page to a token, null, undefined or an invalid value on the new page still sees the previous page's value in the navigation's first render. The new page's server content is inserted for a moment and replaced within the same update, so the final DOM is right and nothing is painted in between, but images and media in that content may start loading. A getter that reads getServerState() is not affected. This is accepted for this PR and left as a follow-up. A getter that returns a pending value on the previous page behaves the same way; no documented consumer was found that switches like this between pages.
  • On the page the visitor first loaded, content that a script changed before the page hydrated, or that holds <noscript> elements, doesn't count as the same server content. It is replaced when navigating away from that page, and can be when navigating back. The reference now says so.

Testing Instructions

  1. Activate the "Gutenberg Test Interactive Blocks" plugin (it ships with the e2e test environment). In the code editor, create two published pages: page two with <!-- wp:test/router-html-server {"page":"two"} /-->, and page one with <!-- wp:test/router-html-server {"page":"one","next":"<URL of page two>"} /-->.
  2. Open page one. Next to "content from one", the elements show One.
  3. Click "Next". With this PR the elements show Two. On trunk they keep showing One.
  4. Go back and forward in the browser: the elements follow the page each time.
  5. Automated:
    • npm run test:unit:vitest -- packages/interactivity packages/interactivity-router
    • npm run test:e2e -- test/e2e/specs/interactivity/router-html-server.spec.ts test/e2e/specs/interactivity/router-html.spec.ts test/e2e/specs/interactivity/directive-html.spec.ts

Testing Instructions for Keyboard

No UI changes.

Use of AI Tools

100% of the code, tests, and comments in this PR were autonomously generated by AI and reviewed by @luisherranz before the PR was opened.

…-html elements whose value is the server representation
…dered content across navigation in the browser
…ement until the navigation's data-wp-watch callbacks have run
…hose value a data-wp-watch callback syncs after navigation
…ct's dependencies, which the vnode already covers
…unchanged server content keeps its nodes after navigation
…alike that copying content calls no Trusted Types policy
…'s dependencies, which the hooks lint rule requires
…pt-nodes statement in the data-wp-html reference
… script changed before hydration is replaced on navigation
…s from the server representation into a token or null
@github-actions github-actions Bot added [Package] E2E Tests /packages/e2e-tests [Package] Interactivity /packages/interactivity [Package] Interactivity Router /packages/interactivity-router labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

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: luisherranz <luisherranz@git.wordpress.org>
Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +67 B (0%)

Total Size: 8.62 MB

📦 View Changed
Filename Size Change
build/modules/core-fields/attachment.min.js 39.3 kB -38 B (-0.1%)
build/modules/core-fields/post_type_supports.min.js 76 kB -31 B (-0.04%)
build/modules/core-fields/wp_template_part.min.js 34.4 kB -36 B (-0.1%)
build/modules/core-fields/wp_template.min.js 5.55 kB -35 B (-0.63%)
build/modules/interactivity/index.min.js 16.5 kB +226 B (+1.39%)
build/styles/edit-site/style-rtl.css 20.6 kB -2 B (-0.01%)
build/styles/edit-site/style-rtl.min.css 16.6 kB -3 B (-0.02%)
build/styles/edit-site/style.css 20.6 kB -2 B (-0.01%)
build/styles/edit-site/style.min.css 16.6 kB -3 B (-0.02%)
build/styles/editor/style-rtl.css 31.4 kB -2 B (-0.01%)
build/styles/editor/style-rtl.min.css 27.1 kB -3 B (-0.01%)
build/styles/editor/style.css 31.5 kB -2 B (-0.01%)
build/styles/editor/style.min.css 27.1 kB -2 B (-0.01%)

59a1399 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 371ba12 trunk % Change
timeToFirstByte 44.15 ms +11.21% -3.28% 45.05 ms +4.55% -3.44% -2%
largestContentfulPaint 76 ms +7.89% -5.26% 76 ms +5.26% -5.26% 0%
lcpMinusTtfb 29.75 ms +15.63% -8.07% 29.55 ms +17.77% -6.09% 0.68%
wpBeforeTemplate 22.95 ms +16.47% -3.53% 23.44 ms +2.39% -4.39% -2.09%
wpTemplate 17.86 ms +4.93% -4.93% 18.17 ms +4.51% -6.05% -1.71%
wpTotal 40.58 ms +12.52% -2.98% 41.4 ms +5.48% -3.24% -1.98%
wpMemoryUsage 7.72 MB +0% -0% 7.68 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 371ba12 trunk % Change
timeToFirstByte 36 ms +8.19% -3.06% 36.25 ms +3.86% -2.76% -0.69%
largestContentfulPaint 80 ms +2.5% -2.5% 80 ms +0% -5% 0%
lcpMinusTtfb 44 ms +2.05% -5.34% 42.85 ms +3.85% -2.22% 2.68%
wpBeforeTemplate 19.4 ms +8.97% -0.93% 19.55 ms +2.66% -2.46% -0.77%
wpTemplate 13.45 ms +3.27% -4.76% 13.54 ms +7.09% -4.73% -0.66%
wpTotal 33.06 ms +9.01% -2.69% 33.61 ms +3.36% -3.96% -1.64%
wpMemoryUsage 6.41 MB +0% -0% 6.37 MB +0% -0% 0.53%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 371ba12 trunk % Change
mediaProcessingJpeg 331.37 ms +1.73% -0.88% 328.86 ms +1.06% -0.71% 0.76%
mediaProcessingAvif 4855.41 ms +0.58% -0.06% 4870.64 ms +0.35% -0.1% -0.31%
mediaProcessingJpegToAvif 3387.12 ms +0.22% -0.01% 3395.67 ms +0.08% -0.29% -0.25%

media-upload

Metric 371ba12 trunk % Change
jpegUploadProcessing 1433.51 ms +2.23% -0.46% 1431.62 ms +1.32% -0.65% 0.13%
pngUploadProcessing 219.99 ms +4.26% -6.04% 227.25 ms +2.75% -4.28% -3.19%
largeJpegUploadProcessing 1426.54 ms +0.51% -0.81% 1424.91 ms +0.59% -0.58% 0.11%
multipleImageUploadProcessing 1521.19 ms +1.49% -1.27% 1496.31 ms +1.14% -0.66% 1.66%

post-editor

Metric 371ba12 trunk % Change
serverResponse 473.15 ms +7.7% -8.35% 481.25 ms +1.15% -8% -1.68%
firstPaint 400.92 ms +25.13% -7.09% 389.66 ms +27.14% -10.42% 2.89%
domContentLoaded 877.16 ms +4.76% -3.18% 865.23 ms +2.88% -0.91% 1.38%
loaded 878.23 ms +4.77% -3.17% 866.45 ms +2.87% -0.91% 1.36%
firstContentfulPaint 509.93 ms +5.59% -2.33% 503.91 ms +1.48% -1.68% 1.19%
firstBlock 2223.45 ms +4.25% -2.67% 2225.05 ms +1.59% -0.82% -0.07%
type 17.76 ms +7.09% -8.16% 17.89 ms +3.3% -8.27% -0.73%
typeWithoutInspector 18.29 ms +7.6% -7.93% 18.92 ms +8.14% -6.13% -3.33%
typeWithTopToolbar 23.35 ms +9.04% -9.12% 23.61 ms +6.23% -3.13% -1.1%
typeContainer 8.4 ms +10.12% -10.95% 8.37 ms +5.85% -2.03% 0.36%
focus 118.95 ms +7.04% -10.61% 122.91 ms +8.57% -7.57% -3.22%
firstFocus 246 ms +0% -0% 236.35 ms +0% -0% 4.08%
selectAll 427.73 ms +3.5% -3.4% 406.84 ms +8.11% -1.93% 5.13%
undo 29.38 ms +5.21% -5.79% 30.45 ms +6.77% -3.94% -3.51%
listViewOpen 79.44 ms +14.51% -2.64% 84.61 ms +13.77% -8% -6.11%
inserterOpen 41.27 ms +7.58% -9.74% 40.73 ms +9.16% -3.93% 1.33%
inserterHover 11.73 ms +7.08% -11.34% 11.16 ms +11.2% -9.41% 5.11%
inserterSearch 8.79 ms +6.83% -2.05% 8.57 ms +10.5% -7.7% 2.57%
loadPatterns 661.93 ms +2.67% -5.1% 632.64 ms +6.92% -8.15% 4.63%
wpTotal 462.73 ms +8% -8.37% 471.4 ms +1.17% -8.15% -1.84%
wpMemoryUsage 14.76 MB +0% -0% 14.73 MB +0% -0% 0.24%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 371ba12 trunk % Change
serverResponse 390.99 ms +1.04% -7.99% 392.04 ms +1.36% -1.18% -0.27%
firstPaint 368.74 ms +10.62% -14.47% 370.29 ms +0.62% -6.84% -0.42%
domContentLoaded 847.61 ms +3.2% -1.85% 834.38 ms +2.76% -1.99% 1.59%
loaded 848.49 ms +3.21% -1.83% 835.22 ms +2.78% -1.97% 1.59%
firstContentfulPaint 479.68 ms +6.06% -0.89% 486.64 ms +0.66% -1.95% -1.43%
firstBlock 2347.58 ms +5.96% -1.83% 2348.65 ms +0.62% -0.46% -0.05%
type 17.83 ms +7.29% -9.2% 18.38 ms +12.3% -8.22% -2.99%
navigate 106.27 ms +5.8% -1.37% 107.05 ms +2.05% -4.94% -0.73%
loadPatterns 1253.37 ms +4.82% -9.15% 1273.52 ms +7.29% -6.66% -1.58%
loadPages 956.84 ms +1.02% -3.12% 960.41 ms +1.59% -2.36% -0.37%
wpTotal 381.49 ms +1.11% -8.2% 382.52 ms +1.38% -1.21% -0.27%
wpMemoryUsage 12.78 MB +0% -0% 12.74 MB +0% -0% 0.27%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

59a1399 Run

🏁 Flaky tests

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.

Page List converts to Navigation Links with entity bindings in /test/e2e/specs/editor/blocks/navigation.spec.js, passed after 1 failed attempt.
Error: expect(locator).toContainText(expected) failed

Locator: getByRole('region', { name: 'Editor settings' }).getByRole('tabpanel', { name: 'Content' }).getByRole('button', { name: /Link to:/ })
Expected substring: "test-page-1"
Received string:    "Link to:Cat/catPagePublished"
Timeout: 5000ms

Call log:
  - Expect "toContainText" getByRole('region', { name: 'Editor settings' }).getByRole('tabpanel', { name: 'Content' }).getByRole('button', { name: /Link to:/ }) with timeout 5000ms
  - waiting for getByRole('region', { name: 'Editor settings' }).getByRole('tabpanel', { name: 'Content' }).getByRole('button', { name: /Link to:/ })
    14 × locator resolved to <button type="button" aria-expanded="false" aria-haspopup="dialog" class="components-button link-preview-button is-next-40px-default-size is-secondary">…</button>
       - unexpected value "Link to:Cat/catPagePublished"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/navigation.spec.js:1949:31
Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 6,
+   "offset": 6,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5
Undo restores the post selection when another synced entity is loaded in /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 6,
+   "offset": 6,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5
Widget and dynamic blocks sync modifications between users in /test/e2e/specs/editor/collaboration/collaboration-block-gauntlet.spec.ts, passed after 1 failed attempt.
TimeoutError: locator.fill: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('spinbutton', { name: /Number of items/i })

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-block-gauntlet.spec.ts:1046:27
a navigation superseded by the traversal discharges to idle in /test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts, passed after 1 failed attempt.
SyntaxError: Unexpected token 'o', "not hydrated" is not valid JSON
    at readLog (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:28:14)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:47:24
    at waitForLogLength (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:46:2)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:693:5
does not select blocks in the canvas preview when editing from the sidebar (Site Editor v2) in /test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator: getByRole('combobox', { name: 'Search or type URL' })
Expected: focused
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeFocused" getByRole('combobox', { name: 'Search or type URL' }) with timeout 5000ms
  - waiting for getByRole('combobox', { name: 'Search or type URL' })

    at LinkControl.useLinkControlSearch (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:416:47)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:179:21
should give the image its context menu while selected @WebKit @Firefox in /test/e2e/specs/editor/blocks/image.spec.js, passed after 1 failed attempt.
Test timeout of 100000ms exceeded.
should select by dragging into nested block in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 0

  Array [
    1,
-   2,
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:569:5
should undo without broken temporary state in /test/e2e/specs/editor/blocks/image.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:image -->
- <figure class="wp-block-image"><img alt=""/></figure>
+ <!-- wp:image {"id":26,"sizeSlug":"full","linkDestination":"none"} -->
+ <figure class="wp-block-image size-full"><img src="http://localhost:8891/wp-content/uploads/2026/11/03be1998-2748-48aa-b638-36d9b1705a20.png" alt="" class="wp-image-26"/></figure>
  <!-- /wp:image -->
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:432:49
submenus in a custom overlay set to open on click, do not display until clicked in /test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js, passed after 2 failed attempts.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('button', { name: 'Open menu' })
    - locator resolved to <button aria-haspopup="dialog" aria-label="Open menu" data-wp-on--click="actions.openMenuOnClick" data-wp-on--keydown="actions.handleMenuKeydown" class="wp-block-navigation__responsive-container-open always-shown">…</button>
  - attempting click action
    2 × waiting for element to be visible, enabled and stable
      - element is visible, enabled and stable
      - scrolling into view if needed
      - done scrolling
      - <a class="ab-item" role="menuitem" href="http://localhost:8889/wp-admin/about.php">About WordPress</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
    - retrying click action
    - waiting 20ms
    2 × waiting for element to be visible, enabled and stable
      - element is visible, enabled and stable
      - scrolling into view if needed
      - done scrolling
      - <a class="ab-item" role="menuitem" href="http://localhost:8889/wp-admin/about.php">About WordPress</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
    - retrying click action
      - waiting 100ms
    19 × waiting for element to be visible, enabled and stable
       - element is visible, enabled and stable
       - scrolling into view if needed
       - done scrolling
       - <a class="ab-item" role="menuitem" href="http://localhost:8889/wp-admin/about.php">About WordPress</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
     - retrying click action
       - waiting 500ms

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js:185:25
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('button', { name: 'Open menu' })
    - locator resolved to <button aria-haspopup="dialog" aria-label="Open menu" data-wp-on--click="actions.openMenuOnClick" data-wp-on--keydown="actions.handleMenuKeydown" class="wp-block-navigation__responsive-container-open always-shown">…</button>
  - attempting click action
    2 × waiting for element to be visible, enabled and stable
      - element is visible, enabled and stable
      - scrolling into view if needed
      - done scrolling
      - <a class="ab-item" role="menuitem" href="http://localhost:8889/wp-admin/about.php">About WordPress</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
    - retrying click action
    - waiting 20ms
    2 × waiting for element to be visible, enabled and stable
      - element is visible, enabled and stable
      - scrolling into view if needed
      - done scrolling
      - <a class="ab-item" role="menuitem" href="http://localhost:8889/wp-admin/about.php">About WordPress</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
    - retrying click action
      - waiting 100ms
    19 × waiting for element to be visible, enabled and stable
       - element is visible, enabled and stable
       - scrolling into view if needed
       - done scrolling
       - <a class="ab-item" role="menuitem" href="http://localhost:8889/wp-admin/about.php">About WordPress</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
     - retrying click action
       - waiting 500ms

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js:185:25

59a1399 Run

@luisherranz luisherranz added [Type] Bug An existing feature does not function as intended Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta and removed [Package] E2E Tests /packages/e2e-tests labels Nov 6, 2026
@luisherranz luisherranz mentioned this pull request Nov 6, 2026
19 of 24 tasks

@SantosGuillamot SantosGuillamot 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.

Looks good to me 🙂 I tested it and it works as expected.

One edge case to consider for a follow-up: when an element switches from a client token on one page to the server marker on the next, its nodes are replaced even if the HTML is identical. It's an edge case, so it shouldn't block this fix.

@luisherranz
luisherranz merged commit a607a40 into trunk Nov 6, 2026
112 of 113 checks passed
@luisherranz
luisherranz deleted the fix/interactivity-data-wp-html-kept-element-server-content branch November 6, 2026 10:48
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 6, 2026
@github-actions github-actions Bot removed the Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Nov 6, 2026
gutenbergplugin pushed a commit that referenced this pull request Nov 6, 2026
…-html elements (#86416)

* Interactivity API: Show the new page's server content in kept data-wp-html elements whose value is the server representation

* Interactivity API: Keep the nodes of kept data-wp-html elements that already show the new page's server content

* Interactivity API: Show the new page's server content in kept data-wp-html elements whose value is pending

* Interactivity API: Document that kept data-wp-html elements show the new page's server content

* Interactivity API: Test kept data-wp-html elements showing server-rendered content across navigation in the browser

* Interactivity Router: Explain the value letters of the kept data-wp-html element tests

* Interactivity API: Stop owing server content after the navigation update that brings it

* Interactivity API: Say that data-wp-html elements outside router regions keep their content after navigation

* Interactivity API: Keep server content owed to a kept data-wp-html element until the navigation's data-wp-watch callbacks have run

* Interactivity API: Add an end-to-end test for data-wp-html elements whose value a data-wp-watch callback syncs after navigation

* Interactivity API: Explain why the router server HTML fixture writes the page's HTML into its context element

* Interactivity API: Keep a kept data-wp-html element's nodes when the server content it shows is unchanged

* Interactivity API: Drop the server content from the data-wp-html effect's dependencies, which the vnode already covers

* Interactivity API: Document that a kept data-wp-html element showing unchanged server content keeps its nodes after navigation

* Interactivity API: State in the data-wp-html reference and changelog alike that copying content calls no Trusted Types policy

* Interactivity API: Assert what the pending router-html case shows after its value resolves

* Interactivity API: Find the post the router-html-server refresh test edits by the link of the page shown

* Interactivity API: Limit the data-wp-watch sync e2e test to the navigation a browser must prove

* Interactivity API: Keep the server content in the data-wp-html effect's dependencies, which the hooks lint rule requires

* Interactivity API: Leave content with noscript elements out of the kept-nodes statement in the data-wp-html reference

* Interactivity API: State in the data-wp-html reference that content a script changed before hydration is replaced on navigation

* Interactivity API: Test a kept data-wp-html element whose getter turns from the server representation into a token or null

* Interactivity API: Explain why a stale server context value can copy content that the same update replaces

* Interactivity API: Link the changelog entry to its pull request
@github-actions github-actions Bot added the Backported to WP Core Pull request that has been successfully merged into WP Core label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

I just cherry-picked this PR to the wp/7.2 branch to get it included in the next release: 479c84d

wporg-sync pushed a commit to WordPress/wordpress-develop that referenced this pull request Nov 10, 2026
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90

- [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269)
- Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293)
- Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294)
- Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295)
- Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306)
- [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303)
- Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308)
- Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311)
- DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369)
- Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329)
- [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379)
- Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424)
- Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359)
- Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416)
- DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426)
- Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367)
- [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450)
- Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423)
- Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491)
- URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477)
- Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395)
- Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463)
- Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809)
- Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549)
- Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968)
- i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967)
- Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263)
- UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501)
- Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578)
- Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327)
- Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511)
- iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461)

Props mamaduka, wildworks.
See #66340.

git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 10, 2026
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90

- [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269)
- Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293)
- Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294)
- Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295)
- Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306)
- [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303)
- Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308)
- Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311)
- DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369)
- Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329)
- [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379)
- Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424)
- Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359)
- Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416)
- DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426)
- Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367)
- [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450)
- Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423)
- Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491)
- URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477)
- Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395)
- Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463)
- Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809)
- Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549)
- Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968)
- i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967)
- Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263)
- UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501)
- Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578)
- Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327)
- Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511)
- iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461)

Props mamaduka, wildworks.
See #66340.
Built from https://develop.svn.wordpress.org/trunk@65379


git-svn-id: http://core.svn.wordpress.org/trunk@64518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
arshidkv12 pushed a commit to arshidkv12/wordpress-develop that referenced this pull request Nov 21, 2026
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90

- [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269)
- Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293)
- Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294)
- Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295)
- Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306)
- [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303)
- Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308)
- Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311)
- DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369)
- Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329)
- [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379)
- Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424)
- Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359)
- Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416)
- DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426)
- Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367)
- [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450)
- Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423)
- Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491)
- URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477)
- Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395)
- Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463)
- Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809)
- Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549)
- Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968)
- i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967)
- Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263)
- UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501)
- Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578)
- Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327)
- Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511)
- iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461)

Props mamaduka, wildworks.
See #66340.

git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Package] Interactivity Router /packages/interactivity-router [Package] Interactivity /packages/interactivity [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants