Add experiment to show admin bar in Post and Site Editor#77964
Conversation
|
Size Change: +6.72 kB (+0.08%) Total Size: 7.97 MB 📦 View Changed
ℹ️ View Unchanged
|
5f86fee to
02f78b0
Compare
|
Flaky tests detected in 812345d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/26101878742
|
5e4770b to
543c14f
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ba11c1b to
728dc74
Compare
tyxla
left a comment
There was a problem hiding this comment.
Thanks for addressing the feedback, I think it's looking much better.
I still think there are a couple of good opportunities before we land it, see my inline comments.
My biggest concern is the lack of isolation and unconditional loading of the new styles. Luckily, there is an elegant solution.
visibility via CSS
f69c744 to
c187ddd
Compare
c187ddd to
d44f9ec
Compare
Good catch, I forgot about color schemes 😅 fixed via 221bc4f. Now the color schemes are applied in all pages you mentioned above. I attached screenshots of the site editor on all color schemes in the PR description. Not sure if it's the best solution. Basically we need to duplicate the color scheme definitions from Core, which are hardcoded, as new variables, then use the variables in the CSS. |
d4f6331 to
5cabe16
Compare
|
I can't find my previous comments on the commit about the color schemes, so I don't know if you replied, Github UI is so broken. |
|
Here's your comments. I think it's broken because the comments were on a specific commit: Now I think the color schemes are NOT independent of this experiment. I mean I believe this experiment does need the site editor sidebar to match the admin bar. Otherwise in certain color schemes it will look very weird. What's independent is that whether the sidebar should match the admin bar color when the experiment is off (or this behavior never lands as default behavior). I'll create a separate PR for that; I think how color schemes work needs more discussion. |
|
@youknowriad any more objection to merging this? 😄 |
Resolved conflicts in back-button components: trunk renamed the `Icon` import to `WCIcon`; kept the admin-bar-in-editor branching logic and updated it to use `WCIcon`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
OK now I have tested that this PR will "merge" cleanly with the other PR #78397. Here are screenshots for all color schemes. Note that as noted in that PR, it's not possible (for now) to match the admin bar background color with the site editor sidebar's exactly.
|
|
At a glance this looks good to me. If @WordPress/gutenberg-design has thoughts, here's a ping, otherwise perhaps this is mostly a code review we need! Thanks for working diligently on this. |
youknowriad
left a comment
There was a problem hiding this comment.
No objections from me, go for it.
|
Thanks all for the reviews. Really appreciate it. Merging... |
💯 I don't know if we urgently have to edit this, but there is most definitely some deduplication work we can do here. Even ⌘K becomes a bit of an open question how that gets unified, given the gray document title sits in the top toolbar too. |
















Trac ticket: https://core.trac.wordpress.org/ticket/65091
What?
This PR adds a Gutenberg experiment to show the admin bar (a.k.a. Toolbar) in fullscreen Post and Site Editor.
See this Trac ticket for more context: https://core.trac.wordpress.org/ticket/65091.
Why?
We want to test an editor experience where we keep the admin bar and show a clearer button that exits the editor. We want to avoid users from getting lost in the fullscreen editor.
How?
This PR registers a new
gutenberg-admin-bar-in-editorexperiment.The admin bar is actually printed in the HTML all along, but hidden/covered by the fullscreen editor. So, if the experiment is enabled, the
<body>gets a new CSS class,.is-admin-bar-in-editor-enabled, which adjusts some CSS so that the admin bar is uncovered.This PR also replaces the top-left site icon with an explicit back button, which makes it clearer how to exit the editor. No information is lost because we show the site name in the admin bar.
Testing Instructions
Testing Instructions for Keyboard
The admin bar elements and site editor can still be reached using keyboard (tabs).
Screenshots or screencast
Site Editor
Post Editor
Site Editor on various admin color schemes(reverted, will be in a separate PR)See: #78331
Use of AI Tools
I used Codex which helped me implement this feature.