Repository navigation
feat(FR-4129): add a form item label action slot - #10094
nowgnuesLee wants to merge 4 commits into
Conversation
Form.Item takes a labelExtra node for actions that belong to the field's label row. It renders outside the <label>, so it no longer joins the control's accessible name or triggers label activation: at the far end of the row in vertical layout, right after the label in horizontal and inline layout, where the colon moves to the end of the slot. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Environments / Version field passes its image filter dropdown through labelExtra instead of a hand-built BAIFlex label, so it sits at the right end of the label row in the vertical session launcher. The menu aligns to the trigger's end now that the trigger is at the right edge. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PR Analysis Report📚 Storybook PreviewGitHub Pages may take up to a minute to hydrate after the deploy. 🧩 Changed Components1 component(s) changed, none of which has a
1 changed component(s) with no story to open
5 other changed file(s) in
|
| File | Size | Gzip | Δ Gzip vs base |
|---|---|---|---|
backend.ai-ui.js |
1863.9 kB | 441.7 kB | +0.2 kB |
Total gzip: 441.7 kB (+0.2 kB vs origin/main)
Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
In vertical layout the label column no longer clips overflow when it holds a labelExtra slot, so the flush-right button's focus ring stays whole. In horizontal layout the label text clips at its own edge when the column is too narrow, instead of painting over the slot. Also adds tests for Form.Item forwarding labelExtra and for the default colon. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the requested behavior and includes focused automated coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds a reusable labelExtra action slot to form labels and adopts it for the session launcher’s image filter.
Changes:
- Places label actions outside the native
<label>. - Supports layout-aware positioning and colon handling.
- Adds forwarding and rendering tests.
| File | Description |
|---|---|
react/src/components/ImageEnvironmentSelectFormItems.tsx |
Moves the image filter into labelExtra. |
packages/backend.ai-ui/src/form-engine/FormItemVisual.tsx |
Renders the new label action slot. |
packages/backend.ai-ui/src/form-engine/FormItemVisual.labelExtra.test.tsx |
Tests placement, forwarding, and colon behavior. |
packages/backend.ai-ui/src/form-engine/FormItemVisual.css |
Implements layout, clipping, and colon styles. |
packages/backend.ai-ui/src/form-engine/FormItem.tsx |
Exposes and forwards labelExtra. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
…dapter main moved the form engine into @lablup/ui-common (FR-4088), deleting the BUI FormItem/FormItemVisual files this PR extended. ui-common 0.2.0-alpha.17 has no labelExtra, so BUI's BAIFormItem becomes a thin adapter over the engine's FormItem that renders labelExtra next to the label text inside ui-common's label node, with BUI CSS spreading the row in vertical layout. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Dev server on box |
|
Closing this PR. We decided to make the change in Since FR-4088 (#10023), the form engine ( Once a ui-common release ships it, a follow-up webui PR will bump the catalog pin and move the session launcher's image filter on Environments / Version into |
Form.Item and FormItemVisual take `labelExtra` for actions that belong to a field's label row (a filter or sort toggle). The slot renders beside the <label>, not inside it, so its buttons stay out of the control's accessible name and never trigger label activation. Vertical layout pushes it to the far end of the row and stops the label column clipping its focus ring; horizontal and inline layout put it right after the label, with the colon moved to the end of the slot. Requested by backend.ai-webui (lablup/backend.ai-webui#10094), whose session launcher hand-built a button inside its label to get this. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Form.Item and FormItemVisual take `labelExtra` for actions that belong to a field's label row (a filter or sort toggle). The slot renders beside the <label>, not inside it, so its buttons stay out of the control's accessible name and never trigger label activation. Vertical layout pushes it to the far end of the row and stops the label column clipping its focus ring; horizontal and inline layout put it right after the label, with the colon moved to the end of the slot. Requested by backend.ai-webui (lablup/backend.ai-webui#10094), whose session launcher hand-built a button inside its label to get this. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(Form): add a labelExtra slot to Form.Item's label row Form.Item and FormItemVisual take `labelExtra` for actions that belong to a field's label row (a filter or sort toggle). The slot renders beside the <label>, not inside it, so its buttons stay out of the control's accessible name and never trigger label activation. Vertical layout pushes it to the far end of the row and stops the label column clipping its focus ring; horizontal and inline layout put it right after the label, with the colon moved to the end of the slot. Requested by backend.ai-webui (lablup/backend.ai-webui#10094), whose session launcher hand-built a button inside its label to get this. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * docs(Form): add a labelExtra story Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Resolves #10071 (FR-4129)
Summary
BAIFormItemtakes a newlabelExtraprop for actions that belong to a field's label row. Since FR-4088 moved the form engine into@lablup/ui-common(and 0.2.0-alpha.17 has no such slot),BAIFormItemis now a thin BUI adapter (packages/backend.ai-ui/src/components/BAIFormItem.tsx) over the engine'sFormItem; every other prop passes through.[label][labelExtra]as thelabelnode, so the slot sits inside ui-common's<label>. Horizontal / inline layout: the slot follows the label text and the colon still ends the row.BAIFormItem.css,@layer components) stretches the label to the row width with:has()and pushes the slot to the far right; the label column stops clipping so the button's focus ring stays whole, and the label text (not the slot) ellipsizes in a narrow column.<label>, so its button text joins the control's accessible name, the same as the existingcopyablecopy button in that label. Clicking the button does not activate the label (interactive descendant).BAIFlexlabel intolabelExtra(that one item switches fromForm.ItemtoBAIFormItem). Its menu aligns to the trigger's end (alignment="end").Where to look
Open the session launcher and find the Environments / Version field. The image filter button (the up/down-arrow icon that toggles Show accelerator-dedicated images first) is the first adopter of
labelExtra: it should sit at the far right end of the label row, vertically centred with the label text, with its menu opening aligned to the button's right edge. Toggle it to check the icon turns the accent colour and the image list reorders.Verification
bash scripts/verify.sh→=== ALL PASS ===after merging main (Astryx token gate: 0 undeclared).BAIFormItem.test.tsxcovers slot placement in the label row, the plain label forundefined/null/false, and no slot without alabel;form-engine/index.test.tsassertsBAIFormItemis the adapter.🔗 Dev server: http://fr-4129-pr10094.seungwon.10-82-0-159.sslip.io