-
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
[WIP] Core blocks: Refactor heading styles to use dropdown #6781
Conversation
So far, I mirrored what we have for |
I pushed a few changes so it now fits on an iPhone. Before: After: I also polished the subscript a bit. There's still a bit of messiness with the dropdown: But perhaps this is faster to fix than reverting? We can still look at improving the "style selector" at a later time, but this at least fixes the regression. |
Yes, let's move to 3.0. Reverting the original issue with #6794. |
1c75812
to
37e7434
Compare
I rebased this branch with the latest changes in @karmatosed and @mtias, this one needs your feedback before we can continue future iterations. As @jasmussen mentioned:
We could copy styles from the block switcher to make it work, but we want to provide a long-term solution which doesn't introduce too much code duplication. So let's agree on the final approach first before we take a deep dive into refactorings. The main question is if we want to have this drop-down as proposed, how much it should share logic with the block switcher? Or should we rather have an independent style switcher which could be used for other blocks (Quote?)? |
Matías, I recall from conversations I've had with you that you've never been happy with the block variation UI (see also #5947). I share that feeling. Do you think a variation picker drop-down as proposed here could be a solution? |
I have to admit I'm not wild about seeing a double 'H', I understand what this solves, but I'm not super sure a double drop down is the way forward. I am happy to be wrong there though. Maybe one iteration could be to not have double H somehow? If you look above it's a little less confusing than seeing the double H dropdown's beside each other. |
Just a crazy idea, what if we leverage the transform API to transform the block to it-self using modified attributes. This API doesn't exist at the moment, but this would allow us to show "Heading 1" ... "Heading N" in the block switcher dropdown. |
@karmatosed I suggested changing the block switcher icon to something different. (See initial post.) You could also replace one of the squares in that design with the icon of the current block so the block switcher could still double as a hint of what the current block is. @youknowriad There was a mockup of that sort of thing here: |
We could even go this route without the actual heading size changes being shown, and simply show H1-H6 in the block switcher. This would be simpler, and I think the most obvious way to go. But at the same time, I like @mtias thinking that we need a good UI for showing variations of a block, a pattern we can reuse for quotes in #5947. But I'm coming up short for what it should be, because you definitely need this variation chooser to be part of the block toolbar — we can't hide that in the sidebar. |
Yes, this might be even simpler to implement if we add another API in addition to |
I was initially opposed to having the heading type and transform options in the same dropdown, since it felt like an odd special-case solution. However, considering that the Quote block has similar block variations and other blocks may also implement this sort of thing in the future, and since the different block types are still separated from variations by the “Transform into:” text, I have changed my mind. I now think the single dropdown is the best solution. Switching heading size (or quote style) and transforming the block are pretty similar, and having them in a single dropdown both eliminates any confusion of 2 similar-looking dropdowns and also makes the block toolbar smaller... the same size as the Paragraph toolbar. |
I have to say I really like leveraging the transform API in the way @gziolo you show in the mock, great idea @youknowriad. |
Oh wow, that's great! Doing the same in the quote block (allowing multiple "styles" under the block transform menu) would be a great other use-case for this! |
@karmatosed, I’m closing this one given that we came out with a better idea how to tackle this issue 🎉 |
Description
Related issue: #783.
This PR tries to fix a regression introduced in #6675. On mobile devices, some controls are hard to access because there are too many of the rendered in the toolbar.
The proposed solution was described by @SuperGeniusZeb in #5635 (comment)
How has this been tested?
Manually.
Screenshots
It still needs more ❤️ .
Types of changes
Checklist: