-
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
Navigate regions landmarks style and position improvements #8554
Navigate regions landmarks style and position improvements #8554
Conversation
Very nice work, this fixes a ton of issues. This seems to fix a bunch of issues and make the whole thing work a bit better. I think we'll get this in without too much trouble. A few thoughts though:
Some thoughts to digest, hope it makes sense. |
@jasmussen thanks for your feedback. Animation expand inwards: eagle eye! Yep I think it can be done animating also the Counterclockwise: it works as it always worked, it just focuses the regions in the DOM order. Visually, it's a bit different but that depends on the slightly different visual order and DOM order. What is maybe a bit confusing now is that the new "Publish panel" region is the third one and maybe it should be the last one. Not sure it can be moved though /Cc @jorgefilipecosta Skip link to the publish box: this is part of the work done in #7552 and discussed during WCEU. As you know, everything must be within a landmark region. The Publish panel wasn't. Using landmark regions is like establishing a contract with users and inform them there are
GIven these two conditions are respected, I'm open to suggestions 🙂 That said, all these points are a bit out of the scope of this PR, happy to discuss them in separate issues if you feel strongly about them. Note: the build is failing for unrelated reasons (unrelated e2e tests failing?) |
Without diving deep into the code, I can't fully grok why it's difficult. Was it needlessly complex in the previous implementation also? I do think the animation is important. It's okay to make it faster, like .1s instead of .2s, but the presence of the animation makes the transition from region to region less jarring, and feels more intentional. It also ambiguates the type of focus, which I feel makes sense given it's landmark navigation as compared to regular tabbing. Re: counterclockwise, check.
Right. Just wondering if we can use the Publish button itself as a pseudo-skip-link instead of adding an additional publish button that does the same. In other words, could we have the publish button live inside a nested region of its own? I don't know which is more mental overhead, but there's something about this implementation that seems less than ideal. I don't know which is more mental overhead, but if this is the best implementation, no objections. As for further suggestions and separate PRs, I'm personally always a fan of iterative fixes. I'm sure better solutions will present themselves in the mean time, and I'm okay with intermediate fixes. About the tests, try pushing again, there were some docker issues recently. |
Crazy idea, shoot it down if it's too crazy: what if the publish dialog simply popped into view when it was navigated to? I.e. you'd navigate from initial focus to...
etc. |
The animation should be OK after the latest commit. Haven't touched its speed, it's
Hm ideally, nested landmarks should be avoided but that's not really the point. Please consider these regions will be used by both sighted keyboard users and screen reader users. Screen readers offers tools to jump through landmarks independently from the keyboard shortcut provided by Gutenberg: When users land on the page we need to establish a contract with them and inform them there are 4 landmarks (in addition to the WordPress ones):
These regions must always be there and they can't be empty. Aside: the "Editor settings" sidebar, which is dismissible, is an unsolved problem. So, once we have these 4 regions, what kind of content should be inside of them? Specifically, the publish panel is not rendered by default. In this default state, we could put inside the region the existing Publish button as you suggest. But then, the publish panel should be rendered there, in the same exact spot in the DOM, which means inside the top toolbar. I can easily imagine a lot of layout and CSS problems. So a better option is to place the "Editor publish" region separately in its own spot. At this point we still have the problem of what content should be there when the publish panel is not rendered. The POP / POOF option may seem to solve the issue at first sight. As in:
However, there's a problem:
Not saying the current implementation is ideal, I see your points, but I think it's the best we can do so far. |
Thinking at a different approach, why the publish panel is separated from the sidebar in the first place? What if the sidebar could be a sort of "dynamic sidebar" with content that changes depending on the flow context? After all, this is already what happens when plugins add their own sidebars: Ignore the fact the sidebar gets a different name ("Editor plugins region"). Having just 3 regions would be a nice simplification. Is it possible, from a technical and design perspective, to place the publish panel as fill of the sidebar? This way, the sidebar region would always have some content (except when it's collapsed by users, but that would be the result of an intentional action). Extending the concept of "dynamic sidebar" to the publish flow could be interesting to explore. At that point, the various buttons would just invoke their own sidebar content (settings, plugin, publish panel, etc.). Thoughts? |
cfd95fe
to
898b50d
Compare
Rebased on current master. Let's see if the builds pass. |
This is working well for me. I'm fine with this shipping. I think it's important we fix #8616 next, and I still think it would be good to think about how to avoid the duplicate publish button. |
Worth also noting the publishing flow is going to see many changes in #7602. |
898b50d
to
a318b31
Compare
Rebased. /Cc @jasmussen. See #9014. |
a318b31
to
bdf370c
Compare
Rebased. Worth noting the sidebar header sticky positioning and |
Sorry about the breakage. How can I help here? I feel the sticky header solves a problem, but if it introduces unintentional side effects,of the it can be revisited. |
Not sure. Is the |
I've tried, and I can't think of a good simple way to fix the focus issue in this situation. If we can't think of anything better for the sidebar, okay to remove it. |
bdf370c
to
66368fd
Compare
@afercia - what's the status of this one? Do you plan to bring it up to date to include it in the upcoming 5.1 release if it gets reviewed? For the time being, I'm marking it as |
* Improve publish panel landmark and button position. * Use outline for navigate regions focus style. * Avoid conflict with publish panel animation. * Make the outline animation expand inwards. * CSS lint after rebase. * Rebuild outline animation. * Try negative z-indexes. * Change animation timing to 0.1s.
* Improve publish panel landmark and button position. * Use outline for navigate regions focus style. * Avoid conflict with publish panel animation. * Make the outline animation expand inwards. * CSS lint after rebase. * Rebuild outline animation. * Try negative z-indexes. * Change animation timing to 0.1s.
Has the question of the I ask because I'm dealing with a legacy (i.e., geared toward Classic Editor) plugin that uses jQuery UI datepickers in a side metabox and the See this discussion in slack for the details of of why the I'd note that with WP 5.2.1 (with and without GB 5.7,0 active) if I set the I realize that supporting such legacy plugins that use metaboxes is not high on the GB priority list...but if that |
Seems to me the negative z-indexes are still necessary. Setting the panel's one to Quoting from a previous comment:
|
thanx for pointing that out...I hand't noticed it. I guess for the time being I'll just live with that overlap so that the plugin is (mostly) usable with GB. thanx for looking into it. |
Description
This PR seeks to improve the focus style of the navigate regions landmarks and the position of the "Open publish panel" region.
outline
instead of a CSS pseudo element: this way, when scrolling the page or the sidebar, the focus style is always displayed correctlyoutline-offset
so the pseudo-element method is kept just for this browser using@supports
to serve the outline method to modern browserseditor_region_focus
to animate just theoutline-width
: seems Safari doesn't like the animation on theoutline
shorthand:focus-within
, not supported by IE11 and EdgeNotes:
Example with scrolled content before:
And after (same happens in the sidebar);
Fixes #8553