Repository navigation
feat(Selector): let an option say why it is disabled - #107
Merged
Merged
Conversation
`Selector` and `MultiSelector` option data take `disabled: boolean |
{ reason: string }`, and `PagedSelectorOption` takes the same union in
`isDisabled`. The object form disables the option and draws a glyph at the
end of its row whose tooltip, and accessible name, is the reason; the row
keeps its height. The wrappers hand Astryx a boolean and add the glyph after
the caller's `renderOption` or the default row.
Resolves #106
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR Analysis Report📚 Storybook PreviewGitHub Pages may take up to a minute to hydrate after the deploy. 🧩 Changed Components
9 other changed file(s) in
|
| Group | Gzip | Δ Gzip vs base |
|---|---|---|
assets |
15.4 kB | +0.3 kB |
formControls |
15.3 kB | +1.0 kB |
components/PagedSelector |
4.8 kB | +0.1 kB |
Total gzip (JS + CSS): 198.4 kB (+1.3 kB vs origin/main)
Generated by the PR Preview workflow for da89221 · Storybook · CI run
Contributor
|
Preview published under the pnpm add @lablup/ui-common@0.2.0-alpha.20.pr-107-20261027131406-da8922143
pnpm add -D @lablup/ui-common-cli@0.2.0-alpha.20.pr-107-20261027131406-da8922143In backend.ai-webui: |
agatha197
marked this pull request as draft
October 27, 2026 08:45
agatha197
added a commit
to lablup/backend.ai-webui
that referenced
this pull request
Oct 27, 2026
ui-common now takes `disabled: { reason }` on Selector / MultiSelector
options and `isDisabled: { reason }` on PagedSelector options, and draws the
row-end glyph itself (lablup/ui-common#107). BAISelect and BAIComplexSelect
pass the union through, the folder mount-permission picker and
ResourcePresetSelect set it on their options, and BUI's
BAIDisabledOptionReason is removed. Pinned to the ui-common#107 preview.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Consumer: lablup/backend.ai-webui#10496 (pinned to this PR's preview), with lablup/backend.ai-webui#10279 stacked on it. |
Contributor
Author
Ready-gate agent review (Opus) - blocking issues onlyNo blocking issues found at Copilot: unavailable (insufficient remaining quota) - this review gated the PR alone. |
agatha197
marked this pull request as ready for review
October 27, 2026 09:12
…edReason It takes options, renderOption and renderDefault and returns the options and renderOption Astryx gets, so Selector and MultiSelector each make one call instead of splitting the reasons and wrapping renderOption themselves.
agatha197
added a commit
to lablup/backend.ai-webui
that referenced
this pull request
Oct 27, 2026
…i-common#107 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agatha197
added a commit
to lablup/backend.ai-webui
that referenced
this pull request
Oct 30, 2026
Moves @lablup/ui-common and @lablup/ui-common-cli to 0.2.0-alpha.20.canary-20261029050354-1feb007cd, which carries lablup/ui-common#107 (needed by #10496). No codemods run between the two canaries; the AGENTS.md ui-common blocks are regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #106
Summary
Selector/MultiSelector(theForm.Itemwrappers): option data takedisabled: boolean | { reason: string }. The wrapper hands Astryx a boolean and, when any option carries a reason, wraps the row (the caller'srenderOption, else Astryx's default row) with a glyph at its end.SelectorOptionData,SelectorSection,SelectorOptionTypeand theMultiSelector*equivalents are widened and exported from the wrappers;renderOption/renderValuestill receive a booleandisabled.PagedSelector:PagedSelectorOption.isDisabledtakes the same union; the glyph goes before the row'sendContent.IconWithTooltip(not focusable, hover tooltip) with lucide'sCircleAlert; the reason is its tooltip and its accessible name. It setspointer-events: auto, since a disabled AstryxSelectoritem turns pointer events off. Shared internal piece:src/formControls/optionDisabledReason.tsx, not exported.truestill disables silently. A reason on an enabled option cannot be expressed.Disabled Option Reasonon Selector and MultiSelector; PagedSelector's sample list), CLI docs (PagedSelector.doc.mjs, wrapper docs regenerated),src/index.tsregenerated, CHANGELOG under[Unreleased]→Added.Why
backend.ai-webui disabled options in about ten pickers without saying why, and the few that did wrapped each row in a
Tooltipper call site (which a disabledSelectoritem never shows) with a paralleldisabledReasonfield. backend.ai-webui#10496 built the glyph BUI-side asBAIDisabledOptionReason; it is product-neutral, so it moves here and webui keeps only the mapping. The row-end glyph was chosen over a reason line under the label because many options often share one reason (folders without mount permission), and a line per row lengthens the list with the same sentence.Test plan
pnpm run verify(typecheck, lint, format, boundary, tests: 2170 passed),theme:check,build,check:pack,check:integrationall pass locally.src/formControls/optionDisabledReason.test.tsx(Selector and MultiSelector: the option isaria-disabled, the glyph is named by the reason, a baretruehas no glyph, clicking does not select, the caller'srenderOptionis kept; the split helper on sections and dividers) and a PagedSelector case.