@@ -94,7 +94,10 @@ export function renderSidebarCatalogViewMenu(params: {
9494 position : { x : number ; y : number } | null ;
9595 trigger : HTMLElement | null ;
9696 grouping : CatalogProjectGrouping ;
97+ creators : readonly SessionCreatorOption [ ] ;
98+ creatorFilterId : string | null ;
9799 onGroupingChange : ( grouping : CatalogProjectGrouping ) => void ;
100+ onCreatorFilterChange : ( creatorId : string | null ) => void ;
98101 onClose : ( restoreFocus : boolean ) => void ;
99102} ) {
100103 const position = params . position ;
@@ -103,6 +106,7 @@ export function renderSidebarCatalogViewMenu(params: {
103106 }
104107 const groupingOptions = [
105108 { grouping : "project" , label : t ( "chat.sidebar.catalogGroupByProject" ) } ,
109+ { grouping : "person" , label : t ( "chat.sidebar.catalogGroupByPerson" ) } ,
106110 { grouping : "none" , label : t ( "sessionsView.groupByNone" ) } ,
107111 ] as const satisfies ReadonlyArray < { grouping : CatalogProjectGrouping ; label : string } > ;
108112 return keyed (
@@ -120,6 +124,8 @@ export function renderSidebarCatalogViewMenu(params: {
120124 const value = event . detail . item . value ;
121125 if ( value ?. startsWith ( "grouping:" ) ) {
122126 params . onGroupingChange ( value . slice ( "grouping:" . length ) as CatalogProjectGrouping ) ;
127+ } else if ( value ?. startsWith ( "creator:" ) ) {
128+ params . onCreatorFilterChange ( value . slice ( "creator:" . length ) || null ) ;
123129 }
124130 } }
125131 @keydown=${ ( event : KeyboardEvent ) =>
@@ -154,6 +160,45 @@ export function renderSidebarCatalogViewMenu(params: {
154160 </ wa-dropdown-item >
155161 ` ,
156162 ) }
163+ ${ params . creators . length >= 2
164+ ? html `
165+ < div class ="session-menu__separator " role ="separator "> </ div >
166+ < div class ="sidebar-session-sort-menu__title "> ${ t ( "sessionsView.people" ) } </ div >
167+ < wa-dropdown-item
168+ class ="sidebar-session-sort-menu__item "
169+ value ="creator: "
170+ role ="menuitemradio "
171+ aria-checked =${ String ( params . creatorFilterId === null ) }
172+ ${ ref ( ( element ) =>
173+ syncDropdownItemRadio ( element , params . creatorFilterId === null ) ,
174+ ) }
175+ >
176+ < span slot ="details " class ="session-menu__check " aria-hidden ="true "
177+ > ${ params . creatorFilterId === null ? icons . check : nothing } </ span
178+ >
179+ < span class ="session-menu__text "> ${ t ( "sessionsView.allCreators" ) } </ span >
180+ </ wa-dropdown-item >
181+ ${ params . creators . map (
182+ ( creator ) => html `
183+ < wa-dropdown-item
184+ class ="sidebar-session-sort-menu__item "
185+ value =${ `creator:${ creator . id } ` }
186+ role ="menuitemradio"
187+ aria-checked=${ String ( params . creatorFilterId === creator . id ) }
188+ ${ ref ( ( element ) =>
189+ syncDropdownItemRadio ( element , params . creatorFilterId === creator . id ) ,
190+ ) }
191+ >
192+ < span slot ="details " class ="session-menu__check " aria-hidden ="true "
193+ > ${ params . creatorFilterId === creator . id ? icons . check : nothing } </ span
194+ >
195+ ${ renderSessionOwnerChip ( creator , "row" ) }
196+ < span class ="session-menu__text "> ${ creator . label ?? creator . id } </ span >
197+ </ wa-dropdown-item >
198+ ` ,
199+ ) }
200+ `
201+ : nothing }
157202 </ wa-dropdown >
158203 </ openclaw-menu-surface >
159204 ` ,
0 commit comments