Skip to content

feat(FR-2915): add showOpen/showCreate/showRefresh buttons to BAIVFolderSelect#7468

Closed
agatha197 wants to merge 1 commit into
fix/FR-2914-add-revision-model-folder-current-projectfrom
feat/FR-2915-bai-vfolder-select-show-buttons
Closed

feat(FR-2915): add showOpen/showCreate/showRefresh buttons to BAIVFolderSelect#7468
agatha197 wants to merge 1 commit into
fix/FR-2914-add-revision-model-folder-current-projectfrom
feat/FR-2915-bai-vfolder-select-show-buttons

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented May 18, 2026

Resolves #7467 (FR-2915)

Summary

Adds the three action-button props (showOpenButton, showCreateButton, showRefreshButton) from the legacy react/src/components/VFolderSelect.tsx onto the shared BAIVFolderSelect fragment in backend.ai-ui, and wires them in both modes of DeploymentAddRevisionModal.

  • BAIVFolderSelect
    • New boolean props render a Space.Compact with up to three buttons next to the select.
    • Open: writes the selected folder UUID (local id, via toLocalId when valuePropName === 'id') to the folder URL search param (react-router-dom's useSearchParams — mirrors useFolderExplorerOpener).
    • Create: opens FolderCreateModalV2 (cross-package import, same pattern as BAIDynamicStepInputNumber) pre-filled with usage_mode: 'model'. On success the paginated query refetches under a transition.
    • Refresh: re-runs the paginated query via the existing useFetchKey/startRefetchTransition plumbing.
  • Storybook
    • Documents the three new props in the BAI-Specific Props table.
    • Adds WithActionButtons story.
  • i18n
    • Adds comp:BAIVFolderSelect.OpenFolder, CreateANewStorageFolder, Refresh to all 21 backend.ai-ui locale files, reusing wording from the main resources/i18n translations where they already exist.
  • DeploymentAddRevisionModal
    • Both BAIVFolderSelect usages (preset and advanced modes) now pass showOpenButton showCreateButton showRefreshButton.

Stacked on top of #7465 (FR-2914 — scope add-revision model folder picker to the current project).

Test plan

  • Storybook Fragments/BAIVFolderSelect WithActionButtons story renders the three buttons next to the select.
  • In DeploymentAddRevisionModal (preset and advanced modes):
    • Refresh button re-runs the paginated query.
    • Create button opens FolderCreateModalV2; creating a new model folder refetches and the new folder appears in the list.
    • Open button is disabled when no folder is selected; once selected, clicking sets ?folder=<uuid> so the explorer opens that folder.
  • All 21 locale files include the three new keys.

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

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

Status Category Percentage Covered / Total
🔵 Lines 8% 362 / 4525
🔵 Statements 7.15% 411 / 5747
🔵 Functions 8.87% 94 / 1059
🔵 Branches 6.33% 362 / 5711
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/backend.ai-ui/src/components/fragments/BAIVFolderSelect.tsx 0% 0% 0% 0% 60-479
Generated in workflow #828 for commit 35b01ba by the Vitest Coverage Report Action

@agatha197 agatha197 closed this May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.9% 1891 / 27381
🔵 Statements 5.65% 2086 / 36912
🔵 Functions 5.39% 304 / 5636
🔵 Branches 3.79% 1311 / 34573
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/DeploymentAddRevisionModal.tsx 0% 0% 0% 0% 129-1631
Generated in workflow #828 for commit 35b01ba by the Vitest Coverage Report Action

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.

1 participant