Better preview tool collapsing#4774
Conversation
Putting the toolbar and headernav toggles at the end of the toolbar, not absolutely positioned, makes the wrapping look a little better.
hiding the toolbar now interpolates the size between 100% and `auto` (a relatively new feature in Chrome). And without the absolute positioning, we can remove the left padding on the toolbar and all the items are truly centered. Probably going to look into using Grid next.
Changed pattern so that toolbar "slides out", toggled not by the somewhat vague "glasses" icon but by a caret. Caret retains full button width, but otherwise is less visually distracting than the glasses, and I think more descriptive of what it does (it flips left/right depending on open/close state). decoupled HeaderNav toggle from toolbar toggle.
Co-authored-by: Copilot <copilot@github.com>
|
Pretty sure we want to keep the header nav button visible either way, and to the left where the nav is going to be, so maybe we should remove it from inside the bar. Btw if you wouldn't mind, add a small little |
You are right about the live site. However, with this PR, the navbar doesn't just hide but it is fully removed. So that won't be an issue.
Can you explain why it should be visible either way? |
Great
If only cause its the current behavior. I don't recall if we discussed this, @G-Ambatte might have the answer. |
Description
This PR revisits the Preview Toolbar at an aesthetic level. I've never been satisfied with the opening/closing mechanism, or the "glasses" icon.
Now:
transitions now, using the newinterpolate-sizecss property to be able to transition betweenautoand some fixed size (100%).Related Issues or Discussions
Largely stems from the UI Overhaul work, but otherwise this hasn't been discussed, agreed on, etc.
QA Instructions, Screenshots, Recordings
Click the Show/Hide caret toggle, check tooltips, squash viewport/preview pane, try header nav in both opened/closed toolbar state, check that state is preserved between open/close wherever it needs to be.
Note that in non-chromium browsers there are a couple features that aren't supported (
height: stretchfor one) but that doesn't really have any negative consequences. Everything is totally fine in those browsers.PR:

Current:

Reviewer Checklist
*Reviewers, refer to this list when testing features, or suggest new items *
Next steps
I'd like to re-think the
flexlayout of the toolbar so that it more gracefully collapses as the viewport shrinks. I'm not a big fan of the vertical space it takes, especially beyond two rows. But that's going to take some work, so leaving that for now.I will also take a swing at reworking the tooltips component to work with the Anchor Positioning/Popover API's (and Oddbird polyfill) to get better algorithmic positioning, which is something that the Preview toolbar and other menubars would really benefit from. As an independent PR.