diff --git a/ui/src/components/logs/logs-row.tsx b/ui/src/components/logs/logs-row.tsx index 629eb66d..5e9d0822 100644 --- a/ui/src/components/logs/logs-row.tsx +++ b/ui/src/components/logs/logs-row.tsx @@ -1,4 +1,4 @@ -import { memo, useState } from 'react'; +import { memo, useState, type KeyboardEvent } from 'react'; import { Copy } from 'lucide-react'; import type { LogsEntry } from '@/lib/api-client'; import { cn } from '@/lib/utils'; @@ -54,6 +54,14 @@ function LogsRowImpl({ const latencyLabel = getDisplayLatency(entry); const shortRequestId = getDisplayRequestId(entry, { short: true }); + const handleSelect = () => onSelect(entry.id); + const handleKey = (e: KeyboardEvent) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + handleSelect(); + } + }; + const handleCopyRequestId = async (e: React.MouseEvent) => { e.stopPropagation(); if (!entry.requestId) return; @@ -62,16 +70,20 @@ function LogsRowImpl({ window.setTimeout(() => setJustCopied(false), 1200); }; + // Row is a focusable div (not a button) so it can host a real ) : null} - + ); }