@@ -31,25 +31,29 @@ export const ConnectionFormPage = () => {
3131 return undefined ;
3232 }
3333
34- // Helper to flatten group hierarchy for dropdown
34+ // Helper to flatten group hierarchy for dropdown, excluding ROOT group
3535 function getGroupOptions ( ) : SearchableDropdownOptions [ ] {
3636 if ( ! context ?. state ?. connectionGroups ) return [ ] ;
37+ // Find the root group id (assuming name is "ROOT")
38+ const rootGroup = context . state . connectionGroups . find ( ( g ) => g . name === "ROOT" ) ;
39+ const rootGroupId = rootGroup ?. id ;
3740 // Recursively build hierarchical options, skipping ROOT
3841 function buildOptions (
3942 groups : IConnectionGroup [ ] ,
4043 parentId ?: string ,
4144 prefix : string = "" ,
4245 ) : SearchableDropdownOptions [ ] {
4346 return groups
44- . filter ( ( g ) => g . parentId === parentId && g . name !== "ROOT" )
47+ . filter ( ( g ) => g . parentId === parentId && g . id !== rootGroupId && g . name !== "ROOT" )
4548 . flatMap ( ( g ) => {
4649 const label = prefix ? `${ prefix } / ${ g . name } ` : g . name ;
4750 const children = buildOptions ( groups , g . id , label ) ;
4851 return [ { key : g . id , text : label , value : g . id } , ...children ] ;
4952 } ) ;
5053 }
5154
52- return buildOptions ( context . state . connectionGroups ) ;
55+ // Start from rootGroupId if available, otherwise undefined
56+ return buildOptions ( context . state . connectionGroups , rootGroupId ?? undefined ) ;
5357 }
5458
5559 // Selected group state
@@ -58,7 +62,7 @@ export const ConnectionFormPage = () => {
5862 return (
5963 < div >
6064 { /* Connection Group Dropdown */ }
61- < div style = { { marginBottom : 16 } } >
65+ { /* <div style={{ marginBottom: 16 }}>
6266 <label
6367 htmlFor="connection-group-dropdown"
6468 style={{ fontWeight: 500, marginRight: 8 }}>
@@ -71,7 +75,7 @@ export const ConnectionFormPage = () => {
7175 onSelect={(option: SearchableDropdownOptions) => setSelectedGroup(option.value)}
7276 placeholder="Select a group"
7377 />
74- </ div >
78+ </div> */ }
7579 { /* Existing connection form fields */ }
7680 { context . state . connectionComponents . mainOptions . map ( ( inputName , idx ) => {
7781 const component =
0 commit comments