Skip to content

Commit 5c5c5ca

Browse files
committed
Show total session count in session browser dialog title
Display filtered/total count (e.g. "3/10") when a search query or star filter is active, so the count always matches what the user sees. Assisted-By: docker-agent
1 parent f96edc1 commit 5c5c5ca

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

pkg/tui/dialog/session_browser.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package dialog
33
import (
44
"fmt"
55
"slices"
6+
"strconv"
67
"strings"
78
"time"
89

@@ -314,13 +315,20 @@ func (d *sessionBrowserDialog) View() string {
314315
scrollableContent = d.scrollview.View()
315316
}
316317

317-
// Build title with filter indicator
318-
title := "Sessions"
318+
// Build title with session count and optional star-filter indicator.
319+
// Show "filtered/total" when a search or star filter reduces the list.
320+
var countLabel string
321+
if len(d.filtered) == len(d.sessions) {
322+
countLabel = strconv.Itoa(len(d.sessions))
323+
} else {
324+
countLabel = fmt.Sprintf("%d/%d", len(d.filtered), len(d.sessions))
325+
}
326+
title := fmt.Sprintf("Sessions (%s)", countLabel)
319327
switch d.starFilter {
320328
case 1:
321-
title = "Sessions " + styles.StarredStyle.Render("★")
329+
title += " " + styles.StarredStyle.Render("★")
322330
case 2:
323-
title = "Sessions " + styles.UnstarredStyle.Render("☆")
331+
title += " " + styles.UnstarredStyle.Render("☆")
324332
}
325333

326334
var filterDesc string

0 commit comments

Comments
 (0)