@@ -12,7 +12,7 @@ import TableRow from '@mui/material/TableRow';
1212import { Accordion , AccordionSummary , AccordionDetails , Typography , Box , TextField , CircularProgress , Tooltip } from '@mui/material' ;
1313import ExpandMoreIcon from '@mui/icons-material/ExpandMore' ;
1414import SearchIcon from '@mui/icons-material/Search' ;
15- import { useNavigate } from 'react-router-dom' ;
15+ import { useLocation , useNavigate } from 'react-router-dom' ;
1616import { useGlobalInfoStore } from "../../context/globalInfo" ;
1717import { getStoredRuns } from "../../api/storage" ;
1818import { RunSettings } from "./RunSettings" ;
@@ -85,6 +85,21 @@ export const RunsTable: React.FC<RunsTableProps> = ({
8585} ) => {
8686 const { t } = useTranslation ( ) ;
8787 const navigate = useNavigate ( ) ;
88+ const location = useLocation ( ) ;
89+
90+ const getUrlParams = ( ) => {
91+ const match = location . pathname . match ( / \/ r u n s \/ ( [ ^ \/ ] + ) (?: \/ r u n \/ ( [ ^ \/ ] + ) ) ? / ) ;
92+ return {
93+ robotMetaId : match ?. [ 1 ] || null ,
94+ urlRunId : match ?. [ 2 ] || null
95+ } ;
96+ } ;
97+
98+ const { robotMetaId : urlRobotMetaId , urlRunId } = getUrlParams ( ) ;
99+
100+ const isAccordionExpanded = useCallback ( ( currentRobotMetaId : string ) => {
101+ return currentRobotMetaId === urlRobotMetaId ;
102+ } , [ urlRobotMetaId ] ) ;
88103
89104 const [ accordionPage , setAccordionPage ] = useState ( 0 ) ;
90105 const [ accordionsPerPage , setAccordionsPerPage ] = useState ( 10 ) ;
@@ -314,10 +329,11 @@ export const RunsTable: React.FC<RunsTableProps> = ({
314329 key = { `row-${ row . id } ` }
315330 row = { row }
316331 handleDelete = { handleDelete }
317- isOpen = { runId === row . runId && runningRecordingName === row . name }
332+ isOpen = { urlRunId === row . runId || ( runId === row . runId && runningRecordingName === row . name ) }
318333 currentLog = { currentInterpretationLog }
319334 abortRunHandler = { abortRunHandler }
320335 runningRecordingName = { runningRecordingName }
336+ urlRunId = { urlRunId }
321337 />
322338 ) ) ;
323339 } , [ paginationStates , runId , runningRecordingName , currentInterpretationLog , abortRunHandler , handleDelete , accordionSortConfigs ] ) ;
0 commit comments