fix(IconHelp): stable sizing and alignment, add stories and guideline#1115
fix(IconHelp): stable sizing and alignment, add stories and guideline#1115JeanMarcMilletScality wants to merge 2 commits into
Conversation
Pin the help button to a fixed 1rem hit area centered with inline-flex, keep the icon size constant across consumers, and use FontAwesome's -0.125em baseline offset for consistent inline alignment. Add focused usage stories (Simple, Tooltip placement, Explaining values) and a component-level Guideline mdx. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Hello jeanmarcmilletscality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
The second phrase is more in the "when to use" part. |
Cuervino
left a comment
There was a problem hiding this comment.
Design review of the guideline and stories. The component fix itself is correct.
Seven points below: two are blocking (intro structure, validation rule in tooltip), five are improvements to the guideline coverage.
|
|
||
| # IconHelp | ||
|
|
||
| `IconHelp` is a small info icon that reveals a tooltip on hover or focus. Use it to provide secondary information without overloading the interface. |
There was a problem hiding this comment.
The intro should be a single descriptive sentence, per the guideline writing convention in CLAUDE.md. The second sentence ("Use it to provide secondary information without overloading the interface") is a usage recommendation and belongs in "When to use it".
Suggested intro: `IconHelp` is an inline icon button that reveals a tooltip on hover or focus.
There was a problem hiding this comment.
Applied as suggested in e009220. Intro is now IconHelp` is an inline icon button that reveals a tooltip on hover or focus. and the usage recommendation moved into the opening line of "When to use it".
| ## When not to use it | ||
|
|
||
| - **Don't use it as the only way to convey critical information.** A tooltip is hidden by default — anything required to complete a task must remain visible (helper text, error message, inline description). | ||
| - **Don't stack multiple `IconHelp` next to each other.** If a section needs that much explanation, write a short paragraph or link to documentation instead. |
There was a problem hiding this comment.
Two parts of this bullet need clarification.
"Write a short paragraph" — where? Name the concrete pattern: a description paragraph below the section heading, an InfoMessage above the content area, etc. Without a target location, this advice is not actionable.
"Link to documentation" has the same gap: how is the link surfaced? Inline in the layout? As an InfoMessage footer? This needs a concrete pattern or should be removed.
There was a problem hiding this comment.
Rewrote the bullet in e009220 to name concrete patterns: a description paragraph under the section heading, or an InfoMessage above the content area (with a link to the dedicated doc page when a longer explanation is needed). "Never long text in a tooltip" is now explicit.
|
|
||
| ## Explaining values in a key/value list | ||
|
|
||
| In summary or detail pages, attach an `IconHelp` only to the values whose meaning is not obvious. Leave plain values (a name, an email, an ID) without one. |
There was a problem hiding this comment.
IconHelp can also go on the key side when the label itself is the opaque term: "Object lock", "RPO", "Standard" (as a storage class). The current phrasing ("attach... only to the values") is too restrictive and will mislead consumers.
Suggest updating this sentence and adding a labelHelp prop to KeyValueRow in the story to show key-side placement alongside value-side placement.
There was a problem hiding this comment.
Done in e009220. The section now spells out both sides — key-side when the label itself is opaque (Object lock, RPO, Replication policy) and value-side when the value is the unclear term. The story's KeyValueRow got a new labelHelp prop and Object lock + RPO are demonstrated key-side.
|
|
||
| ## In a form | ||
|
|
||
| In forms, `FormGroup` already exposes a `labelHelpTooltip` prop that renders an `IconHelp` next to the field label — you don't need to add one manually. Use it to clarify: |
There was a problem hiding this comment.
The section is missing the key decision rule: use helper text when the information is needed to complete the task, because it is always visible. IconHelp in a form is appropriate only for conceptual context — what a field represents, why it matters — not for constraints the user must act on to fill the form correctly.
Without this distinction, consumers have no clear signal for when to reach for IconHelp versus FormGroup.helperText.
There was a problem hiding this comment.
Added in e009220. "In a form" now opens with the decision rule: helper text (via FormGroup's help prop, always visible) for task-completion info; IconHelp (labelHelpTooltip) only for conceptual context (what the field represents, why it matters).
| In forms, `FormGroup` already exposes a `labelHelpTooltip` prop that renders an `IconHelp` next to the field label — you don't need to add one manually. Use it to clarify: | ||
|
|
||
| - **What the field represents** — e.g. _"The name other users will see on your profile."_ | ||
| - **The accepted format or validation rule** — e.g. _"Must be 3–32 characters, letters and digits only."_ |
There was a problem hiding this comment.
Remove this bullet. Format and validation rules ("Must be 3–32 characters, letters and digits only") are needed to complete the task, so they belong in always-visible helper text, not a tooltip. This contradicts the rule two bullets above: "don't use IconHelp as the only way to convey critical information".
There was a problem hiding this comment.
Even if we are not super strict in the UI, it should be strict in the design system.
| name: 'Simple', | ||
| render: () => ( | ||
| <Text> | ||
| Replication policy{' '} |
There was a problem hiding this comment.
The {' '} before <IconHelp> is the correct spacing convention — but it is not documented anywhere. Add a note in the guideline: one space between the adjacent text and the icon, managed by the parent, not built into the component.
There was a problem hiding this comment.
This is debatable, I don't know if it's a spacing component or if it's managed with a space.
- Rewrite intro as one descriptive sentence; move usage line into
"When to use it" (Toggle/Checkbox/Radio convention).
- Spell out concrete alternatives to stacked IconHelps (description
paragraph or InfoMessage, never long text in a tooltip).
- Clarify that IconHelp can sit on either the key or the value side
of a key/value pair; add Object lock + RPO key-side examples.
- Open "In a form" with the helper-text vs IconHelp decision rule
(helper text via FormGroup.help for task-completion info, IconHelp
only for conceptual context). Drop the validation-rule bullet.
- Replace literal {' '} spacing with Stack horizontal/gap r4 in all
stories to match the codebase convention (see ChartHeader and
FormSection title usages).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
Summary
IconHelpsize and vertical-alignment drift introduced when the icon was reworked into a focusable<button>(was inheriting parent font, line-height and usingvertical-align: text-bottom, making the glyph float and rescale per consumer).1rem × 1remhit area centered withinline-flex, so the icon stays the same recognizable "info" affordance everywhere and sits center inside the focus outline. Use FontAwesome's-0.125embaseline offset for stable inline alignment with surrounding text.Components/IconHelp(Simple,Tooltip placement,Explaining values) and aGuidelinemdx attached to the same group (same pattern asInfoMessage).Test plan
Components/IconHelp→ checkSimple,Tooltip placement,Explaining valuesrender correctly.Guidelinetab on the same component renders the embedded canvases.Templates/Form,Components/TextBadge, modal stories) still show the help icon aligned with adjacent text and not oversized in headings.Tab— focus outline wraps the icon tightly with the icon centered.🤖 Generated with Claude Code