From 51ea9222cb273ba47ec0a9189102e751aabee366 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sat, 5 Sep 2026 18:12:12 +0900 Subject: [PATCH 1/7] Site Editor: Add a root error boundary to prevent a blank screen Co-Authored-By: Claude --- packages/edit-site/CHANGELOG.md | 1 + packages/edit-site/src/components/layout/index.jsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/edit-site/CHANGELOG.md b/packages/edit-site/CHANGELOG.md index 031a6dd84b2f31..43548f32b7d4a6 100644 --- a/packages/edit-site/CHANGELOG.md +++ b/packages/edit-site/CHANGELOG.md @@ -8,6 +8,7 @@ ### Bug Fixes +- `Layout`: Add a root `ErrorBoundary`, so a throw outside the per-area ones no longer blanks the screen. - `WelcomeGuide`: Keep the modal close icon white on hover now that it is stroke-based. ([#78812](https://github.com/WordPress/gutenberg/pull/78812)) - `SidebarNavigationItem`: Stop forcing `style={ { fill: 'currentcolor' } }` on the icon. The explicit override was clobbering stroke-based icons' intrinsic styling. Colour is inherited via CSS `color` and the icon's own declared fills/strokes. ([#78808](https://github.com/WordPress/gutenberg/pull/78808)) - `AddNewTemplate`: Preserve the admin theme color on the Author template icon after it became stroke-based. ([#78808](https://github.com/WordPress/gutenberg/pull/78808)) diff --git a/packages/edit-site/src/components/layout/index.jsx b/packages/edit-site/src/components/layout/index.jsx index 405a1703acbc3f..74c35edfac2d78 100644 --- a/packages/edit-site/src/components/layout/index.jsx +++ b/packages/edit-site/src/components/layout/index.jsx @@ -322,7 +322,9 @@ export default function LayoutWithGlobalStylesProvider( props ) { } } > - + + + From 90f4a59cc25bc415f9b3a5a9a6604ffeb66a8209 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sat, 5 Sep 2026 18:16:12 +0900 Subject: [PATCH 2/7] Site Editor: Add the PR reference to the changelog entry Co-Authored-By: Claude --- packages/edit-site/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-site/CHANGELOG.md b/packages/edit-site/CHANGELOG.md index 43548f32b7d4a6..b2e8b6da8f4663 100644 --- a/packages/edit-site/CHANGELOG.md +++ b/packages/edit-site/CHANGELOG.md @@ -8,7 +8,7 @@ ### Bug Fixes -- `Layout`: Add a root `ErrorBoundary`, so a throw outside the per-area ones no longer blanks the screen. +- `Layout`: Add a root `ErrorBoundary`, so a throw outside the per-area ones no longer blanks the screen. ([#82486](https://github.com/WordPress/gutenberg/pull/82486)) - `WelcomeGuide`: Keep the modal close icon white on hover now that it is stroke-based. ([#78812](https://github.com/WordPress/gutenberg/pull/78812)) - `SidebarNavigationItem`: Stop forcing `style={ { fill: 'currentcolor' } }` on the icon. The explicit override was clobbering stroke-based icons' intrinsic styling. Colour is inherited via CSS `color` and the icon's own declared fills/strokes. ([#78808](https://github.com/WordPress/gutenberg/pull/78808)) - `AddNewTemplate`: Preserve the admin theme color on the Author template icon after it became stroke-based. ([#78808](https://github.com/WordPress/gutenberg/pull/78808)) From 026e75511316abad213f23aa84693da9e233fabe Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sat, 5 Sep 2026 18:21:10 +0900 Subject: [PATCH 3/7] Site Editor: Offer the crashed editor's content for copying Co-Authored-By: Claude --- packages/edit-site/src/components/layout/index.jsx | 2 +- packages/editor/src/components/error-boundary/index.jsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/edit-site/src/components/layout/index.jsx b/packages/edit-site/src/components/layout/index.jsx index 74c35edfac2d78..d4418a79e1c184 100644 --- a/packages/edit-site/src/components/layout/index.jsx +++ b/packages/edit-site/src/components/layout/index.jsx @@ -322,7 +322,7 @@ export default function LayoutWithGlobalStylesProvider( props ) { } } > - + diff --git a/packages/editor/src/components/error-boundary/index.jsx b/packages/editor/src/components/error-boundary/index.jsx index e9e9ca77b2d39a..b1e30e8c551076 100644 --- a/packages/editor/src/components/error-boundary/index.jsx +++ b/packages/editor/src/components/error-boundary/index.jsx @@ -17,6 +17,8 @@ function getContent() { // application. return select( editorStore ).getEditedPostContent(); } catch {} + // The site editor has routes that never mount an editor. + return ''; } // A boundary catches whatever was thrown, which is not always an `Error`. From 86660d0a6a4db938ee0ff1b250309a7ae37139b4 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sat, 5 Sep 2026 18:29:34 +0900 Subject: [PATCH 4/7] Editor: Correct the getContent fallback rationale Co-Authored-By: Claude --- packages/editor/src/components/error-boundary/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/components/error-boundary/index.jsx b/packages/editor/src/components/error-boundary/index.jsx index b1e30e8c551076..9cd43170b025a5 100644 --- a/packages/editor/src/components/error-boundary/index.jsx +++ b/packages/editor/src/components/error-boundary/index.jsx @@ -17,7 +17,7 @@ function getContent() { // application. return select( editorStore ).getEditedPostContent(); } catch {} - // The site editor has routes that never mount an editor. + // Serializing the blocks can throw too, and copying 'undefined' helps nobody. return ''; } From 2bc8a344dbd05b03009b1f89b055f96a33e494b1 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sat, 5 Sep 2026 18:32:00 +0900 Subject: [PATCH 5/7] Editor: Explain the getContent empty-string fallback Co-Authored-By: Claude --- packages/editor/src/components/error-boundary/index.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/components/error-boundary/index.jsx b/packages/editor/src/components/error-boundary/index.jsx index 9cd43170b025a5..d0d009f6d67dc2 100644 --- a/packages/editor/src/components/error-boundary/index.jsx +++ b/packages/editor/src/components/error-boundary/index.jsx @@ -17,7 +17,12 @@ function getContent() { // application. return select( editorStore ).getEditedPostContent(); } catch {} - // Serializing the blocks can throw too, and copying 'undefined' helps nobody. + // Only reached when the retrieval itself throws: the selector already returns + // '' of its own accord when no post is loaded. Serializing the blocks can + // fail, and the blocks are exactly what tends to be broken once a boundary + // has caught something. Returning nothing here would put the string + // 'undefined' on the clipboard, as `useCopyToClipboard` hands the value to + // `writeText` unchanged. return ''; } From 470cf2fdacfec9fb7bdeb53a9d44e69acbbfaff5 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sat, 5 Sep 2026 18:33:18 +0900 Subject: [PATCH 6/7] Editor: Trim the getContent fallback comment Co-Authored-By: Claude --- packages/editor/src/components/error-boundary/index.jsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/editor/src/components/error-boundary/index.jsx b/packages/editor/src/components/error-boundary/index.jsx index d0d009f6d67dc2..461eefa8de4b84 100644 --- a/packages/editor/src/components/error-boundary/index.jsx +++ b/packages/editor/src/components/error-boundary/index.jsx @@ -17,12 +17,7 @@ function getContent() { // application. return select( editorStore ).getEditedPostContent(); } catch {} - // Only reached when the retrieval itself throws: the selector already returns - // '' of its own accord when no post is loaded. Serializing the blocks can - // fail, and the blocks are exactly what tends to be broken once a boundary - // has caught something. Returning nothing here would put the string - // 'undefined' on the clipboard, as `useCopyToClipboard` hands the value to - // `writeText` unchanged. + // Rather than copying the string 'undefined'. return ''; } From 0a91c54086b84adce8b97a31324e077dc0cbd89e Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sat, 5 Sep 2026 18:35:53 +0900 Subject: [PATCH 7/7] Site Editor: Drop canCopyContent from the root boundary Co-Authored-By: Claude --- packages/edit-site/src/components/layout/index.jsx | 2 +- packages/editor/src/components/error-boundary/index.jsx | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/edit-site/src/components/layout/index.jsx b/packages/edit-site/src/components/layout/index.jsx index d4418a79e1c184..74c35edfac2d78 100644 --- a/packages/edit-site/src/components/layout/index.jsx +++ b/packages/edit-site/src/components/layout/index.jsx @@ -322,7 +322,7 @@ export default function LayoutWithGlobalStylesProvider( props ) { } } > - + diff --git a/packages/editor/src/components/error-boundary/index.jsx b/packages/editor/src/components/error-boundary/index.jsx index 461eefa8de4b84..e9e9ca77b2d39a 100644 --- a/packages/editor/src/components/error-boundary/index.jsx +++ b/packages/editor/src/components/error-boundary/index.jsx @@ -17,8 +17,6 @@ function getContent() { // application. return select( editorStore ).getEditedPostContent(); } catch {} - // Rather than copying the string 'undefined'. - return ''; } // A boundary catches whatever was thrown, which is not always an `Error`.