File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
renderer/src/features/mcp-servers/components Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -167,14 +167,27 @@ export function CardMcpServer({
167167 const isTransitioning =
168168 status === 'starting' || status === 'stopping' || status === 'restarting'
169169 const isStopped = status === 'stopped' || status === 'stopping'
170+ const [ hadRecentStatusChange , setHadRecentStatusChange ] = useState ( false )
171+ const [ prevStatus , setPrevStatus ] =
172+ useState < WorkloadsWorkload [ 'status' ] > ( status )
173+
174+ useEffect ( ( ) => {
175+ // show a brief animation for status transitions that are immediate
176+ if ( prevStatus !== status && [ 'running' ] . includes ( status ?? '' ) ) {
177+ setHadRecentStatusChange ( true )
178+ const timeout = setTimeout ( ( ) => setHadRecentStatusChange ( false ) , 2500 )
179+ return ( ) => clearTimeout ( timeout )
180+ }
181+ setPrevStatus ( status )
182+ } , [ status , prevStatus ] )
170183
171184 return (
172185 < Card
173186 className = { twMerge (
174187 'transition-all duration-300 ease-in-out' ,
175188 isNewServer ? 'ring-2' : undefined ,
176189 isDeleting ? 'pointer-events-none opacity-50' : undefined ,
177- isTransitioning && 'animate-diagonal-ring' ,
190+ ( isTransitioning || hadRecentStatusChange ) && 'animate-diagonal-ring' ,
178191 isStopped && 'bg-card/65'
179192 ) }
180193 >
You can’t perform that action at this time.
0 commit comments