@@ -177,8 +177,13 @@ const PositronConnectionsItem = (props: React.PropsWithChildren<PositronConnecti
177177
178178 // If the connection is not expandable, we add some more padding.
179179 const padding = props . item . level * 10 + ( props . item . expanded === undefined ? 26 : 0 ) ;
180+ const [ expanding , setExpanding ] = useState < boolean > ( false ) ;
181+
180182 const handleExpand = ( ) => {
181183 props . onToggleExpand ( props . item . id ) ;
184+ setTimeout ( ( ) => {
185+ setExpanding ( true ) ;
186+ } , 100 ) ;
182187 } ;
183188
184189 const iconClass = ( kind ?: string ) => {
@@ -270,6 +275,25 @@ const PositronConnectionsItem = (props: React.PropsWithChildren<PositronConnecti
270275 }
271276 } ;
272277
278+ const expandIcon = ( ( ) => {
279+ if ( props . item . expanded === undefined ) {
280+ return < > </ > ;
281+ }
282+
283+ const className = expanding ?
284+ `codicon codicon-loading animate-spin` :
285+ `codicon codicon-chevron-${ props . item . expanded ? 'down' : 'right' } ` ;
286+
287+ return (
288+ < div
289+ className = 'expand-collapse-area'
290+ onClick = { handleExpand }
291+ >
292+ < div className = { className } />
293+ </ div >
294+ )
295+ } ) ( ) ;
296+
273297 return (
274298 < div
275299 className = { positronClassNames (
@@ -279,19 +303,7 @@ const PositronConnectionsItem = (props: React.PropsWithChildren<PositronConnecti
279303 style = { props . style }
280304 >
281305 < div className = 'nesting' style = { { width : `${ padding } px` } } > </ div >
282- {
283- props . item . expanded === undefined ?
284- < > </ > :
285- < div
286- className = 'expand-collapse-area'
287- onClick = { handleExpand }
288- >
289- < div
290- className = { `codicon codicon-chevron-${ props . item . expanded ? 'down' : 'right' } ` }
291- >
292- </ div >
293- </ div >
294- }
306+ { expandIcon }
295307 < div
296308 className = 'connections-details'
297309 onMouseDown = { rowMouseDownHandler }
0 commit comments