Skip to content

feat: add model folder picker actions in deployment add-revision modal#7475

Open
agatha197 wants to merge 1 commit into
fix/FR-2914-add-revision-model-folder-current-projectfrom
feat/deployment-model-folder-picker-actions
Open

feat: add model folder picker actions in deployment add-revision modal#7475
agatha197 wants to merge 1 commit into
fix/FR-2914-add-revision-model-folder-current-projectfrom
feat/deployment-model-folder-picker-actions

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented May 18, 2026

Stacked on #7458 (FR-2914)

image

Summary

Adds model folder picker actions to the deployment add-revision modal and tweaks BAIVFolderSelect's search-time label rendering.

DeploymentAddRevisionModal

  • Add a Space.Compact action group next to the model folder select in both Preset and Custom modes:
    • Open: open the selected folder in the Folder Explorer (via useFolderExplorerOpener, decoded with toLocalId).
    • Create: open a shared FolderCreateModalV2 with initialValues={{ usage_mode: 'model' }} so users can create a model-mode vfolder without leaving the modal.
    • Refresh: call the form's corresponding BAIVFolderSelectRef.refetch() (per-form refs so Preset and Custom forms refetch independently).
  • After folder creation, auto-select the newly created folder in the active form. The mutation returns a VFolder (Strawberry) global id, but BAIVFolderSelect's value query reads from vfolder_nodes (VirtualFolderNode, Graphene). Both encode the same UUID but with different __typename: prefixes, so the select's option matching would fail if we set the raw mutation id directly. Decode with safeDecodeUuid and re-encode with toGlobalId('VirtualFolderNode', uuid).

BAIVFolderSelect

  • Hide the trailing (id) on the selected label while the user is typing a search query. The search input visually collides with the parenthetical id; the id is still shown in the dropdown options (optionRender) for disambiguation when picking.

Test plan

  • In Preset mode: Open → opens explorer; Create → opens FolderCreateModalV2 with usage_mode locked to model; after Create succeeds, the new folder is auto-selected; Refresh bumps the list (effect visible the next time the dropdown is opened).
  • In Custom mode: same as above with the Custom form's select.
  • When searching in the model folder dropdown, the selected label no longer shows the (id) suffix; clearing the search restores it.
  • Existing consumers of BAIVFolderSelect (VFolderMountFormItem, RoleFormModal, AdminModelCardSettingModal, ImportArtifactRevisionToFolderModal) still render the selected label as expected when not searching.

Copy link
Copy Markdown
Contributor Author

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.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)

Status Category Percentage Covered / Total
🔵 Lines 8.03% 362 / 4506
🔵 Statements 7.17% 411 / 5728
🔵 Functions 8.93% 94 / 1052
🔵 Branches 6.36% 362 / 5690
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/backend.ai-ui/src/components/fragments/BAIVFolderSelect.tsx 0% 0% 0% 0% 52-373
Generated in workflow #843 for commit 5978a5d by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.51% 1785 / 27407
🔵 Statements 5.36% 1980 / 36939
🔵 Functions 5.24% 296 / 5646
🔵 Branches 3.73% 1293 / 34581
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/DeploymentAddRevisionModal.tsx 0% 0% 0% 0% 135-1764
Generated in workflow #844 for commit 5978a5d by the Vitest Coverage Report Action

@agatha197 agatha197 marked this pull request as ready for review May 18, 2026 16:41
Copilot AI review requested due to automatic review settings May 18, 2026 16:41
@agatha197 agatha197 requested review from ironAiken2, nowgnuesLee and yomybaby and removed request for nowgnuesLee May 18, 2026 16:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds folder-management actions around model folder selection in the deployment add-revision modal, and adjusts BAIVFolderSelect label rendering while searching.

Changes:

  • Adds Open/Create/Refresh actions next to model folder selects in Preset and Custom revision modes.
  • Adds post-create auto-selection/refetch flow for newly created model folders.
  • Hides the selected folder ID suffix in BAIVFolderSelect while a search query is active.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
react/src/components/DeploymentAddRevisionModal.tsx Adds model folder action buttons, folder creation modal wiring, and refetch/auto-select behavior.
packages/backend.ai-ui/src/components/fragments/BAIVFolderSelect.tsx Updates selected-label rendering to omit the ID suffix during search input.

Comment thread react/src/components/DeploymentAddRevisionModal.tsx
@agatha197 agatha197 force-pushed the fix/FR-2914-add-revision-model-folder-current-project branch from 50a17a6 to 0d20384 Compare May 18, 2026 16:48
@agatha197 agatha197 force-pushed the feat/deployment-model-folder-picker-actions branch from f76df1c to 9048d4c Compare May 18, 2026 16:48
@agatha197 agatha197 changed the base branch from fix/FR-2914-add-revision-model-folder-current-project to graphite-base/7475 May 18, 2026 16:57
- Add Open/Create/Refresh buttons (Space.Compact) next to the model
  folder select in both Preset and Custom modes.
- Mount a shared FolderCreateModalV2 (initialValues usage_mode='model'),
  and auto-select the newly created folder after creation. The mutation
  returns a VFolder global id; re-encode to a VirtualFolderNode global
  id so BAIVFolderSelect option matching succeeds.
- BAIVFolderSelect: hide the trailing '(id)' on the selected label while
  the user is typing a search query, since the search input visually
  collides with the parenthetical id.
@agatha197 agatha197 force-pushed the feat/deployment-model-folder-picker-actions branch from 9048d4c to 5978a5d Compare May 18, 2026 17:00
@agatha197 agatha197 force-pushed the graphite-base/7475 branch from 0d20384 to 86bd35a Compare May 18, 2026 17:00
@agatha197 agatha197 changed the base branch from graphite-base/7475 to fix/FR-2914-add-revision-model-folder-current-project May 18, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants