Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ee05251
add version number graphic to welcome banner
retrofox May 24, 2026
682417f
Merge branch 'update/add-welcome-widget-banner-bg' into trunk
retrofox May 25, 2026
b5d6eb9
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 25, 2026
3a3ff5f
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 25, 2026
a897825
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 25, 2026
f2917e0
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 25, 2026
4625fb1
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 25, 2026
c683724
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 25, 2026
853b9c8
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 25, 2026
0780c53
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 25, 2026
75810ab
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 26, 2026
9d8276a
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 26, 2026
b19ab13
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 26, 2026
1a142a3
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 26, 2026
59b8492
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 26, 2026
393837e
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 27, 2026
9c43e72
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 27, 2026
461a10d
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 27, 2026
e0fb835
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 28, 2026
b0b47e5
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 28, 2026
9eed995
Merge branch 'trunk' of github.com:WordPress/gutenberg into trunk
retrofox May 28, 2026
5efd75c
replace "surface" with "host" in widget-primitives
retrofox May 28, 2026
ac984a2
replace "surface" with "host" in widget-dashboard docs
retrofox May 28, 2026
4bb398c
replace "surface" with "dashboard" in dashboard hooks
retrofox May 28, 2026
8b7955f
replace "surface" with "dashboard"/"host" in widget PHP
retrofox May 28, 2026
9988ca2
finish "surface" sweep in widget-primitives tools
retrofox May 28, 2026
cc3f58d
refine "surface" sweep wording in widget-dashboard README
retrofox May 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function get_item_permissions_check( $request ) {
*
* Widget modules are not sensitive data; they describe what is
* available to render. Gating at the same level as the dashboard
* page menu (which requires `read`) keeps the surface consistent.
* page menu (which requires `read`) keeps access consistent.
*
* @return true|WP_Error True if the request is allowed, WP_Error
* otherwise.
Expand Down
4 changes: 2 additions & 2 deletions lib/experimental/dashboard-widgets/class-wp-widget-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
* Internal class representing a widget type.
*
* Holds the metadata for a widget discovered by the build pipeline. Stored
* inside `WP_Widget_Type_Registry` once registered, and consumed by surface
* inside `WP_Widget_Type_Registry` once registered, and consumed by host
* code that needs to enumerate or look up widget types.
*
* The shape is intentionally minimal: identity (`name`) plus the
* script-module handles the build pipeline produced for the widget.
* Placement and surface concerns (which page or sidebar uses the widget)
* Placement and host concerns (which page or sidebar uses the widget)
* live with the consumer, not on the type definition.
*/
#[AllowDynamicProperties]
Expand Down
20 changes: 10 additions & 10 deletions lib/experimental/dashboard-widgets/dashboard-layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/**
* Preferences scope under which the dashboard layout is stored.
* Mirrors the scope read by the JS surface.
* Mirrors the scope read by the dashboard's JS layer.
*/
const GUTENBERG_DASHBOARD_LAYOUT_SCOPE = 'core/dashboard';

Expand All @@ -22,10 +22,10 @@
const GUTENBERG_DASHBOARD_LAYOUT_KEY = 'dashboardLayout';

/**
* Identifier of the bundled dashboard surface, formatted as
* `<plugin>_<page>` to match the underscore form produced by the
* wp-build pipeline (mirrors the `{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}`
* pair used in generated page templates).
* Identifier of the bundled dashboard, formatted as `<plugin>_<page>`
* to match the underscore form produced by the wp-build pipeline
* (mirrors the `{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}` pair used in
* generated page templates).
*
* Passed as context to `gutenberg_dashboard_default_layout` and used
* as the `{name}` segment of the REST default-layout route.
Expand All @@ -37,7 +37,7 @@
* `persisted_preferences` read when the stored layout is empty.
*
* Hooks into `get_user_metadata` so the default propagates through
* the same persistence layer the dashboard's JS surface reads from.
* the same persistence layer the dashboard's JS layer reads from.
* The JS side stays oblivious: a default and a user-saved layout
* look identical at the preferences-store boundary.
*
Expand Down Expand Up @@ -81,7 +81,7 @@ function gutenberg_inject_dashboard_default_layout( $value, $user_id, $meta_key
* `uuid`, `type`, optional `attributes`, optional `placement`.
*
* @param array $default_layout Default array of widget instances.
* @param string $dashboard_name Identifier of the dashboard surface
* @param string $dashboard_name Identifier of the dashboard
* receiving the default. Callbacks
* targeting a specific dashboard
* should switch on this value.
Expand All @@ -104,12 +104,12 @@ function gutenberg_inject_dashboard_default_layout( $value, $user_id, $meta_key
add_filter( 'get_user_metadata', 'gutenberg_inject_dashboard_default_layout', 99, 3 );

/**
* Returns the default layout registered for a dashboard surface.
* Returns the default layout registered for a dashboard.
*
* Resolves `gutenberg_dashboard_default_layout` for the supplied
* dashboard name, returning a fresh evaluation of the filter chain
* each call. Used by the JS surface to back a "reset to default"
* action without depending on the user-meta hydration path.
* each call. Used by the dashboard's JS layer to back a "reset to
* default" action without depending on the user-meta hydration path.
*
* @param WP_REST_Request $request REST request carrying the
* dashboard name segment.
Expand Down
6 changes: 3 additions & 3 deletions lib/experimental/dashboard-widgets/default-layout-seed.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* Appends the bundled widget instances to the default layout unless an
* earlier callback in the filter chain already added them.
*
* Only contributes to the bundled `gutenberg_dashboard` surface; other
* Only contributes to the bundled `gutenberg_dashboard`; other
* dashboards are left untouched.
*
* @param array $dashboard_layout Default layout produced by previous
* callbacks on `gutenberg_dashboard_default_layout`.
* @param string $dashboard_name Identifier of the dashboard surface
* receiving the default.
* @param string $dashboard_name Identifier of the dashboard receiving
* the default.
* @return array The layout extended with the bundled widget instance.
*/
function gutenberg_seed_default_dashboard_layout( $dashboard_layout, $dashboard_name = '' ) {
Expand Down
4 changes: 2 additions & 2 deletions lib/experimental/dashboard-widgets/widget-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ function gutenberg_register_widget_modules_rest_controller() {
* dependencies.
*
* The wp-build page templates expose a generic
* `{page-id}-wp-admin_boot_dependencies` filter. The dashboard surface
* hooks it to make every registered widget render and metadata module
* `{page-id}-wp-admin_boot_dependencies` filter. The dashboard hooks
* it to make every registered widget render and metadata module
* available in the page's import map for dynamic `import()` calls.
*
* Both the render module and the metadata module are added as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ const DEFAULT_GRID_SETTINGS: WidgetGridSettings = {
*
* Returns the persisted settings, a setter that writes through to the
* preferences store, and a reset action that applies the bundled
* defaults. The preference is shared across dashboard surfaces today;
* if a per-dashboard split is needed later, the signature can grow a
* surface-identifying parameter without touching call sites that pass
* the dashboard's name through.
* defaults. The preference is shared across dashboards today; if a
* per-dashboard split is needed later, the signature can grow a
* dashboard-identifying parameter without touching call sites that
* pass the dashboard's name through.
*
* @return Tuple `[ settings, setSettings, resetSettings ]`.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const SCOPE = 'core/dashboard';
const KEY = 'dashboardLayout';

/**
* Identifier of a dashboard surface, structured as `<plugin>_<page>` to
* mirror the underscore form produced by the wp-build pipeline (see
* Identifier of a dashboard, structured as `<plugin>_<page>` to mirror
* the underscore form produced by the wp-build pipeline (see
* `{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}` in the page templates).
*/
export type DashboardName = `${ string }_${ string }`;
Expand All @@ -27,9 +27,9 @@ export type DashboardName = `${ string }_${ string }`;
* preferences store, and a reset action that fetches the dashboard's
* registered default from the REST API and applies it locally.
*
* @param dashboardName Identifier of the dashboard surface as
* produced by the build pipeline. Used as the
* `{name}` segment of the default-layout route.
* @param dashboardName Identifier of the dashboard as produced by the
* build pipeline. Used as the `{name}` segment of
* the default-layout route.
* @return Tuple `[ layout, setLayout, resetLayout ]`.
*/
export function useDashboardLayout(
Expand Down
12 changes: 6 additions & 6 deletions routes/dashboard/widget-dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Dashboard() {
}
```

`<WidgetDashboard>` renders `<WidgetDashboard.Widgets />` by default. Pass `children` to compose the surface — header, empty state, footer — around the grid:
`<WidgetDashboard>` renders `<WidgetDashboard.Widgets />` by default. Pass `children` to compose the dashboard — header, empty state, footer — around the grid:

```tsx
<WidgetDashboard
Expand Down Expand Up @@ -70,7 +70,7 @@ Optional. Configures the underlying grid.

#### `children`: `ReactNode`

Optional. Composition slot for arbitrary surface markup. When omitted, the engine renders `<WidgetDashboard.Widgets />` directly.
Optional. Composition slot for arbitrary dashboard markup. When omitted, the engine renders `<WidgetDashboard.Widgets />` directly.

## Compound components

Expand All @@ -88,9 +88,9 @@ Renders its children only when `layout` is empty. Pair it with `<WidgetDashboard

#### `<WidgetDashboard.Actions />`

Edit-mode toggle: a "Customize" button while `editMode` is off, and "Add widget", "Cancel", "Done" while it is on. Clicking "Customize" or "Done" fires `onEditChange` with the toggled value. Clicking "Add widget" opens the inserter (see below). Returns `null` when the dashboard is mounted without `onEditChange`, so surfaces that don't expose edit mode can keep `Actions` in their tree unconditionally.
Edit-mode toggle: a "Customize" button while `editMode` is off, and "Add widget", "Cancel", "Done" while it is on. Clicking "Customize" or "Done" fires `onEditChange` with the toggled value. Clicking "Add widget" opens the inserter (see below). Returns `null` when the dashboard is mounted without `onEditChange`, so hosts that don't expose edit mode can keep `Actions` in their tree unconditionally.

`<Page>` from `@wordpress/admin-ui` exposes an `actions` slot used across admin surfaces (DataViews, WidgetDashboard, …). Plug `Actions` straight into it:
`<Page>` from `@wordpress/admin-ui` exposes an `actions` slot used across admin screens (DataViews, WidgetDashboard, …). Plug `Actions` straight into it:

```tsx
import { Page } from '@wordpress/admin-ui';
Expand Down Expand Up @@ -119,7 +119,7 @@ A modal-based inserter is mounted automatically inside `WidgetDashboard`. It sta

On confirmation, the inserter creates instances via `createDashboardWidget( widgetType )` (using each type's `example.attributes` as the initial values) and appends them to `layout` through `onLayoutChange`. The dialog closes after a successful insertion or when the user dismisses it.

The inserter has no opt-out today; surfaces that want a custom widget-picking experience should compose their own UI alongside `<WidgetDashboard.Widgets />` and avoid rendering `<WidgetDashboard.Actions />` (which exposes the trigger).
The inserter has no opt-out today; hosts that want a custom widget-picking experience should compose their own UI alongside `<WidgetDashboard.Widgets />` and avoid rendering `<WidgetDashboard.Actions />` (which exposes the trigger).

## Authoring widgets

Expand All @@ -132,7 +132,7 @@ interface WidgetRenderProps< Item = unknown > {
}
```

`setAttributes` flows back through `onLayoutChange` on the dashboard. Removal, badges, and error chrome are not part of this contract — those belong to the surface.
`setAttributes` flows back through `onLayoutChange` on the dashboard. Removal, badges, and error chrome are not part of this contract — those belong to the host.

## Types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import type { MoreActionsDropdownItem } from '../more-actions-dropdown';
* accumulate changes on top of pending layout edits, and vice versa.
*
* Returns `null` when the dashboard is mounted without `onEditChange`
* so surfaces that don't expose edit mode can keep `Actions` in their
* so hosts that don't expose edit mode can keep `Actions` in their
* tree unconditionally.
*
* @return {React.ReactNode} - The Actions component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ interface LayoutSettingsProps {
* buttons is treated as Cancel. None of these exit customize mode.
*
* Settings and layout-editing are kept as separate flows on the
* dashboard surface (the Layout settings entry that opens this
* drawer is disabled while edit mode is on), so the drawer's
* commit never publishes layout edits that the user is in the
* middle of staging through the toolbar.
* dashboard (the Layout settings entry that opens this drawer is
* disabled while edit mode is on), so the drawer's commit never
* publishes layout edits that the user is in the middle of staging
* through the toolbar.
*
* @param {LayoutSettingsProps} props Layout settings props.
* @return {React.ReactNode} The layout settings component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ interface ProviderProps {
* - The shared commit assumes the two slices are not edited
* simultaneously. The bundled `Actions` keeps the layout-edit and
* settings-drawer flows mutually exclusive; consumers that compose
* a different surface must uphold the same invariant or accept the
* a different host must uphold the same invariant or accept the
* cross-publish.
* - Staging re-syncs from the committed props on prop change.
* In-flight edits are dropped silently when an external update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function isValidWidgetModule( module: unknown ): module is WidgetModule {
/*
* Module-level cache keyed by `renderModule`. The lazy component must keep a
* stable identity across renders: rebuilding it inline (e.g. via `useMemo`)
* resets the Suspense boundary and the resolved module each time the surface
* resets the Suspense boundary and the resolved module each time the host
* re-renders.
*/
const componentCache = new Map< string, LazyWidgetComponent >();
Expand All @@ -40,7 +40,7 @@ const componentCache = new Map< string, LazyWidgetComponent >();
* Resolve a widget render module to a `lazy()` React component, cached by
* `renderModule` id. The first call for a given id builds the lazy wrapper
* around the resolver; subsequent calls return the same instance so that
* surfaces and Suspense boundaries can rely on a stable component identity.
* hosts and Suspense boundaries can rely on a stable component identity.
* @param renderModule
* @param resolveWidgetModule
*/
Expand Down
12 changes: 6 additions & 6 deletions routes/dashboard/widget-primitives/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Widget type definitions.
*
* Canonical home for widget identity types consumed by the registry,
* surfaces that render widgets, and tools that author them
* hosts that render widgets, and tools that author them
* (`@wordpress/build`, schema validators, IDE autocomplete).
*
* Each type is generic over the widget's attribute object (`Item`) so a
Expand Down Expand Up @@ -35,7 +35,7 @@ export type WidgetName = `${ string }/${ string }`;
* (`render.*`, `widget.*`, `render.scss`), not declared here.
*
* Consumed by tooling (IDE autocomplete, validation, the build pipeline).
* Surfaces that render widgets consume the richer `WidgetType` below,
* Hosts that render widgets consume the richer `WidgetType` below,
* which extends this shape with runtime-only fields produced by the
* build manifest.
*/
Expand Down Expand Up @@ -106,7 +106,7 @@ export interface WidgetTypeMetadata< Item = unknown > {

/**
* Declarative attribute schema, bound to the widget's attribute
* object via `Item`. Surfaces render forms straight from this list
* object via `Item`. Hosts render forms straight from this list
* via `DataForm`, with no per-widget form wiring.
*/
attributes?: Field< Item >[];
Expand All @@ -122,7 +122,7 @@ export interface WidgetTypeMetadata< Item = unknown > {
}

/**
* Runtime widget type consumed by surfaces.
* Runtime widget type consumed by hosts.
*
* Extends `WidgetTypeMetadata` (the authoring shape of `widget.json`) with
* runtime-only fields produced by the build pipeline. Notably
Expand All @@ -144,7 +144,7 @@ export interface WidgetType< Item = unknown >
}

/**
* Props passed to a widget's render component by the consuming surface.
* Props passed to a widget's render component by the consuming host.
*
* Bound over `Item` so the destructured `attributes` and any
* `setAttributes` payload are typed against the widget's attribute
Expand All @@ -158,7 +158,7 @@ export interface WidgetRenderProps< Item = unknown > {

/**
* Updates the attributes of this instance. Optional because some
* surfaces render widgets in read-only contexts.
* hosts render widgets in read-only contexts.
*/
setAttributes?: ( next: Partial< Item > ) => void;
}
Expand Down
Loading