Skip to content

feat(usage): add Today's Sessions tab to Usage Analysis#889

Merged
rajbos merged 8 commits into
mainfrom
rajbos/daily-sessions-overview-tab
May 15, 2026
Merged

feat(usage): add Today's Sessions tab to Usage Analysis#889
rajbos merged 8 commits into
mainfrom
rajbos/daily-sessions-overview-tab

Conversation

@rajbos
Copy link
Copy Markdown
Owner

@rajbos rajbos commented May 15, 2026

Summary

Adds a new "📋 Today's Sessions" subtab to the Usage Analysis page that shows a per-session breakdown for today's activity.

What it shows

Each row in the table displays:

Column Description
Title Session title (or "Untitled session")
Turns Number of interactions/turns
Tools Total tool calls
Input Input tokens
Output Output tokens
Thinking Thinking/reasoning tokens
Cached Cached input tokens
Total Total tokens (actual if available, estimated otherwise)
Cost Estimated cost from model pricing
Editor Editor source (VS Code, CLI, etc.)
Models Models used in the session
Last Active Time of last activity

Sessions are sorted by interaction count (most active first).

Changes

  • vscode-extension/src/types.ts — Added TodaySessionSummary interface and todaySessions field to UsageAnalysisStats
  • vscode-extension/src/extension.ts — Collects per-session summaries during calculateUsageAnalysisStats() for today's sessions and passes them to the webview
  • vscode-extension/src/webview/usage/main.ts — New tab button, tab panel with table rendering, sanitization of the new data field

Testing

  • npm run compile passes (TypeScript + ESLint)
  • ✅ All unit tests pass (npm run test:node)

rajbos and others added 8 commits May 15, 2026 14:22
Add a new subtab on the Usage Analysis page that shows a per-session
breakdown for today. Each row displays:
- Title, interactions, tool calls
- Token breakdown (input, output, thinking, cached, total)
- Estimated cost, editor source, models used, last activity time

Sessions are sorted by interaction count (most active first).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace toLocaleTimeString() with toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
so the time respects the user's system locale (e.g. HH:mm for 24h users) instead of
defaulting to the en-US AM/PM format in the VS Code webview context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1. Wire up setupSessionsTableSort() after renderLayout() in both bootstrap
   and update handler so clicking column headers actually sorts.
2. Force hour12:false in toLocaleTimeString() to guarantee HH:mm format
   regardless of the webview's default en-US locale.
3. Extract thinking tokens from CLI JSONL assistant.message events via
   event.data.reasoningText (and JetBrains event.data.thinking.text),
   fixing the 0-value thinking column for all CLI sessions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds aiEngineeringFluency.display.use24HourTime (default: true) to control
whether times are shown in 24-hour (14:30) or 12-hour AM/PM format (2:30 PM).
Follows the same pattern as display.compactNumbers — passed via initial data
to the usage analysis webview and respected by the Today's Sessions table.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…odel_change detection

- Change default model from 'gpt-4o' to 'unknown' across all detection paths
  (extension.ts, usageAnalysis.ts, sessionParser.ts, syncService.ts)
- Add session.model_change event handling for CLI sessions in all paths
- Add per-event model from assistant.message.data.model for accurate per-turn attribution
- Fix delta-based JSONL callback override logic to respect authoritative per-request modelId
- Update tests to expect 'unknown' default instead of 'gpt-4o'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Click a session title in the Today's Sessions table to open it in the
log viewer. Adds filePath to TodaySessionSummary and handles the
openSessionFile message in the usage analysis panel.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rajbos rajbos merged commit 2470ceb into main May 15, 2026
18 of 19 checks passed
@rajbos rajbos deleted the rajbos/daily-sessions-overview-tab branch May 15, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant