File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
packages/frontend/src/components/Editor Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -109,19 +109,21 @@ export default function Editor(props: EditorProps): React.ReactElement {
109109 // we include some grouped steps as there is no longer a nested editor
110110 // we identify the group by checking if the current step id is in the group
111111 //
112- const groupStepsToInclude = useMemo (
113- ( ) =>
114- groupedSteps . filter ( ( group ) =>
115- group . some ( ( step ) => step . id === currentStepId ) ,
116- ) ,
117- [ currentStepId , groupedSteps ] ,
118- )
112+ const groupStepsToInclude = useMemo ( ( ) => {
113+ const stepPosition = flow . steps . findIndex (
114+ ( step ) => step . id === currentStepId ,
115+ )
116+
117+ return groupedSteps . flatMap ( ( group ) =>
118+ group . filter ( ( step ) => step . position <= stepPosition ) ,
119+ )
120+ } , [ currentStepId , flow . steps , groupedSteps ] )
119121
120122 const stepExecutionsToInclude = useMemo (
121123 ( ) =>
122124 new Set ( [
123125 ...stepsBeforeGroup . map ( ( step ) => step . id ) ,
124- ...groupStepsToInclude . flatMap ( ( step ) => step . map ( ( s ) => s . id ) ) ,
126+ ...groupStepsToInclude . map ( ( s ) => s . id ) ,
125127 ] ) ,
126128 [ stepsBeforeGroup , groupStepsToInclude ] ,
127129 )
You can’t perform that action at this time.
0 commit comments