-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sidebar tabs to switch between doc and block settings. #1833
Conversation
@@ -0,0 +1,54 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be panel-tabs
instead.
Thanks for working on this. Designwise, I think it's good. I know @folletto had some concerns about not auto-switching to the block context, which I understand, but on the other hand I can't help but feel like this can work really well too, especially with the "No block selected" message. I also think this would be the time to try it. So 👍 👍 |
@jasmussen just to be clear, there's no auto-switch to block inspector mode unless you click on the block's cog icon. |
editor/sidebar/header.js
Outdated
const SidebarHeader = ( { panel, onSetPanel, toggleSidebar } ) => { | ||
return ( | ||
<div className="components-panel__header editor-sidebar__panel-tabs"> | ||
<h2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: these should be buttons even if we don't turn them into Tabs
.
|
||
const SidebarHeader = ( { panel, onSetPanel, toggleSidebar } ) => { | ||
return ( | ||
<div className="components-panel__header editor-sidebar__panel-tabs"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A component shouldn't be "stealing" another component's styles (.components-panel__header
). This is prone to unexpected breakage.
This simplifies the way the two sidebar mode are accessed. There are two layers now, selecting a mode, and selecting a block. This allows to have blocks selected while changing post settings, and avoids the switch of context whenever a block is selected with the sidebar open. This also means there's now a state in which "block" mode is selected, but no individual block is selected.
I'm showing a "No block selected" message, but we could get a bit more creative, maybe even showing the contents of the inserter. cc @jasmussen @melchoyce .
It also look like we should create a reusable component called "Tabs" to reuse in the inserter and here, and provide good accessibility out of the box. cc @youknowriad .
Closes #1730.