Repository navigation
fix(FieldLabel): labelTooltip is an InfoTip button after the label, reachable by keyboard and screen readers - #6414
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This change makes labelTooltip part of the computed name of controls and groups named by FieldLabel. The low-level Icon behavior is consistent and the focused unit tests pass, but the current Field/input specifications do not decide whether tooltip explanation belongs in the control name rather than its accessible description.
Approval therefore needs a maintainer to provide or identify the governing spec for that naming behavior. If the intended outcome is that screen readers announce the tooltip after the label, the change also needs the named real-AT/browser matrix and durable receipt or release-block record required by the accessibility verification spec; the current unit assertion establishes computed naming, not spoken output.
[Automated review]
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| FieldLabel | 🔴 46.8 kB (+3.9 kB) · 5.6 kB CSS (+386 B) | — | ✗ · ✓ · — |
| Field | 🔴 50.2 kB (+3.4 kB) · 7.2 kB CSS (+436 B) | — | ✗ · ✓ · — |
| Typeahead | 🔴 74.1 kB (+4.2 kB) · 12.1 kB CSS (+313 B) | — | — · — · — |
44 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| CheckboxList | 🔴 54.0 kB (+4.0 kB) · 7.9 kB CSS (+403 B) | — | — · — · — |
| Tokenizer | 🔴 84.3 kB (+4.1 kB) · 18.1 kB CSS (+309 B) | — | — · — · — |
| Slider | 🔴 100.8 kB (+3.9 kB) · 8.7 kB CSS (+369 B) | — | — · — · — |
| Pagination | 🔴 102.6 kB (+3.9 kB) · 17.2 kB CSS (+309 B) | — | — · — · — |
| lab/TransferList | 🔴 89.5 kB (+4.2 kB) · 1.7 kB CSS (0) | — | — · — · — |
| TextArea | 🔴 57.6 kB (+3.8 kB) · 9.2 kB CSS (+351 B) | — | — · — · — |
| TimeInput | 🔴 147.6 kB (+3.8 kB) · 15.5 kB CSS (+336 B) | — | — · — · — |
| DateInput | 🔴 170.7 kB (+3.8 kB) · 16.4 kB CSS (+314 B) | — | — · — · — |
| DateRangeInput | 🔴 85.1 kB (+3.8 kB) · 12.1 kB CSS (+312 B) | — | — · — · — |
| lab/ChatReactionBar | 🔴 79.2 kB (+4.1 kB) · 1.1 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 🔴 119.4 kB (+4.1 kB) · 1.9 kB CSS (0) | — | — · — · — |
| Selector | 🔴 92.5 kB (+3.8 kB) · 16.8 kB CSS (+313 B) | — | — · — · — |
| lab/TransferListSelector | 🔴 96.5 kB (+4.1 kB) · 1.9 kB CSS (0) | — | — · — · — |
| DateTimeInput | 🔴 193.3 kB (+3.8 kB) · 18.1 kB CSS (+314 B) | — | — · — · — |
| NumberInput | 🔴 66.5 kB (+3.7 kB) · 11.1 kB CSS (+317 B) | — | — · — · — |
| PowerSearch | 🔴 267.7 kB (+4.0 kB) · 23.0 kB CSS (+82 B) | — | — · — · — |
| lab/ListInput | 🔴 94.9 kB (+4.0 kB) · 1.6 kB CSS (0) | — | — · — · — |
| FileInput | 🔴 63.9 kB (+3.7 kB) · 10.6 kB CSS (+320 B) | — | — · — · — |
| richtext/RichTextEditorToolbar | 🔴 243.3 kB (+3.8 kB) · 454 B CSS (0) | — | — · — · — |
| RadioList | 🔴 51.5 kB (+3.3 kB) · 7.2 kB CSS (+439 B) | — | — · — · — |
| InputGroup | 🔴 51.8 kB (+3.3 kB) · 7.8 kB CSS (+422 B) | — | ✓ · ✓ · ✓ |
| lab/ChatEmojiPicker | 🔴 78.1 kB (+3.5 kB) · 773 B CSS (0) | — | — · — · — |
| TextInput | 🔴 62.4 kB (+3.1 kB) · 10.8 kB CSS (+322 B) | — | — · — · — |
| ComplexSelector | 🔴 65.5 kB (+3.1 kB) · 11.3 kB CSS (+323 B) | — | — · — · — |
| lab/EmojiPicker | 🔴 80.9 kB (+3.4 kB) · 751 B CSS (0) | — | — · — · — |
| lab/SelectableCardGroup | 🔴 59.4 kB (+3.3 kB) · 162 B CSS (0) | — | — · — · — |
| Switch | 95.7 kB (+1.1 kB) · 9.8 kB CSS (+311 B) | — | — · — · — |
| lab/Comments | 282.1 kB (+597 B) · 2.5 kB CSS (0) | — | — · — · — |
| Markdown | 161.6 kB (+282 B) · 19.5 kB CSS (+88 B) | — | — · — · — |
| lab/CommentThread | 276.1 kB (+319 B) · 2.4 kB CSS (0) | — | — · — · — |
| MultiSelector | 88.2 kB (+64 B) · 16.3 kB CSS (+91 B) | — | — · — · — |
| DropdownMenu | 85.6 kB (−59 B) · 16.7 kB CSS (+79 B) | — | — · — · — |
| MoreMenu | 85.9 kB (−60 B) · 16.7 kB CSS (+79 B) | — | — · — · — |
| InputGroupText | 6.6 kB (0) · 3.9 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TableHeaderCell | 90.8 kB (−109 B) · 16.8 kB CSS (+85 B) | — | — · — · — |
| Table | 99.4 kB (−103 B) · 17.3 kB CSS (+77 B) | — | — · — · — |
| ContextMenu | 90.0 kB (−120 B) · 16.6 kB CSS (+81 B) | — | — · — · — |
| TableCell | 91.2 kB (−125 B) · 17.0 kB CSS (+70 B) | — | — · — · — |
| richtext/RichTextEditor | 290.5 kB (−63 B) · 2.6 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 270.7 kB (−183 B) · 2.3 kB CSS (0) | — | — · — · — |
| CheckboxInput | 59.5 kB (−407 B) · 9.1 kB CSS (+88 B) | — | — · — · — |
| RadioListItem | 62.4 kB (−514 B) · 9.8 kB CSS (+116 B) | — | — · — · — |
| ListItem | 64.6 kB (−563 B) · 10.9 kB CSS (+80 B) | — | — · — · — |
| CheckboxListItem | 65.5 kB (−575 B) · 10.9 kB CSS (+80 B) | — | — · — · — |
Visual changes: 2 snapshots in 1 component
A change is a question for the reviewer, not a failure.
| Component · story | Before | After | Diff |
|---|---|---|---|
| Field · Default (neutral, light) | ![]() |
![]() |
![]() |
| Field · Default (neutral, dark) | ![]() |
![]() |
![]() |
Package size: @astryxdesign/core 6.68 MB packed (+206 B); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 19 rows, core 21 rows; run pnpm api:report.
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
…t activating the control (#9089) ## User need On a touch screen, a tap on a field label's info icon (`labelTooltip`) opens its help and also activates the label's control, because the icon sits inside the `<label>`. In Chromium with touch, a tap on the info icon of the "Nickname" label opens the help and focuses the field, which on a phone raises the keyboard. Beside a Switch, the tap that opens "Automatically save your changes as you work" also turns auto-save on. Asking what a setting does should not change it. ## Problem and solution fit - **Why it occurs:** a tap anywhere inside a native `<label>`, the icon included, activates the label's control. - **Why it harms the task:** the help and the activation arrive together, so reading about a setting changes it, or moves focus to a field the person did not choose. - **Why that matters:** the person has to undo a change they never asked for, and may not notice it. The icon's tooltip opens or closes on a tap (`touchTrigger="tap"`), and a tap by finger or pen stops at the help: its click does not go on to the label. A mouse click on the icon keeps native label activation, and hover still shows the help. ## Current specification This is a caller-compatible behavior change that FieldLabel's DEC-1 decides, a patch `[feat]` under `spec:AST-017` FR7: a tap on the info icon opens the help without also toggling or focusing the control, the unintended second action FR9 removes. `component:FieldLabel` lets people "activate eligible controls from the complete visible label area"; this pull request amends that record with FR9 and DEC-1, which give a tap on the info icon to the help, and with the matching end-user impact, tooltip concept, compatibility and verification rows. The amendment needs the record owner's approval. ## Public delta and caller burden - On touch, a tap on the info icon opens the help without focusing the field or toggling the control. Mouse, hover and keyboard behavior are unchanged. - No prop, type, default, export or DOM change: callers decide nothing new. - The changeset is a patch `[feat]` under `spec:AST-017` FR7; it names the old and new tap. - The `labelTooltip` docs of FieldLabel (English and Chinese) and Field describe hover and tap. ## Design and alternatives - The tap's label activation is cancelled only for a finger or a pen, the pointers whose tap opens the help. A mouse click keeps native activation, as FieldLabel's record requires. - Rejected: cancelling every click on the icon, which stops a mouse click from focusing the field or toggling a Switch. - Rejected: leaving the tap to the label, which activates the control as it opens the help. - #8207 makes `touchTrigger="auto"` leave a tap inside a control to that control, a `<label>` included. With `touchTrigger="tap"`, the icon keeps its help on a tap under that rule, so this pull request lands first. - #6414 gives the same icon an accessible name (FR8). Both edit the same `<Icon>` element, so whichever lands second keeps both props. - FieldLabel takes the tap pointers from `useTouchTrigger` (`TOUCH_POINTER_TYPES`) and keeps the cancel under its own FR9. A Tooltip-level rule for every `touchTrigger="tap"` trigger inside a label belongs to the pending decision on which triggers open on a tap. - Prior art: open pull requests searched for `FieldLabel`, `labelTooltip`, `label info icon` and `label activation`; only #6414 and #8207 touch this icon. ## Evidence - Chromium, `Core/FieldLabel` States story, the Nickname field. With touch, on main a tap on the info icon opens the help and focuses the field; with this change it opens the help, and focus stays off the field. With a mouse, on both, hover shows the help and a click focuses the field. `FieldLabelTap.a11y.chromium.spec.ts` checks the tap and the click. - Unit tests: a finger tap and a pen tap on the icon open the help and leave a checkbox unchecked, and a mouse click on the icon toggles the checkbox. With main's `FieldLabel.tsx`, the finger-tap and pen-tap cases fail; with every click on the icon cancelled, the mouse case fails. - iOS simulator, main above and this pull request below: the tap opens the help, and on main it also turns the switch on.  ## Scope - [x] One capability is added. - [x] Unrelated fixes, cleanup, and policy changes were removed or split. - [x] Consumer docs, focused tests, and migration evidence ship with the feature. - [x] Public text and artifacts contain no internal Meta context. ## Writing rubric results `FieldLabel.spec.md`: - R1 narration: none; FR9 and DEC-1 state what the label does. - R2 research in the record: none. - R3 evidence naming a change: none; FR9's verification names its test cases. - R4 rejected alternatives over one line or outside a decision: one, inside DEC-1, one line. - R5 pull request or issue references remaining: none. - R6 ruled open questions still listing options: none; OQ1 is unanswered and unchanged. ## Testing Local gates at 0a6a60f (on main 560c666): - `pnpm check:repo`, `pnpm check:knowledge`, `pnpm typecheck` (0 errors), Prettier and ESLint on the touched files, the root build and the Storybook build pass. - `pnpm test:ui`: 16,474 tests pass. `pnpm test:node`: 14,585 pass; its 4 failures, in `story-tree.test.ts` and the release `cache.test.mjs`, are independent of this change (#8509, #8520). - `FieldLabelTap.a11y.chromium.spec.ts`: 2 of 2 in Chromium, twice; 24 of 24 with Chromium pinned to two cores at 4 workers, and 40 of 40 pinned to three cores at 16 workers. With main's `FieldLabel.tsx` its touch case fails, because the tap focuses the field. - `FieldLabelAudit.a11y.chromium.spec.ts`: 9 of 9 in Chromium, twice.
# Conflicts: # packages/core/src/Field/FieldLabel.tsx
…el (FR9)
The help trigger was an anonymous, unfocusable icon inside the <label>:
pointer-only, and a mouse click on it also focused or toggled the field.
Per component:FieldLabel FR9 and DEC-1, FieldLabel now renders an InfoTip
after the label element, in one inline-flex row with it, named by the
new localized string 'About {label}'. A tap, click, Enter or Space opens
its help and never reaches the control. With isLabelHidden the row takes
no slot and the button shows while it has keyboard focus. The record's
FR8 and FR9 gaps and their Current-state bullets are removed; the unit
tests and the two Chromium specs assert the built behavior.
This adopts the intent of the contributor's change, which named the
info icon so screen readers could reach the help.
Co-authored-by: GuillaumeMMM <[email protected]>
There was a problem hiding this comment.
Thanks for taking this on: moving the help into a named InfoTip button after the label closes the keyboard and screen-reader gap from #6413, and the new tests show it. With the engineering owner's spec approval on this head, the desktop click change no longer needs a separate decision. Two things still need changing before this can merge:
- A hidden label's info button is covered by the input when it takes keyboard focus: in a hidden-label TextInput, Shift+Tab focuses "About Search", but the button paints under the input box and only a sliver of its focus ring shows (
infoTipHiddeninFieldLabel.tsx), so raise the focused button above the control or move it clear of it, and add a browser check for it. FieldLabel.spec.mdstill says the anchor is "nonfocusable, unnamed, and inside the label" (the icon-and-tooltip state row),Field.spec.mdstill says alabelTooltipis "reachable only by pointer", and the FR9 verification row lists Space, Switch-label and hidden-label checks that no test runs, so remove the stale text and add those tests or keep them as evidence gaps.
Two small comment-wording suggestions are left inline and do not block.
[Automated review]
| infoTipHidden: { | ||
| position: 'absolute', | ||
| clip: {default: 'rect(0, 0, 0, 0)', ':focus-visible': 'auto'}, | ||
| overflow: {default: 'hidden', ':focus-visible': 'visible'}, | ||
| whiteSpace: 'nowrap', | ||
| }, |
There was a problem hiding this comment.
When the label is hidden, this button is absolutely positioned at the field's top-left with no stacking order, and the input wrapper has z-index: 1. After Shift+Tab the focused button paints under the input box: in Chromium every sampled point inside it hits the input, and only an arc of the focus ring shows. FR9 asks for it to be visible while it has keyboard focus. Raising it while focused (for example zIndex under :focus-visible here) or placing it clear of the control would fix it, and a browser check that the focused button is the top element at its centre would keep it fixed.
| const labelWithHelp = labelTooltip ? ( | ||
| <span | ||
| {...stylex.props( | ||
| styles.labelRow, | ||
| isLabelHidden && styles.labelRowHidden, | ||
| )}> | ||
| {labelElement} | ||
| <InfoTip | ||
| content={labelTooltip} | ||
| label={t('@astryx.field.labelTooltip', {label})} | ||
| xstyle={isLabelHidden ? styles.infoTipHidden : undefined} | ||
| /> | ||
| </span> |
There was a problem hiding this comment.
Desktop behavior change needs an owner decision: with this row, a mouse click on the info icon opens the help instead of focusing the field or toggling the Switch, and the label's click target shrinks to its text, so a click to the right of the label no longer focuses the field. Either gate the desktop part to touch input, or cite the owner decision that covers it.
| | FR6, ORD2 | `FieldLabel.test.tsx` ref, layout-item, and label-target cases; `themingTargets.test.ts` | Ref; composed target; with a description wrapper | A dropped ref or a lost `field-label` target fails; a rendered class absent from the documented targets fails. Evidence gap: no test asserts caller class, style, `xstyle`, data, and event props on the inner label element with a description wrapper or with the `labelTooltip` row. | `audit:FieldLabel/api` | | ||
| | FR7 | Evidence gap: no type test pins the public ref and props against the rendered group span | — | — | `audit:FieldLabel/api` | | ||
| | FR8, AR5 | `FieldLabelAudit.a11y.chromium.spec.ts` tooltip-anchor count | Tooltip present | The audit asserts one named, focusable InfoTip button after the label element and outside it; an anonymous, unfocusable, or label-nested trigger fails. | `audit:FieldLabel/accessibility` | | ||
| | FR9 | `FieldLabel.test.tsx` info-button placement and name, hidden-label, finger-tap, pen-tap, and mouse-click checkbox cases; `FieldLabelTap.a11y.chromium.spec.ts` touch-tap, mouse-click, and Enter text-field cases | Checkbox, text field, and Switch labels; finger, pen, mouse, Enter, and Space; `isLabelHidden` with keyboard focus on the InfoTip | A tap, click, or key press on the info trigger that activates, focuses, or toggles the control, an info button inside the label element, a trigger without the label in its name, or a hidden label's InfoTip that takes layout space or stays invisible while focused fails. | `audit:FieldLabel/accessibility` | |
There was a problem hiding this comment.
This row now lists Space, Switch labels and the hidden-label focus case as verified, but no test presses Space, renders a Switch label, or checks the hidden button's visibility or layout slot (the hidden-label unit test only asserts tabIndex 0). Add those tests, or keep Evidence gap: text for them. The icon-and-tooltip state row at line 122 also still says the anchor is nonfocusable, unnamed and inside the label.
| // The label and the info button after it share one row. The button sits | ||
| // outside the label, because a button inside a label would also activate | ||
| // the label's control. |
There was a problem hiding this comment.
Non-blocking: the first sentence restates the style below. Keeping only the reason reads better: "A button inside a label also activates the label's control, so the button sits outside it."
| // A hidden label's info button takes no layout slot, and it shows while it | ||
| // has keyboard focus, so a keyboard user can see where focus is. |
There was a problem hiding this comment.
Non-blocking: this is one 26-word sentence with two topics. Suggest: "A hidden label's info button takes no layout slot. It shows while it has keyboard focus, so the person sees where focus is."
|
/approve-spec a52a101 |
…e the control instead of stacking over it Per review: a z-index on the focused button escaped any owner that does not isolate (a horizontal-labels FormLayout, a bare FieldLabel). The button now moves up by its own height while it has keyboard focus, so the control never covers it and it takes no stacking order (AST-027 FR6). The CheckboxInput and Switch isolation is dropped. A new HiddenLabelInfo story puts hidden-label TextInputs in a stacked Field and a horizontal-labels FormLayout, and the Chromium check runs there. Co-authored-by: GuillaumeMMM <[email protected]>
…rst field Co-authored-by: GuillaumeMMM <[email protected]>
|
/approve-spec 8fa8195 |
… in flow, so a scroll container never clips it Per the FR9 ruling: moving the focused button above the control could put it past the top edge of a scroll container, such as a dialog body whose first field has a hidden label. While it has keyboard focus the button is now in flow above the control (or in the label cell with horizontal labels), so nothing covers or clips it; the field shifts by one row only while it has focus. A HiddenLabelInfoInDialog story and its Chromium check cover the dialog-body case. Co-authored-by: GuillaumeMMM <[email protected]>
There was a problem hiding this comment.
Thanks for this: the named InfoTip button after the label closes the keyboard and screen-reader gap from #6413, the desktop click change now has an engineering owner's approval for this head, and the stacking leak and the insensitive browser check from the last round are fixed. One thing still needs changing before this can merge:
- A hidden label's focused info button is moved above the field (
FieldLabel.tsx:94-100), so at the top of a positioned clipping container it is cut off (fully hidden in a flush sticky toolbar withoverflow: hidden, and the top of its focus ring clipped at the top of a default Dialog), which breaks FieldLabel FR9's "visible while it has keyboard focus"; keep the focused button inside the field's own box, reword FR9's "just above the control" with an owner's approval, and run the top-element check at the top of a Dialog and a flush toolbar.
A small comment-wording suggestion is inline, and CI is still running on this head.
[Automated review]
| infoTipHidden: { | ||
| position: 'absolute', | ||
| transform: {default: null, ':focus-visible': 'translateY(-100%)'}, | ||
| clip: {default: 'rect(0, 0, 0, 0)', ':focus-visible': 'auto'}, | ||
| overflow: {default: 'hidden', ':focus-visible': 'visible'}, | ||
| whiteSpace: 'nowrap', |
There was a problem hiding this comment.
Moving the focused button up by its own height puts it outside the field's box, so a positioned clipping ancestor cuts it off. After Shift+Tab into a hidden-label search field at the top of a sticky toolbar with overflow: hidden and no vertical padding, none of the button shows and its help does not open; with 8 px of padding about half shows; at the top of a default Dialog the top of the focus ring is clipped. With less than 20 px above the field it also paints over the field above. That misses FR9's "becomes visible ... while it has keyboard focus". Keeping the focused button inside the field's own box (for example over the control's inline-start top corner, ordered inside Field's isolation boundary, with the horizontal-labels label cell isolated too) would fix it; FR9's "just above the control" would need rewording with an owner's approval, and a top-element check at the top of a Dialog and a flush toolbar would keep it fixed.
| // A hidden label's info button takes no layout slot. While it has keyboard | ||
| // focus it shows just above the control, so the control never covers it and | ||
| // it needs no stacking order of its own. |
There was a problem hiding this comment.
Non-blocking: the second sentence is 26 words with two topics. Suggest: "A hidden label's info button takes no layout slot. While it has keyboard focus, it shows above the control. The control cannot cover it, so it needs no z-index."
|
/approve-spec b73c48b |
There was a problem hiding this comment.
The info button makes a field's help reachable by keyboard and screen readers, and a click on it no longer focuses or toggles the field. Two changes are needed before this can merge:
- Under a coarse pointer (for example a tablet with a keyboard), a hidden label's focused info button becomes
position: static(FieldLabel.tsx:95), so InfoTip's invisible touch band rings the nearest positioned ancestor: a tap just outside a positioned card pins the help, and the page gains 12 px of scroll;':focus-visible': 'relative'keeps the same placement and fixes it. - Miss:
Field.spec.mdlines 172-174 and 181 still map the label tooltip trigger toIcon/icon; on this head the trigger is InfoTip's button, so Field's theming anatomy should delegate it to InfoTip.
The earlier hidden-label placement problems (clipping at the top of a dialog or toolbar, and the stacking leak) are fixed. CI is still running on this head.
[Automated review]
| // focus it takes its place in flow above the control, so nothing covers or | ||
| // clips it, at the top of a scroll container too. | ||
| infoTipHidden: { | ||
| position: {default: 'absolute', ':focus-visible': 'static'}, |
There was a problem hiding this comment.
While the button has keyboard focus this makes it position: static, but InfoTip's touch band is the button's own ::after (touchHitAreaStyles.layer), which needs a positioned host. Under a coarse pointer the band then rings the nearest positioned ancestor instead: after Shift+Tab onto a hidden-label TextInput inside a position: relative card, a tap 6 px outside the card pins the help, and in the plain stacked story the page gains 12 px of horizontal and vertical scroll. ':focus-visible': 'relative' keeps the button in the same place in flow and restores the band; a coarse-pointer case in FieldLabelTap.a11y.chromium.spec.ts would keep it fixed.
| // A hidden label's info button takes no layout slot. While it has keyboard | ||
| // focus it takes its place in flow above the control, so nothing covers or | ||
| // clips it, at the top of a scroll container too. |
There was a problem hiding this comment.
Non-blocking (comment style): the second sentence is 28 words with two topics. Suggest: "A hidden label's info button takes no layout slot. While it has keyboard focus, it moves into flow above the control. There the control cannot cover it."
…d; Field's anatomy maps the trigger to InfoTip Per review: position: static left InfoTip's touch band (the button's own ::after) to ring the nearest positioned ancestor under a coarse pointer, which added page scroll and a stray hit area. position: relative keeps the same in-flow placement and keeps the band on the button; a touch Chromium case checks no page scroll is added. Field's theming anatomy records the label tooltip trigger as InfoTip's button, which has no public target yet. Co-authored-by: GuillaumeMMM <[email protected]>
|
/approve-spec 4c1e664 |
There was a problem hiding this comment.
The info button makes a field's help reachable by keyboard and screen readers, and a click on it no longer focuses or toggles the field; the earlier touch-band and Field anatomy issues are fixed. Three changes are needed before this can merge:
- Found by CI:
FieldLabel.stories.tsxlines 41, 48 and 70 renderTextInputwithout its requiredvalue, andFieldLabel.test.tsx:280rendersSwitchwithoutvalue, sotypecheckandbuildfail, and that Switch case passes even when the click reaches the switch (rendering<Switch value={false} onChange={onChange} />and assertingonChangeis not called fixes both). - Found by CI:
InputGroup.test.tsx:506still looks for the tooltip icon inside the group label, sotest-uifails; the case should find theAbout Pricebutton after the label instead. - Miss: in a
horizontal-labelsFormLayout, a label withlabelTooltipsits 4 px below its input's text, because theinline-flexrow (FieldLabel.tsx:82-86) lands on a line box in Field's block label cell, andverticalAlign: 'top'onlabelRowrestores the alignment.
[Automated review]
| labelRow: { | ||
| display: 'inline-flex', |
There was a problem hiding this comment.
In a horizontal-labels FormLayout, Field puts the label in a block div (Field.tsx:309), so this inline-flex row sits on a line box and the label drops 4 px below the input text it is padded to line up with (the API key label's top moves from 81 to 85 px while a label without a tooltip stays put). Adding verticalAlign: 'top' here puts it back at 81 px and leaves the stacked Field unchanged.
| render: () => ( | ||
| <VStack gap={6}> | ||
| <Text type="body">Directory</Text> | ||
| <TextInput |
There was a problem hiding this comment.
TextInput requires value, so this and the TextInputs at lines 48 and 70 fail typecheck (TS2741), which fails the typecheck and build checks. A small stateful wrapper or value="" onChange={() => {}} fixes them.
|
|
||
| it('leaves a Switch alone when its label’s info button is clicked', async () => { | ||
| const user = userEvent.setup(); | ||
| render(<Switch label="Auto-save" labelTooltip="Saves each change" />); |
There was a problem hiding this comment.
Switch requires value, so this line fails typecheck. Without value the switch can never turn on, so this case also passes when the click reaches the switch (a click on the label text leaves it unchecked too). render(<Switch label="Auto-save" labelTooltip="Saves each change" value={false} onChange={onChange} />) with expect(onChange).not.toHaveBeenCalled() type-checks and fails if the click activates the switch.
…l cell; stories and tests type-check Per review: - In a horizontal-labels FormLayout the inline-flex label row sat on a text line box, 4 px below the input text; vertical-align: top keeps it on the cell's top. - The HiddenLabelInfo stories pass TextInput's required value. - The Switch-label case passes a value and asserts onChange is not called, so it fails if the click reaches the switch. - InputGroup's labelTooltip case finds the info button after the label. Co-authored-by: GuillaumeMMM <[email protected]>
|
/approve-spec faef9dd |
There was a problem hiding this comment.
Approved: CI passes on this head.
The info button after the label makes a field's labelTooltip help reachable by keyboard and screen readers, and a click, tap, Enter or Space on it opens the help without focusing or toggling the field, as component:FieldLabel FR9 and DEC-1 require. The earlier type errors in the new stories and the Switch test, the stale InputGroup test and the 4 px label drop in horizontal-labels forms are fixed.
Non-blocking:
- At the top of a dialog's scrolling body, a hidden label's focused info button shows only the side arcs of its focus ring; room above the first field would keep the whole ring.
- On a disabled field the info button stays operable with its enabled icon colour; the record does not say which is intended.
- The comment above
if (!description)inFieldLabel.tsxstill says the label is the caller's flex or grid item; withlabelTooltipthe row is.
[Automated review]
There was a problem hiding this comment.
Approval waits on one engineering-owner decision. The only change since the earlier approval is a merge of main, so the desktop behavior change needs the spec owners' ruling again for this head.
- A mouse click on a field's
labelTooltipinfo button now opens the help instead of focusing the field or toggling the checkbox or switch, and a click to the right of the label text no longer reaches the control (the new label row inFieldLabel.tsx). An engineering owner records the decision by commenting/approve-spec <full head SHA>on this pull request, and the author may do so if they are an engineering owner; otherwise, limit the click change to touch and pen input.
Everything else holds on this head: the info button is named, keyboard-reachable and described by the help, the new tests fail without the change, and the earlier non-blocking notes still apply. CI has not run on this head yet: its workflow runs are waiting for a maintainer's approval.
[Automated review]
|
/approve-spec fd13219 |
There was a problem hiding this comment.
Approved pending CI: CI is still running on this head.
The info button after the label makes a field's help reachable by keyboard and screen readers, a click on it no longer focuses or toggles the field, the new tests fail without the change, and the desktop click change carries an engineering owner's /approve-spec for this head. There are no blocking findings.
- Miss, non-blocking: a hidden label's focused info button loses the bottom of its focus ring under the input box, and the top too at the top of a dialog's scrolling body; a block margin while it has keyboard focus would keep the whole ring.
[Automated review]
| infoTipHidden: { | ||
| position: {default: 'absolute', ':focus-visible': 'relative'}, | ||
| alignSelf: 'flex-start', | ||
| clip: {default: 'rect(0, 0, 0, 0)', ':focus-visible': 'auto'}, | ||
| overflow: {default: 'hidden', ':focus-visible': 'visible'}, | ||
| whiteSpace: 'nowrap', | ||
| }, |
There was a problem hiding this comment.
Non-blocking: while focused, this button's box ends exactly where the input box starts, and the input box (position: relative, z-index: 1, white fill) paints over the bottom 5 px of the focus ring, which is drawn 3 px outside the button. At the top of a dialog's scrolling body the top of the ring is cut as well, so only its side arcs show. A block margin under :focus-visible equal to the ring's reach (offset plus width) would keep the whole ring visible.






User impact
Keyboard and screen-reader users could not reach a field's
labelTooltiphelp: the trigger was an anonymous, unfocusable info icon inside the<label>. Mouse users who clicked the icon to read the help also focused the field or toggled the checkbox or switch. Now the help sits behind a real info button after the label, named "About {label}" (for example "About Auto-save"). A tap, click, Enter or Space opens the help and never focuses or toggles the control.Problem and solution fit
<label>, so a mouse click on it also activated the label's control.component:FieldLabelFR9 and DEC-1: FieldLabel renderscomponent:InfoTipwith the help after the label element and outside it, in one inline-flex row wrapping both. The button's name is a new localized string,@astryx.field.labelTooltip("About {label}"). WithisLabelHidden, the row takes no layout slot, and while the button has keyboard focus it takes its place in flow above the control (or in the label cell with horizontal labels), so it is never covered or clipped. The field shifts by one row only while the button has focus. Caller class,xstyleand ref stay on the label element. The row renders only whenlabelTooltipis set.Desktop behavior (DEC-1)
A mouse click on the info button now opens the help instead of focusing the field or toggling the control. That is
component:FieldLabelDEC-1, approved by the owner: "A tap, click, Enter, or Space on the label's info trigger opens or closes the help and never activates the label's control … for any pointer or key. Rejected: leaving the tap, or a mouse click, to the label." FR9 places the button after the label in an inline-flex row, so the label's click target is its own text, as FR9 records.Maintainer update
This adopts the intent of @GuillaumeMMM's change: name the info trigger so screen readers reach the help. The record has since settled the design (FR9, DEC-1): a separate InfoTip button rather than a named icon inside the label. A name on the icon alone would still leave it unfocusable, and a mouse click would still reach the control. The commit carries
Co-authored-by, and the changeset credits both authors.Current specification
component:FieldLabelFR8, FR9, AR5 and DEC-1. This pull request removes their implementation gaps and Current-state bullets, and points the verification rows at the new checks.Writing rubric results
pnpm check:knowledge: clean.Evidence
FieldLabel.test.tsxcases fail on main and pass here (7 cases):FieldLabelTap.a11y.chromium.spec.tsnow covers a touch tap, a mouse click and Enter on the button, none of which focus the field, and checks that a hidden label's focused button is the top element at its centre, on hidden-label TextInputs in a stacked Field, in a horizontal-labels FormLayout, and on the first field of a dialog's scrolling body, where it also stays inside the body (newHiddenLabelInfoandHiddenLabelInfoInDialogstories). Checked on a Vercel build of this head at 1280 and 390 px.FieldLabelAudit.a11y.chromium.spec.tsasserts one named, focusable button outside the label. Both run in CI on this head.check:knowledgeandcheck:changesetspass.Scope
Changeset:
[fix]patch for@astryxdesign/core.Fixes #6413