Skip to content

feat(FR-2889): auto-select default resource group in deployment modals#7402

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals
May 15, 2026
Merged

feat(FR-2889): auto-select default resource group in deployment modals#7402
graphite-app[bot] merged 1 commit into
mainfrom
05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented May 13, 2026

Resolves #7401 (FR-2889)

Summary

  • ModelCardDeployModal / VFolderDeployModal: replace the userSelectedResourceGroup ?? resourceGroups[0]?.name controlled-fallback pattern with a single selectedResourceGroup state and pass autoSelectDefault to BAIProjectResourceGroupSelect so the component fires onChange with the chosen group (project's default, or the first available) once data loads.
  • DeploymentAddRevisionPresetContent: pass autoSelectDefault to BAIProjectResourceGroupSelect inside Form.Item name="resourceGroup" — the internal onChange is picked up by Form.Item and stored in form state.
  • DeploymentAddRevisionCustomContent: opt into the new autoSelectFirstResourceGroup prop on shared ResourceAllocationFormItems. The prop is off by default (false) so SessionLauncherPage / ServiceLauncherPageContent, which prefill via currentGlobalResourceGroup, keep their existing behavior unchanged.

Verification

  • bash scripts/verify.sh: Relay PASS / Lint PASS / Format PASS. TypeScript: only pre-existing baseline noise (SessionLauncherPage, StatisticsPage, StorageHostSettingPage, UserCredentialsPage, UserSettingsPage, VFolderNodeListPage) — none of the modified files report errors.

Test plan

  • Open ModelCardDeployModal → resource group field is pre-filled with the project's default (or first) group; Deploy button no longer blocked solely by an unselected resource group.
  • Open VFolderDeployModal → same.
  • Open DeploymentAddRevisionPresetContent (preset mode) → resourceGroup form field is initialized so the required-field validator passes without manual selection.
  • Open DeploymentAddRevisionCustomContent (custom mode) → resource group is auto-selected; existing prefillFromCurrentRevision flow still overrides correctly when the user clicks "Load current revision".
  • Session launcher (SessionLauncherPage) and service launcher behavior unchanged — they keep using currentGlobalResourceGroup; the new autoSelectFirstResourceGroup prop defaults to false.

Copy link
Copy Markdown
Contributor Author

agatha197 commented May 13, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.49% 1783 / 27437
🔵 Statements 5.33% 1978 / 37073
🔵 Functions 5.26% 296 / 5627
🔵 Branches 3.73% 1293 / 34643
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/DeploymentAddRevisionCustomContent.tsx 0% 0% 0% 0% 74-1186
react/src/components/DeploymentAddRevisionPresetContent.tsx 0% 0% 0% 0% 67-168
react/src/components/ModelCardDeployModal.tsx 0% 0% 0% 0% 60-337
react/src/components/VFolderDeployModal.tsx 0% 0% 0% 0% 61-117
react/src/components/SessionFormItems/ResourceAllocationFormItems.tsx 12.64% 7.93% 12.67% 12.4% 62, 117-1504, 1566
Generated in workflow #780 for commit 61939b7 by the Vitest Coverage Report Action

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

Enables automatic initialization of the “resource group” selection across deployment-related modals/flows by opting into BAIProjectResourceGroupSelect’s autoSelectDefault behavior, reducing UX friction from a required-but-empty first field.

Changes:

  • ModelCardDeployModal and VFolderDeployModal switch to a single selectedResourceGroup state and enable autoSelectDefault on BAIProjectResourceGroupSelect.
  • DeploymentAddRevisionPresetContent enables autoSelectDefault inside the resourceGroup Form.Item so the form value is set automatically.
  • ResourceAllocationFormItems adds an opt-in prop (autoSelectFirstResourceGroup) that forwards to autoSelectDefault, and DeploymentAddRevisionCustomContent opts in.

Reviewed changes

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

Show a summary per file
File Description
react/src/components/VFolderDeployModal.tsx Uses autoSelectDefault + controlled selectedResourceGroup for resource-group selection in the vfolder deploy modal.
react/src/components/SessionFormItems/ResourceAllocationFormItems.tsx Adds an opt-in prop to auto-select the first/default resource group via BAIProjectResourceGroupSelect.
react/src/components/ModelCardDeployModal.tsx Uses autoSelectDefault + controlled selectedResourceGroup for resource-group selection in the model-card deploy modal.
react/src/components/DeploymentAddRevisionPresetContent.tsx Enables autoSelectDefault so the required resourceGroup form field is initialized automatically.
react/src/components/DeploymentAddRevisionCustomContent.tsx Opts into the new ResourceAllocationFormItems auto-select behavior for custom revision flow.

Comment thread react/src/components/VFolderDeployModal.tsx
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from ab4a457 to ee90cf4 Compare May 13, 2026 04:53
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals branch 2 times, most recently from 9904d72 to 5854ed7 Compare May 13, 2026 05:01
Comment thread react/src/components/ModelCardDeployModal.tsx
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from ee90cf4 to b724b5d Compare May 14, 2026 05:21
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals branch from 5854ed7 to 43a4f16 Compare May 14, 2026 05:22
@agatha197 agatha197 changed the base branch from 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery to graphite-base/7402 May 14, 2026 07:13
@agatha197 agatha197 force-pushed the graphite-base/7402 branch from b724b5d to a9174f0 Compare May 14, 2026 07:17
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals branch from 43a4f16 to 6452661 Compare May 14, 2026 07:17
@agatha197 agatha197 changed the base branch from graphite-base/7402 to 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery May 14, 2026 07:17
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from a9174f0 to 90e3240 Compare May 14, 2026 07:32
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals branch from 6452661 to 8f56569 Compare May 14, 2026 07:32
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from 90e3240 to ed69612 Compare May 14, 2026 10:00
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals branch from 8f56569 to 9810517 Compare May 14, 2026 10:00
Copy link
Copy Markdown
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

LGTM

@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from ed69612 to bf658de Compare May 15, 2026 07:45
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals branch from 9810517 to 2088237 Compare May 15, 2026 07:45
Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

LGTM

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 15, 2026

Merge activity

#7402)

Resolves #7401 ([FR-2889](https://lablup.atlassian.net/browse/FR-2889))

## Summary
- `ModelCardDeployModal` / `VFolderDeployModal`: replace the `userSelectedResourceGroup ?? resourceGroups[0]?.name` controlled-fallback pattern with a single `selectedResourceGroup` state and pass `autoSelectDefault` to `BAIProjectResourceGroupSelect` so the component fires `onChange` with the chosen group (project's `default`, or the first available) once data loads.
- `DeploymentAddRevisionPresetContent`: pass `autoSelectDefault` to `BAIProjectResourceGroupSelect` inside `Form.Item name="resourceGroup"` — the internal `onChange` is picked up by `Form.Item` and stored in form state.
- `DeploymentAddRevisionCustomContent`: opt into the new `autoSelectFirstResourceGroup` prop on shared `ResourceAllocationFormItems`. The prop is **off by default** (`false`) so `SessionLauncherPage` / `ServiceLauncherPageContent`, which prefill via `currentGlobalResourceGroup`, keep their existing behavior unchanged.

## Verification
- `bash scripts/verify.sh`: Relay PASS / Lint PASS / Format PASS. TypeScript: only pre-existing baseline noise (`SessionLauncherPage`, `StatisticsPage`, `StorageHostSettingPage`, `UserCredentialsPage`, `UserSettingsPage`, `VFolderNodeListPage`) — none of the modified files report errors.

## Test plan
- [ ] Open `ModelCardDeployModal` → resource group field is pre-filled with the project's default (or first) group; Deploy button no longer blocked solely by an unselected resource group.
- [ ] Open `VFolderDeployModal` → same.
- [ ] Open `DeploymentAddRevisionPresetContent` (preset mode) → `resourceGroup` form field is initialized so the required-field validator passes without manual selection.
- [ ] Open `DeploymentAddRevisionCustomContent` (custom mode) → resource group is auto-selected; existing `prefillFromCurrentRevision` flow still overrides correctly when the user clicks "Load current revision".
- [ ] Session launcher (`SessionLauncherPage`) and service launcher behavior unchanged — they keep using `currentGlobalResourceGroup`; the new `autoSelectFirstResourceGroup` prop defaults to `false`.

[FR-2889]: https://lablup.atlassian.net/browse/FR-2889?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@graphite-app graphite-app Bot force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from bf658de to 91322cc Compare May 15, 2026 07:58
@graphite-app graphite-app Bot force-pushed the 05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals branch from 2088237 to 61939b7 Compare May 15, 2026 07:59
Base automatically changed from 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery to main May 15, 2026 08:06
@graphite-app graphite-app Bot merged commit 61939b7 into main May 15, 2026
5 checks passed
@graphite-app graphite-app Bot deleted the 05-13-feat_fr-2889_auto-select_default_resource_group_in_deployment_modals branch May 15, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-select default resource group in deployment modals and revision content

4 participants