From 4ac5156a44a725042466e3db241968747f05ebd6 Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Thu, 9 Mar 2023 11:28:22 +0900 Subject: [PATCH 1/4] Distraction Free Mode: Don't show the metaboxes --- .../edit-post/src/components/layout/index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index 3fe02dbe5004f..d1b8868059169 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -83,7 +83,7 @@ function Layout( { styles } ) { isInserterOpened, isListViewOpened, showIconLabels, - isDistractionFreeMode, + isDistractionFree, showBlockBreadcrumbs, isTemplateMode, documentLabel, @@ -116,7 +116,7 @@ function Layout( { styles } ) { ).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ), showIconLabels: select( editPostStore ).isFeatureActive( 'showIconLabels' ), - isDistractionFreeMode: + isDistractionFree: select( editPostStore ).isFeatureActive( 'distractionFree' ), showBlockBreadcrumbs: select( editPostStore ).isFeatureActive( 'showBlockBreadcrumbs' @@ -126,8 +126,6 @@ function Layout( { styles } ) { }; }, [] ); - const isDistractionFree = isDistractionFreeMode && isLargeViewport; - const openSidebarPanel = () => openGeneralSidebar( hasBlockSelected ? 'edit-post/block' : 'edit-post/document' @@ -164,7 +162,7 @@ function Layout( { styles } ) { 'has-fixed-toolbar': hasFixedToolbar, 'has-metaboxes': hasActiveMetaboxes, 'show-icon-labels': showIconLabels, - 'is-distraction-free': isDistractionFree, + 'is-distraction-free': isDistractionFree && isLargeViewport, 'is-entity-save-view-open': !! entitiesSavedStatesCallback, } ); @@ -206,7 +204,7 @@ function Layout( { styles } ) { } content={ <> - { ! isDistractionFree && } + { ( ! isDistractionFree || ! isLargeViewport ) && ( + + ) } { ( mode === 'text' || ! isRichEditingEnabled ) && ( ) } { isRichEditingEnabled && mode === 'visual' && ( ) } - { ! isTemplateMode && ( + { ! isDistractionFree && ! isTemplateMode && (
@@ -265,8 +265,8 @@ function Layout( { styles } ) { } footer={ ! isDistractionFree && - showBlockBreadcrumbs && ! isMobileViewport && + showBlockBreadcrumbs && isRichEditingEnabled && mode === 'visual' && (
From bf8b15a8b2fc5a5ee409a895cb8dca9ea1136bcc Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Thu, 9 Mar 2023 14:29:48 +0900 Subject: [PATCH 2/4] Remove unnecessary condition --- packages/edit-post/src/components/layout/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index d1b8868059169..15bc017900daa 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -243,9 +243,7 @@ function Layout( { styles } ) { notices={ } content={ <> - { ( ! isDistractionFree || ! isLargeViewport ) && ( - - ) } + { ! isDistractionFree && } { ( mode === 'text' || ! isRichEditingEnabled ) && ( ) } From 77ab65804af1882dcb2e0104c42b9646ab476941 Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Thu, 9 Mar 2023 14:32:12 +0900 Subject: [PATCH 3/4] Don't show the notice bar when in the distraction-free mode --- packages/edit-post/src/components/layout/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index 15bc017900daa..aa5b65facaa0c 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -217,7 +217,7 @@ function Layout( { styles } ) { } /> } - editorNotices={ } + editorNotices={ ! isDistractionFree && } secondarySidebar={ secondarySidebar() } sidebar={ ( ! isMobileViewport || sidebarIsOpened ) && ( From b60e3fd76a1ebd57d6ee2a5657c90b37ba6199ea Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Thu, 9 Mar 2023 14:41:58 +0900 Subject: [PATCH 4/4] Revert "Don't show the notice bar when in the distraction-free mode" This reverts commit 77ab65804af1882dcb2e0104c42b9646ab476941. --- packages/edit-post/src/components/layout/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index aa5b65facaa0c..15bc017900daa 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -217,7 +217,7 @@ function Layout( { styles } ) { } /> } - editorNotices={ ! isDistractionFree && } + editorNotices={ } secondarySidebar={ secondarySidebar() } sidebar={ ( ! isMobileViewport || sidebarIsOpened ) && (