@@ -4,7 +4,14 @@ import {
44 VSCodeProgressRing ,
55} from "@vscode/webview-ui-toolkit/react" ;
66import * as React from "react" ;
7- import { forwardRef , useCallback , useEffect , useMemo , useRef } from "react" ;
7+ import {
8+ Fragment ,
9+ forwardRef ,
10+ useCallback ,
11+ useEffect ,
12+ useMemo ,
13+ useRef ,
14+ } from "react" ;
815import { styled } from "styled-components" ;
916import { vscode } from "../vscode-api" ;
1017
@@ -25,12 +32,6 @@ import { Codicon } from "../common";
2532import { canAddNewModeledMethod } from "../../model-editor/shared/multiple-modeled-methods" ;
2633import { DataGridCell , DataGridRow } from "../common/DataGrid" ;
2734
28- const MultiModelColumn = styled ( DataGridCell ) `
29- display: flex;
30- flex-direction: column;
31- gap: 0.5em;
32- ` ;
33-
3435const ApiOrMethodRow = styled . div `
3536 min-height: calc(var(--input-height) * 1px);
3637 display: flex;
@@ -162,7 +163,7 @@ const ModelableMethodRow = forwardRef<HTMLElement | undefined, MethodRowProps>(
162163 ref = { ref }
163164 focused = { revealedMethodSignature === method . signature }
164165 >
165- < DataGridCell >
166+ < DataGridCell gridRow = { `span ${ modeledMethods . length } ` } >
166167 < ApiOrMethodRow >
167168 < ModelingStatusIndicator status = { modelingStatus } />
168169 < MethodClassifications method = { method } />
@@ -199,54 +200,41 @@ const ModelableMethodRow = forwardRef<HTMLElement | undefined, MethodRowProps>(
199200 ) }
200201 </ >
201202 ) }
202- { ! props . modelingInProgress && (
203- < >
204- < MultiModelColumn >
205- { modeledMethods . map ( ( modeledMethod , index ) => (
203+ { ! props . modelingInProgress &&
204+ modeledMethods . map ( ( modeledMethod , index ) => (
205+ < Fragment key = { index } >
206+ < DataGridCell >
206207 < ModelTypeDropdown
207- key = { index }
208208 method = { method }
209209 modeledMethod = { modeledMethod }
210210 onChange = { modeledMethodChangedHandlers [ index ] }
211211 />
212- ) ) }
213- </ MultiModelColumn >
214- < MultiModelColumn >
215- { modeledMethods . map ( ( modeledMethod , index ) => (
212+ </ DataGridCell >
213+ < DataGridCell >
216214 < ModelInputDropdown
217- key = { index }
218215 method = { method }
219216 modeledMethod = { modeledMethod }
220217 onChange = { modeledMethodChangedHandlers [ index ] }
221218 />
222- ) ) }
223- </ MultiModelColumn >
224- < MultiModelColumn >
225- { modeledMethods . map ( ( modeledMethod , index ) => (
219+ </ DataGridCell >
220+ < DataGridCell >
226221 < ModelOutputDropdown
227- key = { index }
228222 method = { method }
229223 modeledMethod = { modeledMethod }
230224 onChange = { modeledMethodChangedHandlers [ index ] }
231225 />
232- ) ) }
233- </ MultiModelColumn >
234- < MultiModelColumn >
235- { modeledMethods . map ( ( modeledMethod , index ) => (
226+ </ DataGridCell >
227+ < DataGridCell >
236228 < ModelKindDropdown
237- key = { index }
238229 method = { method }
239230 modeledMethod = { modeledMethod }
240231 onChange = { modeledMethodChangedHandlers [ index ] }
241232 />
242- ) ) }
243- </ MultiModelColumn >
244- { viewState . showMultipleModels && (
245- < MultiModelColumn >
246- { modeledMethods . map ( ( _ , index ) =>
247- index === modeledMethods . length - 1 ? (
233+ </ DataGridCell >
234+ { viewState . showMultipleModels && (
235+ < DataGridCell >
236+ { index === modeledMethods . length - 1 ? (
248237 < CodiconRow
249- key = { index }
250238 appearance = "icon"
251239 aria-label = "Add new model"
252240 onClick = { handleAddModelClick }
@@ -256,19 +244,17 @@ const ModelableMethodRow = forwardRef<HTMLElement | undefined, MethodRowProps>(
256244 </ CodiconRow >
257245 ) : (
258246 < CodiconRow
259- key = { index }
260247 appearance = "icon"
261248 aria-label = "Remove model"
262249 onClick = { removeModelClickedHandlers [ index ] }
263250 >
264251 < Codicon name = "trash" />
265252 </ CodiconRow >
266- ) ,
267- ) }
268- </ MultiModelColumn >
269- ) }
270- </ >
271- ) }
253+ ) }
254+ </ DataGridCell >
255+ ) }
256+ </ Fragment >
257+ ) ) }
272258 </ DataGridRow >
273259 ) ;
274260 } ,
0 commit comments