File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,19 +244,19 @@ export abstract class AppSidebarSessionNavigationElement extends AppSidebarSessi
244244 ) ;
245245 const visibleRows = limitSidebarSessionRows ( expandedRows , this . visibleSessionLimit ) ;
246246 const keep = new Set ( visibleRows . map ( ( row ) => row . key ) ) ;
247- return {
248- // totalRowCount is the pre-pagination size: headers and empty-zone
249- // checks must not mistake a page-filtered section for an empty one.
250- sections : sections . map ( ( section ) => ( {
251- ... section ,
252- totalRowCount : section . rows . length ,
253- rows : this . isSessionSectionCollapsed ( section . id )
254- ? section . rows
255- : section . rows . filter ( ( row ) => keep . has ( row . key ) ) ,
256- } ) ) ,
257- expandedRows ,
258- visibleRows ,
259- } ;
247+ // totalRowCount is the pre-pagination size: headers and empty-zone
248+ // checks must not mistake a page-filtered section for an empty one.
249+ const limitedSections : ( SidebarSessionSection < SidebarRecentSession > & {
250+ totalRowCount : number ;
251+ } ) [ ] = [ ] ;
252+ for ( const section of sections ) {
253+ const totalRowCount = section . rows . length ;
254+ if ( ! this . isSessionSectionCollapsed ( section . id ) ) {
255+ section . rows = section . rows . filter ( ( row ) => keep . has ( row . key ) ) ;
256+ }
257+ limitedSections . push ( Object . assign ( section , { totalRowCount } ) ) ;
258+ }
259+ return { sections : limitedSections , expandedRows , visibleRows } ;
260260 }
261261
262262 /** Rows in on-screen order; shift ranges and batch actions share this ordering. */
Original file line number Diff line number Diff line change 11import { describe , expect , it } from "vitest" ;
22import {
3- channelDisplayLabel ,
43 resolveChannelSessionInfo ,
54 resolveSessionDisplayName ,
65 resolveSessionWorkSubtitle ,
@@ -132,11 +131,3 @@ describe("resolveChannelSessionInfo", () => {
132131 } ) ;
133132 } ) ;
134133} ) ;
135-
136- describe ( "channelDisplayLabel" , ( ) => {
137- it ( "uses friendly names for known channels and capitalizes the rest" , ( ) => {
138- expect ( channelDisplayLabel ( "imessage" ) ) . toBe ( "iMessage" ) ;
139- expect ( channelDisplayLabel ( "telegram" ) ) . toBe ( "Telegram" ) ;
140- expect ( channelDisplayLabel ( "mattermost" ) ) . toBe ( "Mattermost" ) ;
141- } ) ;
142- } ) ;
Original file line number Diff line number Diff line change @@ -15,12 +15,6 @@ const CHANNEL_LABELS: Record<string, string> = {
1515
1616const KNOWN_CHANNEL_KEYS = Object . keys ( CHANNEL_LABELS ) ;
1717
18- /** Human channel label for group headers and name fallbacks. */
19- export function channelDisplayLabel ( channel : string ) : string {
20- const normalized = normalizeLowercaseStringOrEmpty ( channel ) ;
21- return CHANNEL_LABELS [ normalized ] ?? capitalize ( normalized || channel ) ;
22- }
23-
2418/** Raw peer ids stay out of the sidebar; keep a short recognizable tail only. */
2519function shortenPeerId ( identifier : string ) : string {
2620 const trimmed = identifier . trim ( ) ;
Original file line number Diff line number Diff line change @@ -139,7 +139,15 @@ describe("normalizeSidebarSessionsGrouping", () => {
139139 } ) ;
140140} ) ;
141141
142- function row ( overrides : Partial < GatewaySessionRow > & { key : string } ) : GatewaySessionRow {
142+ type ZoneRowExtras = {
143+ workSession ?: boolean ;
144+ acpSession ?: boolean ;
145+ channelSession ?: boolean ;
146+ } ;
147+
148+ function row (
149+ overrides : Partial < GatewaySessionRow > & ZoneRowExtras & { key : string } ,
150+ ) : GatewaySessionRow & ZoneRowExtras {
143151 return {
144152 kind : "direct" ,
145153 updatedAt : null ,
You can’t perform that action at this time.
0 commit comments