fix: session count label distinguishes visible vs total

Show "X visible (Y total)" when the history list is filtered or limited,
and "X sessions total" only when every session is actually displayed.

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-23 10:41:38 -04:00
parent 3b18034d11
commit 85c06ff258
2 changed files with 9 additions and 1 deletions

View File

@@ -67,7 +67,10 @@ router.get('/', (req, res) => {
return { ...session, has_notes, notes_preview };
});
const absoluteTotal = db.prepare('SELECT COUNT(*) as total FROM sessions').get();
res.set('X-Total-Count', String(countRow.total));
res.set('X-Absolute-Total', String(absoluteTotal.total));
res.json(result);
} catch (error) {
res.status(500).json({ error: error.message });