@@ -142,6 +142,30 @@ export const CreateWorkspacePageViewExperimental: FC<
142
142
} ,
143
143
} ) ;
144
144
145
+ // On component mount, sends all initial parameter values to the websocket
146
+ // (including defaults and autofilled from the url)
147
+ // This ensures the backend has the complete initial state of the form,
148
+ // which is vital for correctly rendering dynamic UI elements where parameter visibility
149
+ // or options might depend on the initial values of other parameters.
150
+ const hasInitializedWebsocket = useRef ( false ) ;
151
+ useEffect ( ( ) => {
152
+ if ( hasInitializedWebsocket . current ) return ;
153
+
154
+ const formValues = form . values . rich_parameter_values ;
155
+ if ( parameters . length > 0 && formValues && formValues . length > 0 ) {
156
+ const initialParams :{ [ k :string ] :string } = { } ;
157
+ for ( const param of formValues ) {
158
+ if ( param . name && param . value ) {
159
+ initialParams [ param . name ] = param . value ;
160
+ }
161
+ }
162
+ if ( Object . keys ( initialParams ) . length > 0 ) {
163
+ sendMessage ( initialParams ) ;
164
+ hasInitializedWebsocket . current = true ;
165
+ }
166
+ }
167
+ } , [ parameters , form . values . rich_parameter_values , sendMessage ] ) ;
168
+
145
169
const autofillByName = useMemo (
146
170
( ) =>
147
171
Object . fromEntries (