← Back to PRs

#17966: feat(ui/usage): show files read during session in context panel

by jogelin open 2026-02-16 10:32 View on GitHub →
app: web-ui gateway size: M
## Files Read Tracking & Tree View Adds file read tracking to the usage dashboard, showing which files were read during a session and how often. <img width="667" height="872" alt="image" src="https://github.com/user-attachments/assets/d6e60a0f-5f75-46e5-856e-28621fe4051d" /> ### Backend - `extractFileReadPaths()` in transcript-tools.ts (supports tool_use + toolCall formats) - Per-session and cross-session filesRead aggregation - File paths included in session log format `[Tool: read /path]` - New `SessionFilesRead` type ### UI - Tree view in System Prompt Breakdown with common prefix detection and directory collapsing - Filter-aware: recalculates from logs when time range cursor active - Insight list values on single line with ellipsis for long labels ### Tests - 29 tests pass (14 backend + 15 UI) <!-- greptile_comment --> <h3>Greptile Summary</h3> Added file read tracking to the usage dashboard. Files read during a session are extracted from transcript tool_use blocks, aggregated per-session and cross-session, displayed in a tree view with directory collapsing in the System Prompt Breakdown panel, and recalculated from logs when a timeline filter is active. **Backend Changes:** - `extractFileReadPaths()` extracts file paths from Read tool blocks in both tool_use and toolCall formats - `loadSessionCostSummary()` aggregates filesRead data with counts per file - Session logs include file paths in format `[Tool: read /path]` - New `SessionFilesRead` type mirrors `SessionToolUsage` structure **Frontend Changes:** - Tree view with common prefix detection and directory collapsing - Filter-aware: recalculates from logs when timeline cursor is active - `parseToolSummary()` regex updated to capture only tool name (first word) to prevent file paths from leaking into tool grouping pills - Compact insight list rendering with ellipsis for long labels **Testing:** - 29 passing tests (14 backend + 15 frontend) cover path extraction, aggregation, tree building, and filtering <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The implementation is well-tested with 29 passing tests, follows established patterns in the codebase, includes proper type definitions, handles edge cases (cursor filtering, common prefix detection, tree collapsing), and the previous thread concerns about tool name grouping have been resolved. No security issues, performance concerns, or logical errors detected. - No files require special attention <sub>Last reviewed commit: 5d7f7c6</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs