@@ -293,6 +293,7 @@ export default function Logs() {
293293 const shouldScrollIntoViewRef = useRef ( false )
294294 const logsRefetchRef = useRef < ( ) => void > ( ( ) => { } )
295295 const activeLogRefetchRef = useRef < ( ) => void > ( ( ) => { } )
296+ const activeLogTabRef = useRef < string > ( 'overview' )
296297 const logsQueryRef = useRef ( { isFetching : false , hasNextPage : false , fetchNextPage : ( ) => { } } )
297298 const [ isNotificationSettingsOpen , setIsNotificationSettingsOpen ] = useState ( false )
298299 const [ activeSort , setActiveSort ] = useState < {
@@ -473,6 +474,7 @@ export default function Logs() {
473474
474475 const handleCloseSidebar = useCallback ( ( ) => {
475476 dispatch ( { type : 'CLOSE_SIDEBAR' } )
477+ activeLogTabRef . current = 'overview'
476478 } , [ ] )
477479
478480 const handleLogContextMenu = useCallback (
@@ -700,6 +702,8 @@ export default function Logs() {
700702 const handleKeyDown = ( e : KeyboardEvent ) => {
701703 const tag = ( e . target as HTMLElement ) ?. tagName
702704 if ( tag === 'INPUT' || tag === 'TEXTAREA' ) return
705+ // When the trace tab is active, arrow keys belong to TraceView's span navigator.
706+ if ( activeLogTabRef . current === 'trace' ) return
703707 const currentLogs = logsRef . current
704708 const currentIndex = selectedLogIndexRef . current
705709 if ( currentLogs . length === 0 ) return
@@ -811,6 +815,9 @@ export default function Logs() {
811815 hasPrev = { selectedLogIndex > 0 }
812816 onRetryExecution = { handleRetrySidebarExecution }
813817 isRetryPending = { retryExecution . isPending }
818+ onActiveTabChange = { ( tab ) => {
819+ activeLogTabRef . current = tab
820+ } }
814821 />
815822 )
816823
0 commit comments