Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Move EditorSnackbars component to the InterfaceSekeleton actions
  • Loading branch information
Mamaduka committed Jul 14, 2021
commit 501373c34f287b4b70f250c2b2f6659f48e0a5da
44 changes: 22 additions & 22 deletions packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,32 +247,32 @@ function Layout( { styles } ) {
</>
}
footer={
! hasReducedUI &&
showBlockBreadcrumbs &&
! isMobileViewport &&
isRichEditingEnabled &&
mode === 'visual' && (
<div className="edit-post-layout__footer">
<BlockBreadcrumb rootLabelText={ documentLabel } />
</div>
)
}
actions={
<>
<EditorSnackbars />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this breaks the UI a bit in "reduced interface mode" (and a couple other modes too). Basically the "footer" is not considered empty any more and an "empty" white area is shown.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should move it to the actions section?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the implications, it could be worth a try 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Works as expected actions area also has z-index, so stacking context is good for us. And If I understand correctly other elements rendered here are also popovers.

{ ! hasReducedUI &&
showBlockBreadcrumbs &&
! isMobileViewport &&
isRichEditingEnabled &&
mode === 'visual' && (
<div className="edit-post-layout__footer">
<BlockBreadcrumb
rootLabelText={ documentLabel }
/>
</div>
) }
<ActionsPanel
closeEntitiesSavedStates={
closeEntitiesSavedStates
}
isEntitiesSavedStatesOpen={
entitiesSavedStatesCallback
}
setEntitiesSavedStatesCallback={
setEntitiesSavedStatesCallback
}
/>
</>
}
actions={
<ActionsPanel
closeEntitiesSavedStates={ closeEntitiesSavedStates }
isEntitiesSavedStatesOpen={
entitiesSavedStatesCallback
}
setEntitiesSavedStatesCallback={
setEntitiesSavedStatesCallback
}
/>
}
shortcuts={ {
previous: previousShortcut,
next: nextShortcut,
Expand Down
8 changes: 2 additions & 6 deletions packages/edit-site/src/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ function Editor( { initialSettings } ) {
}
actions={
<>
<EditorSnackbars />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that you should test is whether it is possible to tab to the snackbar after you complete the action like publishing. In general, it's a challenge because the order of HTML elements matters here. I don't know how often we create snackbars as of today and how many of them have actionable items like links or inner buttons. Ideally, it's only a few tabs away when you want to use them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried but not able to tab to the snackbar in Gutenberg 11.0.

{ isEntitiesSavedStatesOpen ? (
<EntitiesSavedStates
close={
Expand All @@ -269,12 +270,7 @@ function Editor( { initialSettings } ) {
) }
</>
}
footer={
<>
<EditorSnackbars />
<BlockBreadcrumb />
</>
}
footer={ <BlockBreadcrumb /> }
/>
<Popover.Slot />
<PluginArea />
Expand Down