Skip to content

Commit 8a298f1

Browse files
committed
refactor(FR-2862): merge deployment Content components into Modal components (#7403)
Resolves #7347(FR-2862) Collapses the per-mode `Content + Modal` split for deployment-creation flows into single Modal components. The `*Content` antipattern is removed entirely across the deployment-creation surface. ## Changes - **`DeploymentPresetDetailModal`** (new) — replaces `DeploymentPresetDetailContent`. Owns its own `BAIModal` frame instead of relying on a parent wrapper. - **`DeploymentAddRevisionModal`** — `DeploymentAddRevisionPresetContent` and `DeploymentAddRevisionCustomContent` merged into a single component with a `Segmented` mode toggle in the modal title. Shared `presetTransferFragment` (`@inline`) preserves cross-mode prefill via `readInlineData`. - **`VFolderDeployModal`** — `VFolderDeployModalContent` inlined. Empty-state / auto-deploy / selection-UI paths now branch in the single component body. - **`ModelCardDeployModal`** — `ModelCardDeployModalContent` inlined with the same scenario branching. - **Callers** (`VFolderNodes`, `VFolderNodesV2`, `ModelCardDrawer`) wrap the Modals with `BAIUnmountAfterClose` so the lazy Relay query gate that previously lived in the wrapper component now lives at the call site. ## Behavioral notes - Upper-stack Selects wired into the merged components where applicable: `BAIAvailablePresetSelect`, `BAIProjectResourceGroupSelect` (`autoSelectDefault`), `BAIProjectVfolderSelect`, `BAIRuntimeVariantSelect`. - Auto-deploy paths (single preset + single resource group) guarded by `useEffectEvent` + `useRef` for StrictMode idempotency. - Lazy-load gating preserved via `useDeferredValue(open)` + `store-only` fetchPolicy on the query, and `loading={deferredOpen !== open}` on the Modal. ## Verification `bash scripts/verify.sh`: - Relay: PASS - Lint: PASS - Format: PASS - TypeScript: pre-existing errors only (Relay-generated nullable response types in `deployVfolderV2`, antd Form render-prop inference). Confirmed by re-running tsc on the parent commit with this branch's changes stashed. **Checklist:** (if applicable) - [ ] Documentation - [ ] Minimum required manager version - [ ] Specific setting for review - [x] Minimum requirements to check during review — verify the Deploy / Create Revision / Preset Detail modals on a model card and vfolder still behave as before across the empty / auto-deploy / selection scenarios - [ ] Test case(s) to demonstrate the difference of before/after
1 parent 61939b7 commit 8a298f1

11 files changed

Lines changed: 1662 additions & 2036 deletions

react/src/components/AdminDeploymentPresetNodes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const AdminDeploymentPresetNodes: React.FC<AdminDeploymentPresetNodesProps> = ({
9191
deploymentStrategy
9292
}
9393
createdAt
94-
...DeploymentPresetDetailContentFragment
94+
...DeploymentPresetDetailModalFragment
9595
}
9696
`,
9797
presetsFrgmt,

0 commit comments

Comments
 (0)