-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Components: Add info
prop support to MenuItem, FeatureToggle
#10802
Conversation
f5b14e0
to
2b50700
Compare
|
||
// Don't wrap text until viewport is beyond the mobile breakpoint. |
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 change directly undoes the intention of #8756.
Guess it depends if we'd rather:
Wrapped | Unwrapped |
---|---|
Also, the comment is misleading, where the previous behavior had the opposite effect.
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.
@alexislloyd thoughts on this?
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.
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.
I think wrapped is better here, as long as we're careful not to have the descriptions go over two lines with standard font sizes.
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.
I'm also ok with editing down the first description to "Access all tools in one place"
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.
We also have the option to enforce a max-width (with wrapping) on the description specifically, allowing both the main label and shortcut text grow unrestrained.
Edit Actually, this might not work so well, or at least it leaves the possibility that the description is prematurely wrapped when the button has a long primary label.
} else { | ||
await page.click( '.edit-post-more-menu button' ); | ||
} | ||
const toggleFixedToolbar = async ( isFixed ) => { |
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.
cc @noisysocks re #8807 (comment)
@@ -41,7 +41,7 @@ class IconButton extends Component { | |||
); | |||
|
|||
let element = ( | |||
<Button { ...additionalProps } aria-label={ label } className={ classes }> | |||
<Button aria-label={ label } { ...additionalProps } className={ classes }> |
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.
Can't you just use the label
prop?
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.
Not sure what you mean by "use". Button
doesn't have a label
prop.
- Type: `string` | ||
- Required: No | ||
|
||
Refer to documentation for [Shortcut's `shortcut` prop](../shortcut/README.md#shortcut). |
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.
Thanks for the detailed README here 👍
Design questions
|
Code wise, this look good 👍 |
Which shortcuts?
We already have two other variations of a descriptive subtext, one in the Post Visibility menu, the other of sidebar Controls (e.g. Drop Cap description). As implemented here, I've inherited precisely the style used for the sidebar controls (as proposed at #10340 (comment) and seconded at #10340 (comment)). Now, that being said, I kinda agree with you 😄 But I didn't want to go ahead and add a third variation of what amounts to the same usage. |
@aduth I was confused, just noticed these modes don't have shortcuts, I thought they had. |
I think it was suggested elsewhere but maybe the solution here is to darken the default color of the links instead. |
I think there's a snapshot that needs updating (e2e tests) |
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 👍 (I'd appreciate a design check first though)
cc @alexislloyd in case you have some thoughts on the design questions raised here |
Avoids offset indent on wrapped text
889d7ff
to
edf05c8
Compare
I think that this is an issue to resolve going forward to make sure we have consistent patterns for different type styles and usage guidelines, so that we avoid a lot of inconsistency. That's a longer-term solution though. For a two-line list item like this, I would propose that the |
…ress#10802) * Components: Allow aria-label override on IconButton * Components: Add `info` prop support to MenuItem * Edit Post: Add `info` prop support to FeatureToggle * Edit Post: Add feature toggle info texts * Components: Menu Item: Break text beyond mobile toolbar * Components: Icon Button: Indent text by SVG margin Avoids offset indent on wrapped text * Tweak menu item styling * Avoid italic text
Closes #10340
This pull request seeks to add a new
info
prop to theMenuItem
andFeatureToggle
components.Testing Instructions:
Verify an extended description is shown for the More Menu Unified Toolbar button, as in the screenshot above:
Notable variations:
Ensure unit tests pass: