@@ -133,40 +133,6 @@ export function getStatusCounts(state: DelegationTreeState): {
133133 return { running, waiting }
134134}
135135
136- /** Flatten tree without pruning - shows all nodes including completed/error. For log viewer. */
137- export function flattenTreeAll ( state : DelegationTreeState ) : FlatTreeNode [ ] {
138- const result : FlatTreeNode [ ] = [ ]
139- const visited = new Set < string > ( )
140-
141- function dfs ( nodeId : string , depth : number , isLast : boolean , ancestorIsLast : boolean [ ] ) {
142- const node = state . nodes . get ( nodeId )
143- if ( ! node || visited . has ( nodeId ) ) return
144-
145- visited . add ( nodeId )
146- result . push ( { node, depth, isLast, ancestorIsLast : [ ...ancestorIsLast ] } )
147-
148- const children = node . childRunIds
149- for ( let i = 0 ; i < children . length ; i ++ ) {
150- const childIsLast = i === children . length - 1
151- dfs ( children [ i ] ! , depth + 1 , childIsLast , [ ...ancestorIsLast , isLast ] )
152- }
153- }
154-
155- if ( state . rootRunId ) {
156- dfs ( state . rootRunId , 0 , true , [ ] )
157- }
158-
159- // Show orphaned nodes (no parent in tree) at root level
160- for ( const [ nodeId , node ] of state . nodes ) {
161- if ( ! visited . has ( nodeId ) ) {
162- visited . add ( nodeId )
163- result . push ( { node, depth : 0 , isLast : true , ancestorIsLast : [ ] } )
164- }
165- }
166-
167- return result
168- }
169-
170136export function flattenTree ( state : DelegationTreeState ) : FlatTreeNode [ ] {
171137 if ( ! state . rootRunId ) return [ ]
172138 const root = state . nodes . get ( state . rootRunId )
0 commit comments