@@ -277,8 +277,8 @@ export default function Logs({ apiBase }: { apiBase: string }) {
277277 else if ( e . key === "ArrowRight" || e . key === "End" ) { e . preventDefault ( ) ; selectTab ( "debug" ) ; document . getElementById ( "logs-tab-debug" ) ?. focus ( ) ; }
278278 } ;
279279
280- const fetchLogs = useCallback ( async ( ) => {
281- setLoading ( true ) ;
280+ const fetchLogs = useCallback ( async ( opts ?: { silent ?: boolean } ) => {
281+ if ( ! opts ?. silent ) setLoading ( true ) ;
282282 setError ( null ) ;
283283 try {
284284 const res = await fetch ( `${ apiBase } /api/logs` ) ;
@@ -288,15 +288,15 @@ export default function Logs({ apiBase }: { apiBase: string }) {
288288 const detail = cause instanceof Error ? cause . message : "" ;
289289 setError ( detail ? `${ t ( "logs.loadError" ) } ${ detail } ` : t ( "logs.loadError" ) ) ;
290290 } finally {
291- setLoading ( false ) ;
291+ if ( ! opts ?. silent ) setLoading ( false ) ;
292292 }
293293 } , [ apiBase , t ] ) ;
294294
295295 useEffect ( ( ) => {
296296 if ( tab !== "logs" ) return ;
297297 void fetchLogs ( ) ;
298298 if ( ! autoRefresh ) return ;
299- const interval = setInterval ( ( ) => void fetchLogs ( ) , 2000 ) ;
299+ const interval = setInterval ( ( ) => void fetchLogs ( { silent : true } ) , 2000 ) ;
300300 return ( ) => clearInterval ( interval ) ;
301301 } , [ autoRefresh , fetchLogs , tab ] ) ;
302302
@@ -402,7 +402,6 @@ export default function Logs({ apiBase }: { apiBase: string }) {
402402 < EmptyState title = { t ( "logs.noRequests" ) } />
403403 ) : (
404404 < >
405- { loading && < div className = "row muted" role = "status" > < span className = "spin" /> { t ( "common.loading" ) } </ div > }
406405 < div ref = { scrollContainerRef } className = "tbl-wrap" style = { { overflowY : "auto" , maxHeight : "calc(100vh - 260px)" } } >
407406 < table className = "tbl logs-table" >
408407 < thead style = { { position : "sticky" , top : 0 , zIndex : 1 , background : "var(--surface)" } } >
0 commit comments