@@ -1002,6 +1002,51 @@ export default function Dashboard() {
10021002 const totalRate =
10031003 totalExecutions > 0 ? ( totalSuccess / totalExecutions ) * 100 : 100
10041004
1005+ // Calculate overall time range across all selected workflows
1006+ let multiWorkflowTimeRange : { start : Date ; end : Date } | null = null
1007+ if ( sortedIndices . length > 0 ) {
1008+ const firstIdx = sortedIndices [ 0 ]
1009+ const lastIdx = sortedIndices [ sortedIndices . length - 1 ]
1010+
1011+ // Find earliest start time
1012+ let earliestStart : Date | null = null
1013+ for ( const wfId of selectedWorkflowIds ) {
1014+ const wf = executions . find ( ( w ) => w . workflowId === wfId )
1015+ const segment = wf ?. segments [ firstIdx ]
1016+ if ( segment ) {
1017+ const start = new Date ( segment . timestamp )
1018+ if ( ! earliestStart || start < earliestStart ) {
1019+ earliestStart = start
1020+ }
1021+ }
1022+ }
1023+
1024+ // Find latest end time
1025+ let latestEnd : Date | null = null
1026+ for ( const wfId of selectedWorkflowIds ) {
1027+ const wf = executions . find ( ( w ) => w . workflowId === wfId )
1028+ const segment = wf ?. segments [ lastIdx ]
1029+ if ( segment ) {
1030+ const end = new Date ( new Date ( segment . timestamp ) . getTime ( ) + segMs )
1031+ if ( ! latestEnd || end > latestEnd ) {
1032+ latestEnd = end
1033+ }
1034+ }
1035+ }
1036+
1037+ if ( earliestStart && latestEnd ) {
1038+ multiWorkflowTimeRange = {
1039+ start : earliestStart ,
1040+ end : latestEnd ,
1041+ }
1042+ }
1043+ }
1044+
1045+ // Get workflow names
1046+ const workflowNames = selectedWorkflowIds
1047+ . map ( ( id ) => executions . find ( ( w ) => w . workflowId === id ) ?. workflowName )
1048+ . filter ( Boolean ) as string [ ]
1049+
10051050 return (
10061051 < WorkflowDetails
10071052 workspaceId = { workspaceId }
@@ -1022,10 +1067,11 @@ export default function Dashboard() {
10221067 allLogs : allLogs ,
10231068 } as any
10241069 }
1025- selectedSegmentIndex = { [ ] }
1070+ selectedSegmentIndex = { sortedIndices }
10261071 selectedSegment = { null }
1027- selectedSegmentTimeRange = { null }
1028- segmentDurationMs = { undefined }
1072+ selectedSegmentTimeRange = { multiWorkflowTimeRange }
1073+ selectedWorkflowNames = { workflowNames }
1074+ segmentDurationMs = { segMs }
10291075 clearSegmentSelection = { ( ) => {
10301076 setSelectedSegments ( { } )
10311077 setLastAnchorIndices ( { } )
@@ -1207,6 +1253,7 @@ export default function Dashboard() {
12071253 : null
12081254 }
12091255 selectedSegmentTimeRange = { timeRange }
1256+ selectedWorkflowNames = { undefined }
12101257 segmentDurationMs = { segMs }
12111258 clearSegmentSelection = { ( ) => {
12121259 setSelectedSegments ( { } )
@@ -1242,6 +1289,7 @@ export default function Dashboard() {
12421289 selectedSegmentIndex = { [ ] }
12431290 selectedSegment = { null }
12441291 selectedSegmentTimeRange = { null }
1292+ selectedWorkflowNames = { undefined }
12451293 segmentDurationMs = { undefined }
12461294 clearSegmentSelection = { ( ) => {
12471295 setSelectedSegments ( { } )
0 commit comments