Repository navigation
feat: clarify label & add help text with link #70451
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
Changes from 14 commits
9a1a576
95ebc0d
7a0e65c
87d4657
3c8418a
df5efda
0047bd8
6288f0e
6d46aee
9c17788
fcf900b
31b697b
2b71099
866c08d
a2bafbd
83ef20b
2c610ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ import { | |||||
| ToggleControl, | ||||||
| TextControl, | ||||||
| __experimentalVStack as VStack, | ||||||
| ExternalLink, | ||||||
| } from '@wordpress/components'; | ||||||
| import { | ||||||
| Icon, | ||||||
|
|
@@ -230,9 +231,19 @@ const ImageURLInputUI = ( { | |||||
| <TextControl | ||||||
| __next40pxDefaultSize | ||||||
| __nextHasNoMarginBottom | ||||||
| label={ __( 'Link rel' ) } | ||||||
| label={ __( 'Link Relation' ) } | ||||||
| value={ rel ?? '' } | ||||||
| onChange={ onSetLinkRel } | ||||||
| help={ | ||||||
| <> | ||||||
| { __( | ||||||
| 'The Link Relation attribute defines the relationship between a linked resource and the current document.' | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think we should use standard casing here. This matches casing in the MDN article. Note: Label and text changes should be the same everywhere. |
||||||
| ) }{ ' ' } | ||||||
| <ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"> | ||||||
| { __( 'Learn more.' ) } | ||||||
| </ExternalLink> | ||||||
| </> | ||||||
| } | ||||||
| /> | ||||||
| <TextControl | ||||||
| __next40pxDefaultSize | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ import { | |
| TextControl, | ||
| ToolbarButton, | ||
| Popover, | ||
| ExternalLink, | ||
| __experimentalToolsPanel as ToolsPanel, | ||
| __experimentalToolsPanelItem as ToolsPanelItem, | ||
| __experimentalToggleGroupControl as ToggleGroupControl, | ||
|
|
@@ -474,7 +475,17 @@ function ButtonEdit( props ) { | |
| <TextControl | ||
| __next40pxDefaultSize | ||
| __nextHasNoMarginBottom | ||
| label={ __( 'Link rel' ) } | ||
| label={ __( 'Link Relation' ) } | ||
| help={ | ||
| <> | ||
| { __( | ||
| 'The Link Relation attribute defines the relationship between a linked resource and the current document.' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to avoid using meaningless link text like "Learn more". Can we instead place the link on the word "link relation attribute"?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @joedolson. I'd incorporate those changes. Btw, what do you think about the sentence case thing suggested by @Mamaduka earlier?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@Mamaduka @joedolson I have got the link inline with element interpolation. From what I think, now it makes sense to keep the casings as it is since now "Link Relation" is a term that we refer externally directly by clicking on it. I am not sure though and not aware if any guidelines are there for such a case. What do you think?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't have a strong opinion here; I usually follow the text copy guidelines. We could keep casing in the help text, but let's fix it for the label.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean the label above the input box? That is capitalized automatically. All labels are like that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #70451 (comment).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it! Done. |
||
| ) }{ ' ' } | ||
| <ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"> | ||
| { __( 'Learn more.' ) } | ||
| </ExternalLink> | ||
| </> | ||
| } | ||
| value={ rel || '' } | ||
| onChange={ ( newRel ) => | ||
| setAttributes( { rel: newRel } ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ import { | |
| Button, | ||
| Spinner, | ||
| TextControl, | ||
| ExternalLink, | ||
| __experimentalToolsPanel as ToolsPanel, | ||
| __experimentalToolsPanelItem as ToolsPanelItem, | ||
| } from '@wordpress/components'; | ||
|
|
@@ -316,7 +317,7 @@ export default function PostFeaturedImageEdit( { | |
| ) } | ||
| { isLink && ( | ||
| <ToolsPanelItem | ||
| label={ __( 'Link rel' ) } | ||
| label={ __( 'Link Relation' ) } | ||
| isShownByDefault | ||
| hasValue={ () => !! rel } | ||
| onDeselect={ () => | ||
|
|
@@ -328,7 +329,17 @@ export default function PostFeaturedImageEdit( { | |
| <TextControl | ||
| __next40pxDefaultSize | ||
| __nextHasNoMarginBottom | ||
| label={ __( 'Link rel' ) } | ||
| label={ __( 'Link Relation' ) } | ||
| help={ | ||
| <> | ||
| { __( | ||
| 'The Link Relation attribute defines the relationship between a linked resource and the current document.' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See previous request. |
||
| ) }{ ' ' } | ||
| <ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"> | ||
| { __( 'Learn more.' ) } | ||
| </ExternalLink> | ||
| </> | ||
| } | ||
| value={ rel } | ||
| onChange={ ( newRel ) => | ||
| setAttributes( { rel: newRel } ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ import { | |
| import { | ||
| ToggleControl, | ||
| TextControl, | ||
| ExternalLink, | ||
| __experimentalToolsPanel as ToolsPanel, | ||
| __experimentalToolsPanelItem as ToolsPanelItem, | ||
| } from '@wordpress/components'; | ||
|
|
@@ -205,7 +206,7 @@ export default function PostTitleEdit( { | |
| /> | ||
| </ToolsPanelItem> | ||
| <ToolsPanelItem | ||
| label={ __( 'Link rel' ) } | ||
| label={ __( 'Link Relation' ) } | ||
| isShownByDefault | ||
| hasValue={ () => !! rel } | ||
| onDeselect={ () => | ||
|
|
@@ -215,7 +216,17 @@ export default function PostTitleEdit( { | |
| <TextControl | ||
| __next40pxDefaultSize | ||
| __nextHasNoMarginBottom | ||
| label={ __( 'Link rel' ) } | ||
| label={ __( 'Link Relation' ) } | ||
| help={ | ||
| <> | ||
| { __( | ||
| 'The Link Relation attribute defines the relationship between a linked resource and the current document.' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See previous request. |
||
| ) }{ ' ' } | ||
| <ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"> | ||
| { __( 'Learn more.' ) } | ||
| </ExternalLink> | ||
| </> | ||
| } | ||
| value={ rel } | ||
| onChange={ ( newRel ) => | ||
| setAttributes( { rel: newRel } ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ import { | |
| ToggleControl, | ||
| ToolbarGroup, | ||
| TextControl, | ||
| ExternalLink, | ||
| __experimentalInputControl as InputControl, | ||
| __experimentalToolsPanel as ToolsPanel, | ||
| __experimentalToolsPanelItem as ToolsPanelItem, | ||
|
|
@@ -301,7 +302,17 @@ export default function RSSEdit( { attributes, setAttributes } ) { | |
| <TextControl | ||
| __next40pxDefaultSize | ||
| __nextHasNoMarginBottom | ||
| label={ __( 'Link rel' ) } | ||
| label={ __( 'Link Relation' ) } | ||
| help={ | ||
| <> | ||
| { __( | ||
| 'The Link Relation attribute defines the relationship between a linked resource and the current document.' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See previous request. |
||
| ) }{ ' ' } | ||
| <ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"> | ||
| { __( 'Learn more.' ) } | ||
| </ExternalLink> | ||
| </> | ||
| } | ||
| value={ rel || '' } | ||
| onChange={ ( value ) => setAttributes( { rel: value } ) } | ||
| /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ import { | |
| Dropdown, | ||
| TextControl, | ||
| ToolbarButton, | ||
| ExternalLink, | ||
| __experimentalToolsPanel as ToolsPanel, | ||
| __experimentalToolsPanelItem as ToolsPanelItem, | ||
| __experimentalInputControlSuffixWrapper as InputControlSuffixWrapper, | ||
|
|
@@ -243,7 +244,17 @@ const SocialLinkEdit = ( { | |
| <TextControl | ||
| __next40pxDefaultSize | ||
| __nextHasNoMarginBottom | ||
| label={ __( 'Link rel' ) } | ||
| label={ __( 'Link Relation' ) } | ||
| help={ | ||
| <> | ||
| { __( | ||
| 'The Link Relation attribute defines the relationship between a linked resource and the current document.' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See previous request. |
||
| ) }{ ' ' } | ||
| <ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"> | ||
| { __( 'Learn more.' ) } | ||
| </ExternalLink> | ||
| </> | ||
| } | ||
| value={ rel || '' } | ||
| onChange={ ( value ) => setAttributes( { rel: value } ) } | ||
| /> | ||
|
|
||

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 similar labels use sentence case. See: https://github.com/WordPress/gutenberg/blob/trunk/docs/contributors/documentation/copy-guide.md#five-pay-attention-to-capitalization