@@ -56,8 +56,6 @@ export type SidebarGroup<R extends SidebarRow> = {
5656
5757export type SidebarView < R extends SidebarRow > = {
5858 groups : SidebarGroup < R > [ ]
59- /** Open row keys in on-screen order; a collapsed group adds only its active row. Drives ⌘1–9 and next/previous. */
60- openKeys : string [ ]
6159}
6260
6361export const SIDEBAR_STATUSES : readonly SidebarStatus [ ] = [ "running" , "input" , "unread" , "failed" , "idle" ]
@@ -88,9 +86,7 @@ export function sidebarView<R extends SidebarRow>(rows: readonly R[], state: Sid
8886 ...( children . get ( row . key ) ?? [ ] ) . toSorted ( ( a , b ) => b . updated - a . updated || byKey ( a , b ) ) . flatMap ( withChildren ) ,
8987 ]
9088
91- const groups = buildGroups ( top , withChildren , state )
92-
93- return { groups, openKeys : groups . flatMap ( openKeys ) }
89+ return { groups : buildGroups ( top , withChildren , state ) }
9490}
9591
9692const ATTENTION : Record < SidebarStatus , number > = { input : 0 , failed : 1 , unread : 2 , running : 3 , idle : 4 }
@@ -210,16 +206,3 @@ function leaf<R extends SidebarRow>(
210206 children : undefined ,
211207 }
212208}
213-
214- // A collapsed group still shows its active row, so that row keeps its place in the order.
215- function openKeys < R extends SidebarRow > ( group : SidebarGroup < R > ) : string [ ] {
216- if ( group . collapsed ) {
217- const rows = group . children ? group . children . flatMap ( ( child ) => child . rows ) : group . rows
218-
219- return rows . filter ( ( row ) => row . open && row . active ) . map ( ( row ) => row . key )
220- }
221-
222- if ( group . children ) return group . children . flatMap ( openKeys )
223-
224- return group . rows . filter ( ( row ) => row . open ) . map ( ( row ) => row . key )
225- }
0 commit comments