-
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
Improve link conrol preview when show button text label is enabled. #61726
Improve link conrol preview when show button text label is enabled. #61726
Conversation
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. |
Size Change: +13 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
Seems fine as a interim fix. It would be good to see how these patterns can scale to other contexts, it seems likely that in some contexts, stacking won't work, and scrolling or some overflow handling may be required. |
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.
This PR is working as expected to me and I think it's okay to ship it as is.
The video below shows how buttons wrap properly even in a narrow viewport without overflowing.
53042c61a1d17d5b40450f65068e4afb.mp4
A more serious problem, not related to this PR, is that the text in the block toolbar is awkwardly wrapped 😅
Just wanted to keep the right alignment to not introduce unrelated changes. Will adjust it.
Horizontal scrolling should be avoided as it's unexpected and difficult for keyboard users. Also, regardless whether it's vertical or horizontal scrolling, the editor still doesn't have a 'scrollable div' component that is fully accessible. In #47426 I did some work to make the modal dialog scrollable content fully accessible but I couldn't find the time amd momentum to port that to a more abstracted component.
That is very likely to happen wherever fixed heights are in use. Elements with fixed sizes and/or fixed or sticky positioning are known to trigger that kind of problem. Ideally, fixed sizes should be avoided to allow content to behave as it is expected to on the web: to reflow and adapt to a changing viewport. |
f0a1916
to
5ac4cba
Compare
Flaky tests detected in 5ac4cba. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9210022752
|
…ordPress#61726) * Improve link conrol preview when show button text label is enabled. * Reduce gap. * Remove right alignment. Co-authored-by: afercia <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: richtabor <[email protected]>
…ordPress#61726) * Improve link conrol preview when show button text label is enabled. * Reduce gap. * Remove right alignment. Co-authored-by: afercia <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: richtabor <[email protected]>
See #61158
What?
When the 'Show button text labels' preference is enabled, the LInkControl preview has very limited horizontal space to show its content, especially with some languages. See screenshots at #61158 (comment)
Both the link preview and the buttons with visible text need more horizontal space.
When 'Show button text labels' is enabled, there is no need to show the preview and the buttons on the same line. IN a way, 'Show button text labels' already changes the UI and it is reasonable to accomodate a different layout for the buttons with visible text. Laying out the buttons on a new line appears to be the simplest and more effective solution.
Pinging a few people who worked on this UI or are familiar with non-westeren languages:
@richtabor @MaggieCabrera @scruffian @getdave @t-hamano
Why?
How?
Makes the buttons go in a new line, only when the
Show button text labels
preference is enabled. There should be no visual changes for the default layout with icon buttons.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before
After
Default is unchanged:
'Show button text labels' enabled, English:
'Show button text labels' enabled, Spanish:
'Show button text labels' enabled, Japanese: