Repository navigation
fix: show a disabled option's reason when its row is hovered - #123
Conversation
The reason opened only with the pointer on the small glyph at the end of the row. The row itself never blocked hover, as the glyph's pointer-events rule assumed: Astryx 0.7.3 sets no pointer-events on a disabled row. The tooltip now hangs on the row, found from the glyph because the selectors own that element, and sits beside it so it covers no other option. The glyph stays as the visible mark and keeps the reason as its accessible name.
PR Analysis Report📚 Storybook PreviewGitHub Pages may take up to a minute to hydrate after the deploy. 🧩 Changed Components
6 other changed file(s) in
|
| Group | Gzip | Δ Gzip vs base |
|---|---|---|
assets |
15.7 kB | −0.1 kB |
formControls |
15.3 kB | +0.0 kB |
components/PagedSelector |
4.9 kB | +0.0 kB |
Total gzip (JS + CSS): 201.3 kB (−0.1 kB vs origin/main)
Generated by the PR Preview workflow for 007677a · Storybook · CI run
|
Preview published under the pnpm add @lablup/ui-common@0.2.0-alpha.20.pr-123-20261030092531-007677ae1
pnpm add -D @lablup/ui-common-cli@0.2.0-alpha.20.pr-123-20261030092531-007677ae1In backend.ai-webui: |
Agent review — round 1 at
|
| # | Tag | File:line | Finding | Verdict | Bucket | Outcome |
|---|---|---|---|---|---|---|
| O1 | Nit | src/formControls/optionDisabledReason.tsx:50 |
With touchTrigger="tap" on the row, a swipe that starts on a row with a reason also opens the tooltip. Astryx's useTouchTrigger shows it on pointerdown and does not handle pointercancel, so it stays open after the scroll until the next tap. |
PLAUSIBLE (read from source, not run on a device) | C | not-worth |
O1 is not a blocker: the cost is a stray tooltip that one tap closes, and the PR deliberately keeps tap access to the reason. The whole row is a much larger target than the old glyph, so please include a swipe in the touch check the PR already asks for by hand.
What was checked
- The row lookup and the tooltip attachment.
rowRefis set beforeTooltip's layout effect runs, because the glyph comes first in the tree, and re-renders leave it attached. A tooltip inside its own anchor is a pattern Astryx already supports. pointer-events: none is set on a disabled row inSelector,MultiSelector,PagedSelectoror ui-common's stylesheets, so removing the old rule is safe.touchTrigger="tap": Astryx'sisActionTriggerlistsoption, as the comment says. Therole="row"case would have opened on a tap anyway.- The structure and class changes around
.uic-option-disabled-reason: nothing in backend.ai-webui selects on that class or on.uic-icon-with-tooltip. - Docs, stories, the changelog and
gen-wrapper-docs.mjsmatch the new behaviour. - Targeted tests:
optionDisabledReason.test.tsxandPagedSelector.test.tsx, 71 passed.
Not covered
- No fixes landed after this review, so there is nothing unreviewed at the head.
- No browser or device check in this review. The
role="row"lookup (MultiSelectoronce an option has an action) has no test; it was checked by reading Astryx's row markup only. - The by-hand checks listed in the PR's test plan are still open: row padding and check mark area, touch and bottom sheet, narrow viewports.
The row hover now carries the reason, so the glyph at the row's end is gone in Selector, MultiSelector and PagedSelector, with the wrappers that only placed it. The reason stays in the option's accessible name as visually hidden text.
The reason's tooltip takes Astryx's default placement, above the row, instead of the end. It no longer shrinks into the width left beside the panel.
Resolves #122
Summary
Selector,MultiSelectorandPagedSelector, which shareOptionDisabledReason.VisuallyHiddentext.renderOptiononly reaches its content, so the row is found from the hidden text withclosest(). That way the listener also covers the row padding and the check mark area, which a wrapper insiderenderOptionwould miss.touchTrigger="tap"is set because Astryx treatsrole="option"as an action and would otherwise keep the tooltip shut on a tap.pointer-events: autorule and its comment: Astryx 0.7.3 sets nopointer-eventson a disabled row. Confirmed in Chromium, see the test plan.Why
In backend.ai-webui, a user who hovers a disabled select option sees no explanation unless they find the small glyph at the end of the row. backend.ai-webui picks this change up with the next
@lablup/ui-commonrelease.Test plan
src/formControls/optionDisabledReason.test.tsx(Selector,MultiSelector) andsrc/components/PagedSelector/PagedSelector.test.tsx: hovering the row opens the tooltip, and in the former leaving the row closes it. The reason is in the row as hidden text, no glyph is drawn, and a baredisabled: truerow has no tooltip.Form Controls/SelectorandForm Controls/MultiSelector→DisabledOptionReason, andComponents/PagedSelector→Default(Item 017).Selectorstory only: hovering the row opens the tooltip above it, on one readable line at 1280px and at a 300px viewport, and the row reads asoption "South No agent in this region has a GPU."in the accessibility tree.MultiSelectorandPagedSelectorwere checked in a browser earlier, with the glyph and the tooltip beside the panel; with the final code they are covered by the tests.Not checked in a browser; please try these by hand:
astryx/components/Selector.doc.mjsandMultiSelector.doc.mjswere edited to match the new note inscripts/gen-wrapper-docs.mjsrather than regenerated, because the script could not be run in this environment. The staleness test insrc/astryxIntegration.test.tspasses.Verification
Output of
pnpm run verify(last lines):