feat(FR-3154): add reusable BAIVFolderMountConfigInput component#7932
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
9ea409a to
5f9f5ab
Compare
9bb3f20 to
80466ff
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new reusable Backend.AI UI fragment component to configure vfolder mounts (alias/mount destination + optional subpath) as a single controlled VFolderMountConfigValue[] payload, intended to be schema-agnostic and embeddable in a single Form.Item.
Changes:
- Added
BAIVFolderMountConfigInputfragment component composingBAIVFolderSelect(multi) and per-folder alias/subpath inputs with inline validation UI. - Exported the new component + types from the fragments barrel.
- Added
comp:BAIVFolderMountConfigInputi18n keys across BUI locale JSONs (with localized strings foren/koand English fallbacks elsewhere).
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backend.ai-ui/src/locale/zh-TW.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/zh-CN.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/vi.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/tr.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/th.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/ru.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/pt.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/pt-BR.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/pl.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/ms.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/mn.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/ko.json | Adds localized Korean strings for comp:BAIVFolderMountConfigInput. |
| packages/backend.ai-ui/src/locale/ja.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/it.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/id.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/fr.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/fi.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/es.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/en.json | Adds English strings for comp:BAIVFolderMountConfigInput. |
| packages/backend.ai-ui/src/locale/el.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/locale/de.json | Adds comp:BAIVFolderMountConfigInput strings (English fallback). |
| packages/backend.ai-ui/src/components/fragments/index.ts | Re-exports BAIVFolderMountConfigInput and its public types. |
| packages/backend.ai-ui/src/components/fragments/BAIVFolderMountConfigInput.tsx | Implements the reusable controlled mount-config input UI and validation display. |
80466ff to
f1a62fc
Compare
5f9f5ab to
2bf1cdf
Compare
f1a62fc to
ce162e0
Compare
2bf1cdf to
8238fc4
Compare
ce162e0 to
443fe8e
Compare
Reusable, schema-agnostic controlled input for configuring vfolder mounts. Composes BAIVFolderSelect to pick folders; each selected folder appears as a row with a mount destination (alias) input and an optional subpath input. Emits a single VFolderMountConfigValue[] value so it can be wrapped in one Form.Item and mapped to any mount mutation input by the consumer.
Reusable, schema-agnostic controlled input for configuring vfolder mounts. Composes BAIVFolderSelect to pick folders; each selected folder appears as a row with a mount destination (alias) input and an optional subpath input. Emits a single VFolderMountConfigValue[] value so it can be wrapped in one Form.Item and mapped to any mount mutation input by the consumer. Adds comp:BAIVFolderMountConfigInput i18n keys across all locales (en/ko translated, others English fallback) and uses BAIText for the folder name.
8238fc4 to
5a9eb17
Compare
443fe8e to
4d68a95
Compare
agatha197
left a comment
There was a problem hiding this comment.
Review — actionable items
This is an additive BUI primitive with no consumer wired yet, so none of these block today. Listing what should be fixed before the first consumer wires it in.
Correctness
- Single source of truth for
mountDestination. Display/validation recompute the destination every render (destinationByVFolderId, ~L197-205 / L307-313), but the emitted value uses the storedentry.mountDestinationwritten across four handlers. These can diverge. Please settle on one — emit the recomputed value, or validate the stored one. onChangeupdatesnamewithout recomputingmountDestination(~L267-270). The existing-entry branch returns{ ...existing, name: resolvedName }while leavingmountDestinationat${basePath}${uuid}. BecauseonResolvedNamesChangeis guarded by!entry.name, the UI self-corrects but the emitted value can still carry the UUID-based path. Recompute viainputToMountDestination(...)in that branch.- Alias inputs desync on external value re-drive (~L133-160).
aliasInputsre-seeds only via theselectedIdsKey(id-set) effect and preserves existing ids verbatim. If a controlled parent re-drivesvaluewith the same vfolderId set but differentmountDestinations (reset/discard, asyncsetFieldsValue), the local alias text goes stale. Reconcile against a destinations digest, re-derivingnext[id]when the storedmountDestinationno longer matches the local alias (mirrors VFolderTable'saliasMapreconcile).
Parity / contract
- Missing auto-mount collision check (
destinationCounts, ~L193-198). Only within-selection overlap is detected. The legacy VFolderTable this component claims to mirror also rejects collisions with auto-mounted (dotfile) folders (FolderAliasOverlappingToAutoMount). Either accept the auto-mount folder names as a prop and include them in the overlap set, or document the limitation in the JSDoc. - Validation contract is advisory-only. The overlap/alias validators are module-private and the emitted
VFolderMountConfigValue[]exposes no validity surface, so the JSDoc "wrap in oneForm.Item" guidance is misleading (that wrapper gets norules). Please either export the validators or expose astatus/onValidityChangesurface, and correct the JSDoc accordingly.
i18n
- 19 locales were seeded with verbatim English (
locale/{ja,th,de,…}.json, 11 keys × 19 = 209 English values). This diverges from the full-translation precedent (FR-3032). Please runfw:i18nbefore merge, or scope this PR toen+koand let the translation flow backfill the rest — avoid committing English into non-enfiles.
UI / layout
-
Remove (✕) button vertical alignment. The row uses
align="start", so when the alias column shows its helper text (the resolved/home/work/...path) the row grows taller and the ✕ button sticks to the top instead of lining up with the inputs. Please vertically center the ✕ with the input row (e.g. align it to the input height rather than the full, helper-text-inclusive row height).
Nit
- Use named gap tokens.
gap={token.sizeXXS}(L208, L289, L320) should begap="xxs"to match the BUI convention (the file already mixes both).
ce2a9f2 to
3bac8a0
Compare
I applied. Thanks! |
agatha197
left a comment
There was a problem hiding this comment.
A couple of consistency nits on the columnLabel header helper — see the inline comment. Both are about reusing the existing shared help-icon component and dropping the hardcoded pixel size.
agatha197
left a comment
There was a problem hiding this comment.
One more nit on the remove-icon size — see inline.
3bac8a0 to
87d5904
Compare
…derSelect When a parent reduces the selection externally, the optimistic value lagged behind during the deferred window and briefly re-displayed the removed chip. Filter the optimistic value to the current value so removed items don't reappear. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
87d5904 to
6ab430b
Compare


Stacked on #7931 · Part of FR-3059 (#7756) · Resolves FR-3154
Summary
BAIVFolderMountConfigInput, a reusable, schema-agnostic controlled input for configuring vfolder mounts (packages/backend.ai-ui/src/components/fragments/).BAIVFolderSelect(multiple) to pick folders; each selected folder renders as a row below the select with:/home/work/{name}),VFolderMountConfigValue[]value viavalue/onChange, so it wraps in oneForm.Itemand the consumer maps it to any mount mutation input. No GraphQL/schema coupling.^[a-zA-Z0-9_/.-]*$), alias overlap between folders, and relative-subpath / no-..checks.comp:BAIVFolderMountConfigInput) forenandko.Notes
Verification (
scripts/verify.sh)backend.ai-uipackagetsc --noEmit: 0 errorsverify.shis pre-existing onmain(unrelated Relay input-type mismatch inreact/src/pages/AdminDeploymentPresetSettingPage.tsx,service.port: number | nullvsnumber) and is not introduced by this PR.Test plan