Connectors: don't clobber third-party custom render in registerDefaultConnectors#77116
Conversation
…tConnectors `registerDefaultConnectors()` runs inside the dynamically-imported `routes/connectors-home/content` module, which means it executes after any third-party plugin script module that called `__experimentalRegisterConnector()` at top level (e.g. plugins enqueueing on `options-connectors-wp-admin_init`). The connectors store reducer spreads the new config over the existing entry, so the unconditional `args.render = ApiKeyConnector` for `api_key`-authenticated providers overwrites any custom render the plugin already supplied. PR WordPress#76722 added e2e coverage for the *server-then-client* direction (where the JS register correctly wins because it runs after the default register), but didn't cover the *client-then-server* direction — which is the natural flow for plugin script modules. Fix: read the existing entry from the connectors store and only set `args.render = ApiKeyConnector` when no render has been registered yet. The reducer's spread of the existing entry preserves the plugin's render while still merging the server-side metadata (logo, plugin install state, authentication config) on top. Adds a third connector `test_api_key_with_custom_render` to the `connectors-js-extensibility` test plugin and a corresponding e2e test that asserts the custom render content is visible and the default API Key form is absent — exercising the previously-uncovered direction. Closes WordPress#77115
|
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 If 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. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @superdav42! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
I don't have permission to apply labels — could a maintainer add |
WP core's routes/connectors-home/content.js runs registerDefaultConnectors() from inside an async dynamic import. By the time it executes, our top-level registerConnector() has already run, and the connectors store reducer spreads new config over the existing entry — so the default's `args.render = ApiKeyConnector` overwrites our custom card. The user sees the generic API-key UI instead of the endpoint URL / model picker form. The proper upstream fix is WordPress/gutenberg#77116. Until that lands and ships in a Gutenberg release, work around it by re-asserting our registration on five ticks (sync + microtask + setTimeout 0/50/250/1000ms) so we always end up last regardless of dynamic-import resolution order. Re-registration with the same render is idempotent so the redundant calls cost almost nothing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WP core's routes/connectors-home/content.js runs registerDefaultConnectors() from inside an async dynamic import, and the connectors store reducer spreads new config over existing entries — so the default's `args.render = ApiKeyConnector` can overwrite a plugin's custom render. This plugin currently dodges the bug because its JS slug (ai-provider-for-anthropic-max/connector) doesn't collide with the PHP-side provider id (anthropic-max). That's fragile — a future upstream change to slug normalization or sanitization could break it without warning. Re-assert the registration on five ticks (sync + microtask + setTimeout 0/50/250/1000ms) so we always end up last regardless of dynamic-import resolution order. Idempotent and cheap. The proper upstream fix is WordPress/gutenberg#77116. Once that ships in a Gutenberg release, this defense can be removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ix render clobber
This commit makes two coordinated changes that have to ship together:
1. RENAME the AI Client provider id from 'anthropic-max' to
'ultimate-ai-connector-anthropic-max', and the JS registerConnector()
slug from 'ai-provider-for-anthropic-max/connector' to the same
'ultimate-ai-connector-anthropic-max'. This:
- Matches the naming convention used by the sister plugins
(ultimate-ai-connector-webllm, ultimate-ai-connector-compatible-endpoints).
- Claims the 'ultimate-ai-connector-' namespace properly so a future
third-party 'anthropic-max' plugin can't collide with this one.
- Causes the WP Connectors page to render ONE card instead of two —
previously a hidden duplicate auto-registered ApiKeyConnector card
existed alongside the custom-rendered card because the slugs differed.
This is a BREAKING change for any caller that hardcoded the old
provider id (e.g. AiClient::defaultRegistry()->getProvider('anthropic-max')).
Stored OAuth tokens, REST endpoint URLs, option keys, transient prefixes,
plugin folder name, text domain, and css class are unchanged.
2. WORKAROUND for WP core's registerDefaultConnectors() clobbering custom
renders. The rename in (1) makes the slugs match, which exposes this
plugin to the same race the other Ultimate-Multisite connector plugins
hit: WP core's routes/connectors-home/content module runs
registerDefaultConnectors() inside an async dynamic import, after our
top-level registerConnector() has already populated the store, and the
reducer's spread overwrites our custom render with the generic
ApiKeyConnector. Re-assert the registration on five ticks (sync +
microtask + setTimeout 0/50/250/1000ms) so we always end up last.
The proper upstream fix is in WordPress/gutenberg#77116. Once that ships
in a Gutenberg release, the 5-tick workaround can be removed; the rename
is permanent.
CSS class on the rendered card also updated from
`connector-item--anthropic-max` to `connector-item--ultimate-ai-connector-anthropic-max`
to match the new slug and the convention used by the sister plugins.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ix render clobber (#6) * v1.0.1: defensive re-register on Connectors page WP core's routes/connectors-home/content.js runs registerDefaultConnectors() from inside an async dynamic import, and the connectors store reducer spreads new config over existing entries — so the default's `args.render = ApiKeyConnector` can overwrite a plugin's custom render. This plugin currently dodges the bug because its JS slug (ai-provider-for-anthropic-max/connector) doesn't collide with the PHP-side provider id (anthropic-max). That's fragile — a future upstream change to slug normalization or sanitization could break it without warning. Re-assert the registration on five ticks (sync + microtask + setTimeout 0/50/250/1000ms) so we always end up last regardless of dynamic-import resolution order. Idempotent and cheap. The proper upstream fix is WordPress/gutenberg#77116. Once that ships in a Gutenberg release, this defense can be removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * v1.1.0: rename provider id to ultimate-ai-connector-anthropic-max + fix render clobber This commit makes two coordinated changes that have to ship together: 1. RENAME the AI Client provider id from 'anthropic-max' to 'ultimate-ai-connector-anthropic-max', and the JS registerConnector() slug from 'ai-provider-for-anthropic-max/connector' to the same 'ultimate-ai-connector-anthropic-max'. This: - Matches the naming convention used by the sister plugins (ultimate-ai-connector-webllm, ultimate-ai-connector-compatible-endpoints). - Claims the 'ultimate-ai-connector-' namespace properly so a future third-party 'anthropic-max' plugin can't collide with this one. - Causes the WP Connectors page to render ONE card instead of two — previously a hidden duplicate auto-registered ApiKeyConnector card existed alongside the custom-rendered card because the slugs differed. This is a BREAKING change for any caller that hardcoded the old provider id (e.g. AiClient::defaultRegistry()->getProvider('anthropic-max')). Stored OAuth tokens, REST endpoint URLs, option keys, transient prefixes, plugin folder name, text domain, and css class are unchanged. 2. WORKAROUND for WP core's registerDefaultConnectors() clobbering custom renders. The rename in (1) makes the slugs match, which exposes this plugin to the same race the other Ultimate-Multisite connector plugins hit: WP core's routes/connectors-home/content module runs registerDefaultConnectors() inside an async dynamic import, after our top-level registerConnector() has already populated the store, and the reducer's spread overwrites our custom render with the generic ApiKeyConnector. Re-assert the registration on five ticks (sync + microtask + setTimeout 0/50/250/1000ms) so we always end up last. The proper upstream fix is in WordPress/gutenberg#77116. Once that ships in a Gutenberg release, the 5-tick workaround can be removed; the rename is permanent. CSS class on the rendered card also updated from `connector-item--anthropic-max` to `connector-item--ultimate-ai-connector-anthropic-max` to match the new slug and the convention used by the sister plugins. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WP core's routes/connectors-home/content.js runs registerDefaultConnectors() from inside an async dynamic import. By the time it executes, our top-level registerConnector() has already run, and the connectors store reducer spreads new config over the existing entry — so the default's `args.render = ApiKeyConnector` overwrites our custom card. The user sees the generic API-key UI instead of the endpoint URL / model picker form. The proper upstream fix is WordPress/gutenberg#77116. Until that lands and ships in a Gutenberg release, work around it by re-asserting our registration on five ticks (sync + microtask + setTimeout 0/50/250/1000ms) so we always end up last regardless of dynamic-import resolution order. Re-registration with the same render is idempotent so the redundant calls cost almost nothing. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thank you for the detailed report @superdav42 and proposing the solution. That’s a real problem with how JavaScript runs as there is no formalized |
Fixes a Prettier violation in registerDefaultConnectors, tightens the e2e assertion so it targets the API key textbox role (rather than matching the card's own accessible name), and rewords the newly added comments to describe intent instead of neighboring implementation details that will evolve. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Reviewed, built and ran the new e2e test locally against a fresh test env — the fix behaves as described. Verified against the connectors store reducer that omitting render from the default registration's args correctly preserves a previously-registered render while server-side metadata still merges on top. Solid root-cause analysis and a well-targeted regression test.
I pushed a polish commit b57b271 with three tweaks to help it land:
- Prettier — the
const existing = unlock( ... ).getConnector( connectorName );line tripped theAll (Static Analysis)CI job. Reflowed to the multi-line form. - E2E assertion —
card.getByLabel( 'API Key' )was matching the card itself because Playwright'sgetByLabelresolvesaria-labelledby, and the card'srole="group"is labeled by the heading "Test API Key With Custom Render", which contains the substring "API Key". Swapped tocard.getByRole( 'textbox', { name: 'API Key' } )— directly asserts the default API-key input is absent, which is the real invariant. - Comments — trimmed the newly added comments in
default-connectors.tsx, the test plugin, and the spec so they describe what the code is doing rather than referencing specific function names and internal mechanisms (reducer spread order, dynamic import chain,registerDefaultConnectors,ApiKeyConnector) that will rot as the area evolves.
…tConnectors (#77116) * Connectors: don't clobber third-party custom render in registerDefaultConnectors `registerDefaultConnectors()` runs inside the dynamically-imported `routes/connectors-home/content` module, which means it executes after any third-party plugin script module that called `__experimentalRegisterConnector()` at top level (e.g. plugins enqueueing on `options-connectors-wp-admin_init`). The connectors store reducer spreads the new config over the existing entry, so the unconditional `args.render = ApiKeyConnector` for `api_key`-authenticated providers overwrites any custom render the plugin already supplied. PR #76722 added e2e coverage for the *server-then-client* direction (where the JS register correctly wins because it runs after the default register), but didn't cover the *client-then-server* direction — which is the natural flow for plugin script modules. Fix: read the existing entry from the connectors store and only set `args.render = ApiKeyConnector` when no render has been registered yet. The reducer's spread of the existing entry preserves the plugin's render while still merging the server-side metadata (logo, plugin install state, authentication config) on top. Adds a third connector `test_api_key_with_custom_render` to the `connectors-js-extensibility` test plugin and a corresponding e2e test that asserts the custom render content is visible and the default API Key form is absent — exercising the previously-uncovered direction. Closes #77115 * Connectors: polish custom-render regression test and comments Fixes a Prettier violation in registerDefaultConnectors, tightens the e2e assertion so it targets the API key textbox role (rather than matching the card's own accessible name), and rewords the newly added comments to describe intent instead of neighboring implementation details that will evolve. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Grzegorz Ziolkowski <grzegorz@gziolo.pl> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: superdav42 <superdav42@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: e426877 |
This updates the pinned hash from the `gutenberg` from `e2970ba736edb99e08fb369d4fb0c378189468ee ` to `c15cef1d6b07f666df28dac0383bafb0edfe0914`. The following changes are included: - RTC: Predefined retry schedules for disconnect dialog, make more lenient (WordPress/gutenberg#76966) - Block Editor: Prevent Enter key from inserting paragraphs in contentOnly sections (WordPress/gutenberg#76989) - Cover block: fix embed video background Error 153 in editor (WordPress/gutenberg#76904) - Restore original template registration tests alongside activation variants (WordPress/gutenberg#77068) - Avoid stale values in core/cover block for RTC compatibility (WordPress/gutenberg#76916) - Bump oras-project/setup-oras (WordPress/gutenberg#77096) (WordPress/gutenberg#77110) - RTC: Change SyncConnectionModal to isSyncConnectionErrorHandled filter and drop IS_GUTENBERG_PLUGIN check (WordPress/gutenberg#76853) - contentOnly template lock: Fix block insertion and removal rules (WordPress/gutenberg#77119) - Global Styles Revisions: Fix footer overflow (WordPress/gutenberg#77103) - Revision: Fix 'Show changes' button reset state (WordPress/gutenberg#77122) - Link picker: Decode HTML entities in link preview title (WordPress/gutenberg#77170) - Connectors: don't clobber third-party custom render in registerDefaultConnectors (WordPress/gutenberg#77116) - Connectors: Replace speak() with notice store for state changes (WordPress/gutenberg#77174) - Core Data: Fix 'useEntityProp' for raw attributes (WordPress/gutenberg#77120) - Fix PatternsActions prop name from postType to type (WordPress/gutenberg#77251) - Fix: restore editor canvas padding in classic themes (WordPress/gutenberg#76864) - RTC: Add filterable flag for meta box RTC compatibility (WordPress/gutenberg#76939) - Fix failing 'WP_HTTP_Polling_Sync_Server' unit test (WordPress/gutenberg#77025) (WordPress/gutenberg#77325) - Edit Post: Fix warning in 'useMetaBoxInitialization' hook (WordPress/gutenberg#77311) - Update the page slug we link to for the AI plugin after the plugin has been installed and activated (WordPress/gutenberg#77336) - Test: Connectors Point to the righ page. (WordPress/gutenberg#77272) - Post Editor: Store metaboxes RTC-compatible flag on location entries (WordPress/gutenberg#77361) - Core Abilities: Export initialization promise as `ready` (WordPress/gutenberg#77254) - Block Editor: Strip per-block custom CSS on save for users without edit_css (WordPress/gutenberg#76650) - Add heading level 1 for the fonts page (WordPress/gutenberg#77482) - Connectors: Treat network-active plugins as active in plugin status check (WordPress/gutenberg#77661) - RTC: Fix disconnect dialog due to uneditable entity (WordPress/gutenberg#77242) - RTC: Fix "Connection Lost" dialog when too many entities are loaded (WordPress/gutenberg#77631) - RTC: Fix "Edit as HTML" content reset during collaboration (WordPress/gutenberg#77043) - RTC: Add optional `shouldSync` function to entity sync config (WordPress/gutenberg#76947) - RTC: Fixed orphaned meta causing dirty editor state (WordPress/gutenberg#77529) - Ensure "Retry" button is stable during retries (WordPress/gutenberg#77234) - Patterns: add confirmation dialog before disconnecting/detaching (WordPress/gutenberg#75713) - Template parts: make 'Detach' context menu item consistent across patterns and template parts (WordPress/gutenberg#77581) - Remove sandbox `allow-same-origin` for core/html blocks (Merge WordPress/gutenberg#77212 to `wp/7.0`) (WordPress/gutenberg#77699) - Added Context for Next/Prev Enlarge Image (WordPress/gutenberg#76967) - Backport: Writing Flow: fix arrow keys skipping paragraph containing link (WordPress/gutenberg#77478) - Revisions: Improve screen reader accessibility for diff markers region and slider (WordPress/gutenberg#77660) - Connectors: Add role="list" wrapper to connector cards for valid ARIA structure (WordPress/gutenberg#77689) - Command Palette: Fix macOs label for sites unable to determine UA via PHP (WordPress/gutenberg#77638) - RTC: Fix inline inserter reset on update sync (WordPress/gutenberg#76980) (WordPress/gutenberg#77706) - Connectors: keep focus on action Button during install (WordPress/gutenberg#77544) - Added Translator Context for Reply (WordPress/gutenberg#77891) - Editor: Improve revisions diff pairing performance (WordPress/gutenberg#77126) - Core Data: Treat single-item responses specially (WordPress/gutenberg#76318) - Site editor: preserve non-global styles in pattern previews (WordPress/gutenberg#77957) - RTC: Fix divergence when two offline users reconnect (WordPress/gutenberg#77980) - RTC: Fix compaction unit test (WordPress/gutenberg#77986) - Connectors: Stop e2e capability restriction from leaking across specs (WordPress/gutenberg#77857) - Connectors: Clarify AI plugin callout copy (WordPress/gutenberg#78043) - Fix: Only auto register settings if the plugin the connector references is installed and active. (WordPress/gutenberg#77273) - Connectors: Add is_active callback support to plugin registration (WordPress/gutenberg#77897) - RTC: Fix race condition on room creation which can cause a split update log (WordPress/gutenberg#77675) - RTC: Fix find_canonical_storage_post_id() always returning null (WordPress/gutenberg#78053) - i18n: add context to scale (WordPress/gutenberg#76917) - Revisions: Simplify fetching (WordPress/gutenberg#77086) - e2e: Add e2e tests for template and template part revisions (WordPress/gutenberg#76923) - Editor: Paginate revisions slider by 100 per page (WordPress/gutenberg#77200) (WordPress/gutenberg#78070) - Revisions: Add diagonal stripe patterns to diff markers to avoid color-only distinction (WordPress/gutenberg#77904) - Revision: Fix failing e2e test (WordPress/gutenberg#78079) - Real-time collaboration: Bundle @wordpress/sync instead of exposing as wp.sync (WordPress/gutenberg#78085) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/e2970ba736edb99e08fb369d4fb0c378189468ee…c15cef1d6b07f666df28dac0383bafb0edfe0914. Log created with: git log --reverse --format="- %s" e2970ba736edb99e08fb369d4fb0c378189468ee..c15cef1d6b07f666df28dac0383bafb0edfe0914 | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy See #64595. git-svn-id: https://develop.svn.wordpress.org/trunk@62333 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned hash from the `gutenberg` from `e2970ba736edb99e08fb369d4fb0c378189468ee ` to `c15cef1d6b07f666df28dac0383bafb0edfe0914`. The following changes are included: - RTC: Predefined retry schedules for disconnect dialog, make more lenient (WordPress/gutenberg#76966) - Block Editor: Prevent Enter key from inserting paragraphs in contentOnly sections (WordPress/gutenberg#76989) - Cover block: fix embed video background Error 153 in editor (WordPress/gutenberg#76904) - Restore original template registration tests alongside activation variants (WordPress/gutenberg#77068) - Avoid stale values in core/cover block for RTC compatibility (WordPress/gutenberg#76916) - Bump oras-project/setup-oras (WordPress/gutenberg#77096) (WordPress/gutenberg#77110) - RTC: Change SyncConnectionModal to isSyncConnectionErrorHandled filter and drop IS_GUTENBERG_PLUGIN check (WordPress/gutenberg#76853) - contentOnly template lock: Fix block insertion and removal rules (WordPress/gutenberg#77119) - Global Styles Revisions: Fix footer overflow (WordPress/gutenberg#77103) - Revision: Fix 'Show changes' button reset state (WordPress/gutenberg#77122) - Link picker: Decode HTML entities in link preview title (WordPress/gutenberg#77170) - Connectors: don't clobber third-party custom render in registerDefaultConnectors (WordPress/gutenberg#77116) - Connectors: Replace speak() with notice store for state changes (WordPress/gutenberg#77174) - Core Data: Fix 'useEntityProp' for raw attributes (WordPress/gutenberg#77120) - Fix PatternsActions prop name from postType to type (WordPress/gutenberg#77251) - Fix: restore editor canvas padding in classic themes (WordPress/gutenberg#76864) - RTC: Add filterable flag for meta box RTC compatibility (WordPress/gutenberg#76939) - Fix failing 'WP_HTTP_Polling_Sync_Server' unit test (WordPress/gutenberg#77025) (WordPress/gutenberg#77325) - Edit Post: Fix warning in 'useMetaBoxInitialization' hook (WordPress/gutenberg#77311) - Update the page slug we link to for the AI plugin after the plugin has been installed and activated (WordPress/gutenberg#77336) - Test: Connectors Point to the righ page. (WordPress/gutenberg#77272) - Post Editor: Store metaboxes RTC-compatible flag on location entries (WordPress/gutenberg#77361) - Core Abilities: Export initialization promise as `ready` (WordPress/gutenberg#77254) - Block Editor: Strip per-block custom CSS on save for users without edit_css (WordPress/gutenberg#76650) - Add heading level 1 for the fonts page (WordPress/gutenberg#77482) - Connectors: Treat network-active plugins as active in plugin status check (WordPress/gutenberg#77661) - RTC: Fix disconnect dialog due to uneditable entity (WordPress/gutenberg#77242) - RTC: Fix "Connection Lost" dialog when too many entities are loaded (WordPress/gutenberg#77631) - RTC: Fix "Edit as HTML" content reset during collaboration (WordPress/gutenberg#77043) - RTC: Add optional `shouldSync` function to entity sync config (WordPress/gutenberg#76947) - RTC: Fixed orphaned meta causing dirty editor state (WordPress/gutenberg#77529) - Ensure "Retry" button is stable during retries (WordPress/gutenberg#77234) - Patterns: add confirmation dialog before disconnecting/detaching (WordPress/gutenberg#75713) - Template parts: make 'Detach' context menu item consistent across patterns and template parts (WordPress/gutenberg#77581) - Remove sandbox `allow-same-origin` for core/html blocks (Merge WordPress/gutenberg#77212 to `wp/7.0`) (WordPress/gutenberg#77699) - Added Context for Next/Prev Enlarge Image (WordPress/gutenberg#76967) - Backport: Writing Flow: fix arrow keys skipping paragraph containing link (WordPress/gutenberg#77478) - Revisions: Improve screen reader accessibility for diff markers region and slider (WordPress/gutenberg#77660) - Connectors: Add role="list" wrapper to connector cards for valid ARIA structure (WordPress/gutenberg#77689) - Command Palette: Fix macOs label for sites unable to determine UA via PHP (WordPress/gutenberg#77638) - RTC: Fix inline inserter reset on update sync (WordPress/gutenberg#76980) (WordPress/gutenberg#77706) - Connectors: keep focus on action Button during install (WordPress/gutenberg#77544) - Added Translator Context for Reply (WordPress/gutenberg#77891) - Editor: Improve revisions diff pairing performance (WordPress/gutenberg#77126) - Core Data: Treat single-item responses specially (WordPress/gutenberg#76318) - Site editor: preserve non-global styles in pattern previews (WordPress/gutenberg#77957) - RTC: Fix divergence when two offline users reconnect (WordPress/gutenberg#77980) - RTC: Fix compaction unit test (WordPress/gutenberg#77986) - Connectors: Stop e2e capability restriction from leaking across specs (WordPress/gutenberg#77857) - Connectors: Clarify AI plugin callout copy (WordPress/gutenberg#78043) - Fix: Only auto register settings if the plugin the connector references is installed and active. (WordPress/gutenberg#77273) - Connectors: Add is_active callback support to plugin registration (WordPress/gutenberg#77897) - RTC: Fix race condition on room creation which can cause a split update log (WordPress/gutenberg#77675) - RTC: Fix find_canonical_storage_post_id() always returning null (WordPress/gutenberg#78053) - i18n: add context to scale (WordPress/gutenberg#76917) - Revisions: Simplify fetching (WordPress/gutenberg#77086) - e2e: Add e2e tests for template and template part revisions (WordPress/gutenberg#76923) - Editor: Paginate revisions slider by 100 per page (WordPress/gutenberg#77200) (WordPress/gutenberg#78070) - Revisions: Add diagonal stripe patterns to diff markers to avoid color-only distinction (WordPress/gutenberg#77904) - Revision: Fix failing e2e test (WordPress/gutenberg#78079) - Real-time collaboration: Bundle @wordpress/sync instead of exposing as wp.sync (WordPress/gutenberg#78085) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/e2970ba736edb99e08fb369d4fb0c378189468ee…c15cef1d6b07f666df28dac0383bafb0edfe0914. Log created with: git log --reverse --format="- %s" e2970ba736edb99e08fb369d4fb0c378189468ee..c15cef1d6b07f666df28dac0383bafb0edfe0914 | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy See #64595. Built from https://develop.svn.wordpress.org/trunk@62333 git-svn-id: http://core.svn.wordpress.org/trunk@61614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the pinned hash from the `gutenberg` from `e2970ba736edb99e08fb369d4fb0c378189468ee ` to `c15cef1d6b07f666df28dac0383bafb0edfe0914`. The following changes are included: - RTC: Predefined retry schedules for disconnect dialog, make more lenient (WordPress/gutenberg#76966) - Block Editor: Prevent Enter key from inserting paragraphs in contentOnly sections (WordPress/gutenberg#76989) - Cover block: fix embed video background Error 153 in editor (WordPress/gutenberg#76904) - Restore original template registration tests alongside activation variants (WordPress/gutenberg#77068) - Avoid stale values in core/cover block for RTC compatibility (WordPress/gutenberg#76916) - Bump oras-project/setup-oras (WordPress/gutenberg#77096) (WordPress/gutenberg#77110) - RTC: Change SyncConnectionModal to isSyncConnectionErrorHandled filter and drop IS_GUTENBERG_PLUGIN check (WordPress/gutenberg#76853) - contentOnly template lock: Fix block insertion and removal rules (WordPress/gutenberg#77119) - Global Styles Revisions: Fix footer overflow (WordPress/gutenberg#77103) - Revision: Fix 'Show changes' button reset state (WordPress/gutenberg#77122) - Link picker: Decode HTML entities in link preview title (WordPress/gutenberg#77170) - Connectors: don't clobber third-party custom render in registerDefaultConnectors (WordPress/gutenberg#77116) - Connectors: Replace speak() with notice store for state changes (WordPress/gutenberg#77174) - Core Data: Fix 'useEntityProp' for raw attributes (WordPress/gutenberg#77120) - Fix PatternsActions prop name from postType to type (WordPress/gutenberg#77251) - Fix: restore editor canvas padding in classic themes (WordPress/gutenberg#76864) - RTC: Add filterable flag for meta box RTC compatibility (WordPress/gutenberg#76939) - Fix failing 'WP_HTTP_Polling_Sync_Server' unit test (WordPress/gutenberg#77025) (WordPress/gutenberg#77325) - Edit Post: Fix warning in 'useMetaBoxInitialization' hook (WordPress/gutenberg#77311) - Update the page slug we link to for the AI plugin after the plugin has been installed and activated (WordPress/gutenberg#77336) - Test: Connectors Point to the righ page. (WordPress/gutenberg#77272) - Post Editor: Store metaboxes RTC-compatible flag on location entries (WordPress/gutenberg#77361) - Core Abilities: Export initialization promise as `ready` (WordPress/gutenberg#77254) - Block Editor: Strip per-block custom CSS on save for users without edit_css (WordPress/gutenberg#76650) - Add heading level 1 for the fonts page (WordPress/gutenberg#77482) - Connectors: Treat network-active plugins as active in plugin status check (WordPress/gutenberg#77661) - RTC: Fix disconnect dialog due to uneditable entity (WordPress/gutenberg#77242) - RTC: Fix "Connection Lost" dialog when too many entities are loaded (WordPress/gutenberg#77631) - RTC: Fix "Edit as HTML" content reset during collaboration (WordPress/gutenberg#77043) - RTC: Add optional `shouldSync` function to entity sync config (WordPress/gutenberg#76947) - RTC: Fixed orphaned meta causing dirty editor state (WordPress/gutenberg#77529) - Ensure "Retry" button is stable during retries (WordPress/gutenberg#77234) - Patterns: add confirmation dialog before disconnecting/detaching (WordPress/gutenberg#75713) - Template parts: make 'Detach' context menu item consistent across patterns and template parts (WordPress/gutenberg#77581) - Remove sandbox `allow-same-origin` for core/html blocks (Merge WordPress/gutenberg#77212 to `wp/7.0`) (WordPress/gutenberg#77699) - Added Context for Next/Prev Enlarge Image (WordPress/gutenberg#76967) - Backport: Writing Flow: fix arrow keys skipping paragraph containing link (WordPress/gutenberg#77478) - Revisions: Improve screen reader accessibility for diff markers region and slider (WordPress/gutenberg#77660) - Connectors: Add role="list" wrapper to connector cards for valid ARIA structure (WordPress/gutenberg#77689) - Command Palette: Fix macOs label for sites unable to determine UA via PHP (WordPress/gutenberg#77638) - RTC: Fix inline inserter reset on update sync (WordPress/gutenberg#76980) (WordPress/gutenberg#77706) - Connectors: keep focus on action Button during install (WordPress/gutenberg#77544) - Added Translator Context for Reply (WordPress/gutenberg#77891) - Editor: Improve revisions diff pairing performance (WordPress/gutenberg#77126) - Core Data: Treat single-item responses specially (WordPress/gutenberg#76318) - Site editor: preserve non-global styles in pattern previews (WordPress/gutenberg#77957) - RTC: Fix divergence when two offline users reconnect (WordPress/gutenberg#77980) - RTC: Fix compaction unit test (WordPress/gutenberg#77986) - Connectors: Stop e2e capability restriction from leaking across specs (WordPress/gutenberg#77857) - Connectors: Clarify AI plugin callout copy (WordPress/gutenberg#78043) - Fix: Only auto register settings if the plugin the connector references is installed and active. (WordPress/gutenberg#77273) - Connectors: Add is_active callback support to plugin registration (WordPress/gutenberg#77897) - RTC: Fix race condition on room creation which can cause a split update log (WordPress/gutenberg#77675) - RTC: Fix find_canonical_storage_post_id() always returning null (WordPress/gutenberg#78053) - i18n: add context to scale (WordPress/gutenberg#76917) - Revisions: Simplify fetching (WordPress/gutenberg#77086) - e2e: Add e2e tests for template and template part revisions (WordPress/gutenberg#76923) - Editor: Paginate revisions slider by 100 per page (WordPress/gutenberg#77200) (WordPress/gutenberg#78070) - Revisions: Add diagonal stripe patterns to diff markers to avoid color-only distinction (WordPress/gutenberg#77904) - Revision: Fix failing e2e test (WordPress/gutenberg#78079) - Real-time collaboration: Bundle @wordpress/sync instead of exposing as wp.sync (WordPress/gutenberg#78085) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/e2970ba736edb99e08fb369d4fb0c378189468ee…c15cef1d6b07f666df28dac0383bafb0edfe0914. Log created with: git log --reverse --format="- %s" e2970ba736edb99e08fb369d4fb0c378189468ee..c15cef1d6b07f666df28dac0383bafb0edfe0914 | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy Reviewed by desrosj. Merges [62333] to the 7.0 branch. Props ellatrix, desrosj. See #64595. git-svn-id: https://develop.svn.wordpress.org/branches/7.0@62335 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned hash from the `gutenberg` from `e2970ba736edb99e08fb369d4fb0c378189468ee ` to `c15cef1d6b07f666df28dac0383bafb0edfe0914`. The following changes are included: - RTC: Predefined retry schedules for disconnect dialog, make more lenient (WordPress/gutenberg#76966) - Block Editor: Prevent Enter key from inserting paragraphs in contentOnly sections (WordPress/gutenberg#76989) - Cover block: fix embed video background Error 153 in editor (WordPress/gutenberg#76904) - Restore original template registration tests alongside activation variants (WordPress/gutenberg#77068) - Avoid stale values in core/cover block for RTC compatibility (WordPress/gutenberg#76916) - Bump oras-project/setup-oras (WordPress/gutenberg#77096) (WordPress/gutenberg#77110) - RTC: Change SyncConnectionModal to isSyncConnectionErrorHandled filter and drop IS_GUTENBERG_PLUGIN check (WordPress/gutenberg#76853) - contentOnly template lock: Fix block insertion and removal rules (WordPress/gutenberg#77119) - Global Styles Revisions: Fix footer overflow (WordPress/gutenberg#77103) - Revision: Fix 'Show changes' button reset state (WordPress/gutenberg#77122) - Link picker: Decode HTML entities in link preview title (WordPress/gutenberg#77170) - Connectors: don't clobber third-party custom render in registerDefaultConnectors (WordPress/gutenberg#77116) - Connectors: Replace speak() with notice store for state changes (WordPress/gutenberg#77174) - Core Data: Fix 'useEntityProp' for raw attributes (WordPress/gutenberg#77120) - Fix PatternsActions prop name from postType to type (WordPress/gutenberg#77251) - Fix: restore editor canvas padding in classic themes (WordPress/gutenberg#76864) - RTC: Add filterable flag for meta box RTC compatibility (WordPress/gutenberg#76939) - Fix failing 'WP_HTTP_Polling_Sync_Server' unit test (WordPress/gutenberg#77025) (WordPress/gutenberg#77325) - Edit Post: Fix warning in 'useMetaBoxInitialization' hook (WordPress/gutenberg#77311) - Update the page slug we link to for the AI plugin after the plugin has been installed and activated (WordPress/gutenberg#77336) - Test: Connectors Point to the righ page. (WordPress/gutenberg#77272) - Post Editor: Store metaboxes RTC-compatible flag on location entries (WordPress/gutenberg#77361) - Core Abilities: Export initialization promise as `ready` (WordPress/gutenberg#77254) - Block Editor: Strip per-block custom CSS on save for users without edit_css (WordPress/gutenberg#76650) - Add heading level 1 for the fonts page (WordPress/gutenberg#77482) - Connectors: Treat network-active plugins as active in plugin status check (WordPress/gutenberg#77661) - RTC: Fix disconnect dialog due to uneditable entity (WordPress/gutenberg#77242) - RTC: Fix "Connection Lost" dialog when too many entities are loaded (WordPress/gutenberg#77631) - RTC: Fix "Edit as HTML" content reset during collaboration (WordPress/gutenberg#77043) - RTC: Add optional `shouldSync` function to entity sync config (WordPress/gutenberg#76947) - RTC: Fixed orphaned meta causing dirty editor state (WordPress/gutenberg#77529) - Ensure "Retry" button is stable during retries (WordPress/gutenberg#77234) - Patterns: add confirmation dialog before disconnecting/detaching (WordPress/gutenberg#75713) - Template parts: make 'Detach' context menu item consistent across patterns and template parts (WordPress/gutenberg#77581) - Remove sandbox `allow-same-origin` for core/html blocks (Merge WordPress/gutenberg#77212 to `wp/7.0`) (WordPress/gutenberg#77699) - Added Context for Next/Prev Enlarge Image (WordPress/gutenberg#76967) - Backport: Writing Flow: fix arrow keys skipping paragraph containing link (WordPress/gutenberg#77478) - Revisions: Improve screen reader accessibility for diff markers region and slider (WordPress/gutenberg#77660) - Connectors: Add role="list" wrapper to connector cards for valid ARIA structure (WordPress/gutenberg#77689) - Command Palette: Fix macOs label for sites unable to determine UA via PHP (WordPress/gutenberg#77638) - RTC: Fix inline inserter reset on update sync (WordPress/gutenberg#76980) (WordPress/gutenberg#77706) - Connectors: keep focus on action Button during install (WordPress/gutenberg#77544) - Added Translator Context for Reply (WordPress/gutenberg#77891) - Editor: Improve revisions diff pairing performance (WordPress/gutenberg#77126) - Core Data: Treat single-item responses specially (WordPress/gutenberg#76318) - Site editor: preserve non-global styles in pattern previews (WordPress/gutenberg#77957) - RTC: Fix divergence when two offline users reconnect (WordPress/gutenberg#77980) - RTC: Fix compaction unit test (WordPress/gutenberg#77986) - Connectors: Stop e2e capability restriction from leaking across specs (WordPress/gutenberg#77857) - Connectors: Clarify AI plugin callout copy (WordPress/gutenberg#78043) - Fix: Only auto register settings if the plugin the connector references is installed and active. (WordPress/gutenberg#77273) - Connectors: Add is_active callback support to plugin registration (WordPress/gutenberg#77897) - RTC: Fix race condition on room creation which can cause a split update log (WordPress/gutenberg#77675) - RTC: Fix find_canonical_storage_post_id() always returning null (WordPress/gutenberg#78053) - i18n: add context to scale (WordPress/gutenberg#76917) - Revisions: Simplify fetching (WordPress/gutenberg#77086) - e2e: Add e2e tests for template and template part revisions (WordPress/gutenberg#76923) - Editor: Paginate revisions slider by 100 per page (WordPress/gutenberg#77200) (WordPress/gutenberg#78070) - Revisions: Add diagonal stripe patterns to diff markers to avoid color-only distinction (WordPress/gutenberg#77904) - Revision: Fix failing e2e test (WordPress/gutenberg#78079) - Real-time collaboration: Bundle @wordpress/sync instead of exposing as wp.sync (WordPress/gutenberg#78085) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/e2970ba736edb99e08fb369d4fb0c378189468ee…c15cef1d6b07f666df28dac0383bafb0edfe0914. Log created with: git log --reverse --format="- %s" e2970ba736edb99e08fb369d4fb0c378189468ee..c15cef1d6b07f666df28dac0383bafb0edfe0914 | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy Reviewed by desrosj. Merges [62333] to the 7.0 branch. Props ellatrix, desrosj. See #64595. Built from https://develop.svn.wordpress.org/branches/7.0@62335 git-svn-id: http://core.svn.wordpress.org/branches/7.0@61616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What
registerDefaultConnectors()inroutes/connectors-home/default-connectors.tsxwas unconditionally settingargs.render = ApiKeyConnectorfor anyapi_key-authenticated connector, overwriting custom renders that third-party plugin script modules had already supplied via__experimentalRegisterConnector().This PR makes the assignment conditional on no existing render being registered, so plugin-supplied renders survive while the rest of the server-side metadata (logo, plugin install state, authentication config) still merges on top.
Why
registerDefaultConnectors()runs inside the dynamically-importedroutes/connectors-home/contentmodule. By the time it runs, every top-level plugin script module — including any that enqueued on the standardoptions-connectors-wp-admin_initaction — has already executed and registered its connectors. The store reducer spreads new config over existing entries:So whichever caller fires last wins per key, and
registerDefaultConnectors()is always last for plugins that enqueue at the standard hook. The result is that any plugin shipping a custom Connectors-page card sees it silently replaced by the genericApiKeyConnectorAPI-key form.This is particularly painful for local/self-hosted AI providers (Ollama, LM Studio, WebLLM, etc.) that don't have an API-key concept at all — the rendered form is meaningless and confusing for users.
PR #76722 added JS-extensibility e2e coverage but only for the server-then-client direction (where the test plugin's connector uses
auth: 'none', so the clobber path is never hit). The client-then-server direction forauth: 'api_key'connectors was unverified and broken — see issue #77115 for the full root-cause walkthrough and a live reproducer plugin.How
In
default-connectors.tsx, before deciding whether to assign the defaultApiKeyConnectorrender, read the current entry from the connectors store via the sameunlock( connectorsPrivateApis )patternstage.tsxalready uses:When
args.renderis omitted, the reducer's spread of the existing entry preserves whatever render the plugin already registered. Server-side metadata (name,description,logo,authentication,plugin) still merges on top of the existing entry as before.Test plan
Adds a third connector
test_api_key_with_custom_renderto theconnectors-js-extensibilitytest plugin:packages/e2e-tests/plugins/connectors-js-extensibility.php): registerstest_api_key_with_custom_renderwithtype: 'ai_provider'andauthentication.method: 'api_key'— exactly the path that hits the clobber.packages/e2e-tests/plugins/connectors-js-extensibility/index.mjs): callsregisterConnector( 'test_api_key_with_custom_render', { render: ... } )for it. This is whatregisterDefaultConnectors()would have overwritten without the fix.test/e2e/specs/admin/connectors.spec.js): a new test inside theJS extensibilitydescribe block:'Custom render survived registerDefaultConnectors().') is visible inside the expected card.API Keylabels — i.e. the defaultApiKeyConnectorform is absent.This explicitly exercises the previously-uncovered direction. Without the source fix, the new spec fails (the card shows the API Key form instead of the custom content).
JS extensibilitytests still pass.should preserve a custom render for an api_key connector...test passes.registerConnectorworkaround.Closes #77115.