@@ -21,7 +21,7 @@ import { useEnvironment } from "~/hooks/useEnvironment";
2121import { useOrganization } from "~/hooks/useOrganizations" ;
2222import { useProject } from "~/hooks/useProject" ;
2323import type { LogEntry } from "~/presenters/v3/LogsListPresenter.server" ;
24- import { getLevelColor , getKindColor , getKindLabel } from "~/utils/logUtils" ;
24+ import { getLevelColor } from "~/utils/logUtils" ;
2525import { v3RunSpanPath , v3RunsPath , v3DeploymentVersionPath } from "~/utils/pathBuilder" ;
2626import type { loader as logDetailLoader } from "~/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.logs.$logId" ;
2727import { TaskRunStatusCombo , descriptionForTaskRunStatus } from "~/components/runs/v3/TaskRunStatus" ;
@@ -94,16 +94,34 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
9494 const isLoading = fetcher . state === "loading" ;
9595 const log = fetcher . data ?? initialLog ;
9696
97- // Handle Escape key to close panel
97+ const runPath = v3RunSpanPath (
98+ organization ,
99+ project ,
100+ environment ,
101+ { friendlyId : log ?. runId ?? "" } ,
102+ { spanId : log ?. spanId ?? "" }
103+ ) ;
104+
105+ // Handle keyboard shortcuts
98106 useEffect ( ( ) => {
99107 const handleKeyDown = ( e : KeyboardEvent ) => {
108+ const target = e . target as HTMLElement ;
109+ if ( target && (
110+ target . tagName === "INPUT" ||
111+ target . tagName === "TEXTAREA" ||
112+ target . tagName === "SELECT" ||
113+ target . contentEditable === "true"
114+ ) ) {
115+ return ;
116+ }
117+
100118 if ( e . key === "Escape" ) {
101119 onClose ( ) ;
102120 }
103121 } ;
104122 window . addEventListener ( "keydown" , handleKeyDown ) ;
105123 return ( ) => window . removeEventListener ( "keydown" , handleKeyDown ) ;
106- } , [ onClose ] ) ;
124+ } , [ onClose , log , runPath , isLoading ] ) ;
107125
108126 if ( isLoading && ! log ) {
109127 return (
@@ -129,36 +147,18 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
129147 ) ;
130148 }
131149
132- const runPath = v3RunSpanPath (
133- organization ,
134- project ,
135- environment ,
136- { friendlyId : log . runId } ,
137- { spanId : log . spanId }
138- ) ;
139-
140150 return (
141151 < div className = "flex h-full flex-col overflow-hidden" >
142152 { /* Header */ }
143- < div className = "flex items-center justify-between border-b border-grid-dimmed px-4 py-3" >
144- < div className = "flex items-center gap-2" >
145- < span
146- className = { cn (
147- "inline-flex items-center rounded border px-1.5 py-0.5 text-xs font-medium" ,
148- getKindColor ( log . kind )
149- ) }
150- >
151- { getKindLabel ( log . kind ) }
152- </ span >
153- < span
154- className = { cn (
155- "inline-flex items-center rounded border px-1.5 py-0.5 text-xs font-medium uppercase" ,
156- getLevelColor ( log . level )
157- ) }
158- >
159- { log . level }
160- </ span >
161- </ div >
153+ < div className = "flex items-center justify-between border-b border-grid-dimmed px-2 py-2" >
154+ < span
155+ className = { cn (
156+ "inline-flex items-center rounded border px-1.5 py-0.5 text-xs font-medium uppercase tracking-wider" ,
157+ getLevelColor ( log . level )
158+ ) }
159+ >
160+ { log . level }
161+ </ span >
162162 < Button variant = "minimal/small" onClick = { onClose } shortcut = { { key : "esc" } } >
163163 < XMarkIcon className = "size-5" />
164164 </ Button >
@@ -185,8 +185,8 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
185185 </ TabButton >
186186 </ TabContainer >
187187 < Link to = { runPath } target = "_blank" rel = "noopener noreferrer" >
188- < Button variant = "secondary /small" LeadingIcon = { ArrowTopRightOnSquareIcon } >
189- View Full Run
188+ < Button variant = "minimal /small" LeadingIcon = { ArrowTopRightOnSquareIcon } shortcut = { { key : "v" } } >
189+ View full run
190190 </ Button >
191191 </ Link >
192192 </ div >
0 commit comments