-
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
Site Editor: Move "Add Template"'s descriptions to tooltips #48710
Conversation
Size Change: -8 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
@@ -181,55 +187,68 @@ export default function NewTemplate( { | |||
{ isCreatingTemplate && ( | |||
<TemplateActionsLoadingScreen /> | |||
) } | |||
<NavigableMenu className="edit-site-new-template-dropdown__popover"> |
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.
<NavigableMenu>
doesn't seem to be needed since <DropdownMenu>
already renders it under the hood.
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.
LGTM, thanks Kevin!
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.
Nice work @kevin940726 👍
The tooltips are displaying nicely for me both via mouse and keyboard navigation.
While the need for the visually hidden description is unfortunate, it seems like a reasonable compromise in the short term.
Would it be worth adding a todo item on the Tooltip refactor issue to clean up uses of VisuallyHidden
such as the one introduced in this PR?
Yeah, nice suggestion! I'll leave a comment once this PR is merged. Pining @jameskoster for a design review now that the code seems to be approved. |
Unfortunately, the
Nice catch! Should be fixed now. |
That's a shame about the hacks, but it seems to be necessary here. Hopefully this is a temporary thing and we can revise the add-template flow holistically for 6.3. For testing purposes, here's the longest proposed description:
It might be worth double checking with that to stress-test the solution. If we can get away with making the max-width a little narrower, that might be good. 320px seems to work well in terms of readability. |
Flaky tests detected in 0c57f20. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4331163976
|
Oof we'll definitely need a better solution beyond 6.2 🙈 Proper spacing between paragraphs might help a little. The 320 version feels slightly easier to read to me, but it's not a strong opinion. I suppose we can easily tweak that in a follow-up if necessary. |
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: 9afa204 |
* Move template description to tooltip * Add VisuallyHidden * Fix styling and allow long description * Use 320px
What?
Close #48589. Move the descriptions inside the "Add template" popover to tooltips.
Why?
See #48589. This is meant to be the first iteration for 6.2 until we find a better alternative.
How?
Using
<Tooltip>
component to wrap the menu item. Note that this component currently is not accessible, ongoing work is tracked in #48222. In the meantime, I'm using<VisuallyHidden>
to keep it accessible as the original to screen readers in a less ideal way.Testing Instructions
Testing Instructions for Keyboard
/wp-admin/site-editor.php?canvas=view&path=%2Fwp_template&postType=wp_template
Screenshots or screencast