File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.logs Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,10 @@ function LogsList({
322322 const [ nextCursor , setNextCursor ] = useState < string | undefined > ( list . pagination . next ) ;
323323
324324 // Selected log state - managed locally to avoid triggering navigation
325- const [ selectedLogId , setSelectedLogId ] = useState < string | undefined > ( ) ;
325+ const [ selectedLogId , setSelectedLogId ] = useState < string | undefined > ( ( ) => {
326+ const params = new URLSearchParams ( location . search ) ;
327+ return params . get ( "log" ) ?? undefined ;
328+ } ) ;
326329
327330 // Track which filter state (search params) the current fetcher request corresponds to
328331 const fetcherFilterStateRef = useRef < string > ( location . search ) ;
@@ -333,8 +336,9 @@ function LogsList({
333336 useEffect ( ( ) => {
334337 setAccumulatedLogs ( [ ] ) ;
335338 setNextCursor ( undefined ) ;
336- // Close side panel when filters change to avoid showing a log that's no longer visible
337- setSelectedLogId ( undefined ) ;
339+ // Preserve log selection from URL param, clear if not present
340+ const params = new URLSearchParams ( location . search ) ;
341+ setSelectedLogId ( params . get ( "log" ) ?? undefined ) ;
338342 } , [ location . search ] ) ;
339343
340344 // Populate accumulated logs when new data arrives
You can’t perform that action at this time.
0 commit comments