Commit graph

194 commits

Author SHA1 Message Date
Paul Holstein
ec9b3412fa refactor: wire session analyzer and CostSection to shared pricing
Replace the hardcoded MODEL_PRICING table and costUsd() function in
sessionAnalyzer.ts with calculateMessageCost() and getDisplayPricing()
from the shared pricing module. Re-export getDisplayPricing as getPricing
for backward compat with CostSection. Replace the ModelPricing interface
with a type re-export of DisplayPricing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:10:42 -05:00
Paul Holstein
3e6d02f317 refactor: wire jsonl.ts to shared pricing module
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:00:15 -05:00
Paul Holstein
9dd41b3345 feat: add shared pricing module with LiteLLM data
Create a unified pricing module in src/shared/utils/ that wraps
resources/pricing.json with typed lookup, tiered cost calculation,
and display pricing helpers. This is the foundation for consolidating
the dual cost calculation systems (main jsonl.ts + renderer sessionAnalyzer).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:51:18 -05:00
Paul Holstein
da81aaa26a docs: add implementation plan for unified cost calculation
5 tasks: shared pricing module, wire jsonl.ts, wire sessionAnalyzer,
verify, and clean up. TDD approach with tests first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:45:53 -05:00
Paul Holstein
ec42e92bb3 docs: add design doc for unified cost calculation
Shared pricing module replacing dual cost calculation systems
(jsonl.ts hardcoded + sessionAnalyzer.ts LiteLLM) with a single
src/shared/utils/pricing.ts used by both main and renderer processes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:43:35 -05:00
matt
3749d7e41a
Merge pull request #71 from matt1398/feat/tabbar-more-menu
feat: add MoreMenu component for toolbar actions
2026-02-23 22:52:18 +08:00
matt
1535a69ca5 feat: add MoreMenu component for toolbar actions
- Introduced MoreMenu component to consolidate less-frequent actions (Search, Export, Analyze, Settings) behind a dropdown menu.
- Removed individual action buttons from TabBar for a cleaner interface.
- Implemented functionality to close the menu on outside clicks and Escape key press.
2026-02-23 22:44:42 +08:00
matt
6264ec52bf
Merge pull request #60 from holstein13/feat/session-analysis-report
feat: session analysis report with assessment badges
2026-02-23 22:28:03 +08:00
matt
02940ce216 merge: resolve conflict in TabBar.tsx — keep both Activity icon and formatShortcut import
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:14:01 +08:00
matt
58c979fa98
Merge pull request #65 from KaustubhPatange/main
feat: add cost calculation metric
2026-02-23 22:09:41 +08:00
matt
9629c0a530
Merge pull request #69 from proxikal/fix/window-drag-region
fix: reliable window drag region in tab bar
2026-02-23 21:59:46 +08:00
matt
a95f10757f
Merge pull request #67 from Psypeal/fix/notification-crash
fix: guard Notification.isSupported for standalone/Docker (#42)
2026-02-23 21:58:55 +08:00
matt
c4975f1874
Merge pull request #66 from Psypeal/fix/ctrl-r-shortcut
fix: prevent Ctrl+R page reload and show platform-aware shortcuts (#58)
2026-02-23 21:58:34 +08:00
matt
dc38c79c23
Merge pull request #59 from proxikal/feat/auto-expand-ai-groups-setting
feat: add auto-expand AI response groups setting
2026-02-23 21:56:59 +08:00
proxy
dbdfc27526 refactor: address code review findings from Gemini Code Assist
- Extract SCROLL_THRESHOLD (300px) constant so auto-scroll hook and
  scroll-button visibility logic stay in sync
- Extract CONTEXT_PANEL_WIDTH_PX (320px) constant to avoid layout drift
  if the context panel width is ever adjusted
- Gate drag spacer on isElectronMode() && isLeftmostPane to match the
  TabBar drag region logic and prevent unintended drag regions in
  split-pane layouts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 19:47:17 -05:00
proxy
93b515af40 feat: add auto-expand AI response groups setting
- Add toggle in settings to auto-expand AI response groups
- Auto-expand new AI groups on live session refresh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 19:13:28 -05:00
proxy
890d2d8e84 fix: reliable window drag region in tab bar
Includes scroll improvements:
- Scroll to bottom on session open and live auto-scroll
- Make auto-scroll StrictMode-safe via needsInitialScrollRef
- Add floating scroll-to-bottom button in chat view

Window drag fix:
- Apply drag region to leftmost pane TabBar regardless of sidebar state
- Cap tab list at 75% so drag spacer always has room
- Add explicit flex-1 drag spacer between tabs and action buttons
- Set WebkitAppRegion: no-drag on tab items for reordering

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 19:13:14 -05:00
Paul Holstein
819d553dd0 fix(report): avoid ÷ 0 phrasing when no commits or lines changed
Show "no commits" / "no lines changed" instead of "total cost ÷ 0"
when commitCount or linesChanged is zero.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 15:47:17 -05:00
Paul Holstein
6cd2845edb fix(report): recompute token totals after subagent row, fix import order
- Recompute totalInputTokens, totalOutputTokens, totalCacheCreation,
  totalCacheRead, and grandTotal after injecting the "Subagents (combined)"
  row so tokenUsage.totals stays consistent with byModel rows
- Fix CostSection import order: external packages before path aliases,
  merge duplicate import type statements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 15:13:53 -05:00
Paul Holstein
bbd6441b9e fix(report): compute subagent costs, filter synthetic model, fix test parsing
- Compute subagent cost from token breakdown instead of relying on
  unpopulated proc.metrics.costUsd; extract actual model from subagent
  messages for accurate pricing and mismatch detection
- Add aggregated "Subagents (combined)" row to cost table with arrow
  navigation to the Subagents report section (no misleading breakdown)
- Filter <synthetic> model from token/cost tracking to eliminate zero rows
- Fix parseTestSummary to treat missing pass/fail count as 0 so clean
  all-passing test runs are not dropped from trajectory analysis

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:56:57 -05:00
Psypeal Gwai
258dc6d82f fix: prevent Ctrl+R page reload and show platform-aware shortcuts (#58)
Intercept Ctrl+R/Cmd+R in before-input-event to prevent Electron's default page reload. Replace hardcoded macOS shortcut symbols with platform-aware helpers that show Ctrl+ on Windows/Linux.
2026-02-22 06:05:44 -08:00
Paul Holstein
114ea36df9 fix(report): guard against empty tool call IDs in session analyzer
Skip indexing and lookup when tool call/result IDs are missing to
prevent collisions on the empty-string key in toolCallIndex.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 08:49:19 -05:00
Paul Holstein
586cb00174 fix(report): address CodeRabbit review — pricing match, sidechain filter, UX guards
- getPricing: use tokenized order-insensitive matching so Claude 3 era
  models (e.g. "claude-3-opus-20240229") correctly match pricing key "opus-3"
- sessionAnalyzer: skip isSidechain messages in parentCost loop to prevent
  double-counting with processSubagentCost
- CostSection: disable row expansion when token stats are missing
- tabSlice: guard against undefined sessionId/projectId in openSessionReport

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 08:43:33 -05:00
Psypeal Gwai
a7d7bacf3b fix: guard Notification.isSupported for standalone/Docker (#42)
Add typeof checks before calling Notification.isSupported() to prevent crashes in environments where the Notification API is unavailable.
2026-02-22 05:40:39 -08:00
Paul Holstein
4fda90bc3e feat(report): address PR feedback — threshold tooltips, cost clarity, progressive disclosure
- Add AssessmentBadge component with hover tooltips explaining thresholds
- Add Key Takeaways summary section surfacing top actionable findings
- Add cost attribution stacked bar and per-token calculation breakdowns
- Add clickable navigation from takeaways and tool errors to detail sections
- Add theme-aware assessment colors via CSS variables for light/dark mode
- Collapse lower-priority sections by default for progressive disclosure
- Replace all hardcoded color hex values with CSS variable references
- Fix missing Fragment key in CostSection model table
- Add defensive division-by-zero guard in stacked bar calculation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 08:29:08 -05:00
matt
9c04e90fdd
Merge pull request #57 from proxikal/fix/settings-http-server-status-ipc
fix: wrap HTTP_SERVER_GET_STATUS response in IpcResult envelope
2026-02-22 19:50:05 +09:00
KaustubhPatange
5932009c3b fix: lint issues 2026-02-22 16:14:05 +05:30
matt
94a6599acc
Merge pull request #55 from proxikal/fix/perf-regression-agent-configs-and-search-stat
fix: resolve performance regression in transcript loading and session search
2026-02-22 19:32:13 +09:00
matt
40a467666f
Merge pull request #56 from proxikal/feat/sidebar-auto-open-on-project-select
fix: auto-expand sidebar when a project is selected
2026-02-22 19:31:37 +09:00
matt
39916f47bc
Merge pull request #64 from matt1398/dependabot/npm_and_yarn/npm_and_yarn-c59ac7ae80
chore(deps): bump the npm_and_yarn group across 1 directory with 4 updates
2026-02-22 19:28:00 +09:00
KaustubhPatange
723760938e feat: add session cost in session header 2026-02-22 15:44:04 +05:30
KaustubhPatange
2bb95db596 feat: add tests for cost calculation 2026-02-22 14:49:30 +05:30
KaustubhPatange
a039fdd573 feat: add cost calculation metric 2026-02-22 14:39:20 +05:30
dependabot[bot]
2111272de8
chore(deps): bump the npm_and_yarn group across 1 directory with 4 updates
Bumps the npm_and_yarn group with 4 updates in the / directory: [happy-dom](https://github.com/capricorn86/happy-dom), @isaacs/brace-expansion, [ajv](https://github.com/ajv-validator/ajv) and [minimatch](https://github.com/isaacs/minimatch).


Updates `happy-dom` from 17.6.3 to 20.0.2
- [Release notes](https://github.com/capricorn86/happy-dom/releases)
- [Commits](https://github.com/capricorn86/happy-dom/compare/v17.6.3...v20.0.2)

Updates `@isaacs/brace-expansion` from 5.0.0 to 5.0.1

Updates `ajv` from 6.12.6 to 6.14.0
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.12.6...v6.14.0)

Updates `minimatch` from 3.1.2 to 3.1.3
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.3)

---
updated-dependencies:
- dependency-name: happy-dom
  dependency-version: 20.0.2
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: "@isaacs/brace-expansion"
  dependency-version: 5.0.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: ajv
  dependency-version: 6.14.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: minimatch
  dependency-version: 3.1.3
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-22 05:41:40 +00:00
matt
6f59ccdf38
Merge pull request #63 from matt1398/chore/issue-templates
Update issue templates
2026-02-22 14:31:58 +09:00
matt
3288831c7d
Update issue templates 2026-02-22 14:31:49 +09:00
Paul Holstein
1ad2eca8f0 fix: safe stringification of skill args to satisfy no-base-to-string lint rule
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 18:05:35 -05:00
Paul Holstein
820bb124d5 feat(report): add threshold-based assessment badges to all report sections
Add interpretive assessment layer to session reports. Every metric section
now shows color-coded severity badges (green/amber/red) computed from
configurable thresholds, replacing raw numbers with instant signal.

Includes centralized reportAssessments utility, model mismatch detection,
switch pattern recognition, and 44 new tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 18:01:43 -05:00
Paul Holstein
ab1ad071fe feat: add missing analysis sections to session report
Add 7 missing sections and fix 4 incomplete ones that the Python
analyzer generates but the TypeScript port was missing:

New sections: skillsInvoked, bashCommands, lifecycleTasks,
userQuestions, outOfScopeFindings, agentTree, subagentsList

Fixed: compaction (was just count, now has summaryCount + note),
serviceTiers removed (not available in parsed types),
compactionCount replaced with compaction object

Adds InsightsSection UI component and 8 new tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:10:20 -05:00
Paul Holstein
3f479dcf07 test(report): add session analyzer tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:56:26 -05:00
Paul Holstein
644d66eae1 feat(report): wire up toolbar button and report tab routing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:55:04 -05:00
Paul Holstein
d54e36f6fa feat(report): add session report tab and all section components
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:53:01 -05:00
Paul Holstein
0e3e20c990 feat(report): add 'report' tab type and openSessionReport store action
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:46:32 -05:00
Paul Holstein
465115ee5c feat(report): add session analyzer engine (TS port of analyze-session.py)
Port all analysis logic from the Python script to TypeScript, running
entirely in the renderer process. Produces a typed SessionReport from
a SessionDetail with: token/cost analysis, friction signals, idle gaps,
conversation tree metrics, test progression, and thrashing detection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:43:18 -05:00
Paul Holstein
e371ae793f feat(report): add session analysis report type definitions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:29:49 -05:00
Paul Holstein
feb0b66df8 docs: add session analysis report implementation plan
7 tasks with acceptance criteria covering types, analyzer engine,
tests, tab integration, UI components, routing, and polish.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:24:33 -05:00
Paul Holstein
29401916a8 docs: add session analysis report design document
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:20:03 -05:00
proxy
8d652c4d2e fix: wrap HTTP_SERVER_GET_STATUS response in IpcResult envelope
The HTTP_SERVER_GET_STATUS handler returned a raw { running, port } object
while all other HTTP server handlers (start, stop) return { success, data }.
invokeIpcWithResult() in the preload expects the IpcResult<T> envelope and
treats a missing success field as failure, throwing 'Unknown error'.

This caused an unhandled promise rejection every time the Settings page
opened, because GeneralSection calls api.httpServer.getStatus() on mount.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 16:01:14 -05:00
proxy
c69d2414d6 fix: auto-expand sidebar when a project is selected
When the sidebar is collapsed and the user clicks a project, the session
list was silently updated behind the hidden panel with no visual feedback,
leaving the user confused about why nothing appeared to change.

Fixed by setting sidebarCollapsed: false in both selectProject and
selectRepository at the moment of selection. Both entry points are covered:
- selectRepository: used by the dashboard project cards
- selectProject: used by the command palette and keyboard shortcuts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 15:56:40 -05:00
proxy
9e7d3b58a1 fix: resolve perf regression in transcript loading and session search
Two performance regressions introduced in recent PRs:

1. readAgentConfigs blocked transcript rendering (PR #50)
   The agent config IPC call was awaited on the critical path of
   fetchSessionDetail, preventing any transcript data from rendering
   until the filesystem read completed. On macOS this was especially
   noticeable due to security checks on first directory access.
   Fixed by making the call fire-and-forget: the transcript renders
   immediately and subagent color badges update asynchronously.
   Also set the project cache key optimistically before the async call
   to prevent duplicate in-flight requests on rapid navigation.

2. SessionSearcher stat()-called every session file on each search (PR #53)
   LocalFileSystemProvider.readdir() did not populate the optional
   mtimeMs field on FsDirent entries. The new SearchTextCache-based
   SessionSearcher fell back to an individual fsProvider.stat() call
   per session file when mtimeMs was missing, adding N extra filesystem
   round-trips on every search in local mode.
   Fixed by statting all entries concurrently inside readdir(), so
   mtimeMs is always populated and the stat fallback is never triggered.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 15:46:25 -05:00