Skip to content

perf(extension): metadata cache + native session filter#25

Open
perler wants to merge 4 commits intoes6kr:mainfrom
perler:pr/perf-session-filter
Open

perf(extension): metadata cache + native session filter#25
perler wants to merge 4 commits intoes6kr:mainfrom
perler:pr/perf-session-filter

Conversation

@perler
Copy link

@perler perler commented Feb 24, 2026

Summary

  • Adds a metadata cache in @claude-sessions/core for fast project tree loading without re-parsing full JSONL session files
  • Eliminates listProjects bottleneck in the extension tree provider
  • Implements getParent() on the tree provider to enable VS Code's built-in tree search (Ctrl+F)
  • Adds native InputBox-based session filter with toolbar icons (search to filter, X to clear)

References #21 — implements the InputBox workaround described there while the inline filter limitation remains a VS Code platform constraint.

Test plan

  • Verify session tree loads significantly faster on large session directories
  • Click the filter icon in the tree title bar → type a query → sessions are filtered
  • Verify treeView.message shows the active filter text
  • Click the X icon to clear the filter
  • Use Ctrl+F in the tree view — built-in find widget should work via getParent()

🤖 Generated with Claude Code

Work Server and others added 4 commits February 24, 2026 17:45
Per-project .tree-cache.json stores Phase 1 (UUID map + summaries)
and Phase 2 (session tree data) output alongside session files.
Cache is invalidated by comparing file mtimes - full hit returns
cached data in <100ms, partial miss only reloads changed sessions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Work Server <work@server.local>
Implement getParent() on SessionTreeProvider so VS Code shows
its built-in find/filter widget (Ctrl+F) in the tree view.
Uses a parentMap populated lazily as nodes are expanded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Work Server <work@server.local>
…filter

- Remove redundant listProjects calls from hot path (was called 3x per
  refresh, each reading ALL projects' session files synchronously)
- loadProjectTreeData now resolves single project directly instead of
  listing all projects
- Cache project names and current project state in tree provider
- Use p.displayName from listProjects instead of calling folderNameToPath
  again (eliminates ~3000 redundant sync file reads)
- Flip folderNameToPath priority: try claude.json config first (covers
  89% of projects with single cached read), then fall back to session
  file extraction
- Add WebviewView filter input above tree for session search by
  title/summary, replacing built-in tree search (getParent removed)
- Filter loads all projects into in-memory cache, hides non-matching
  projects, auto-expands matches
- parseJsonlLines now skips malformed JSON lines instead of throwing
- Add webServerPath config and base path support for web package

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Work Server <work@server.local>
…commands

Remove the custom SearchViewProvider webview and use VS Code's built-in
showInputBox for session filtering. Adds filter/clear commands with
context-aware toolbar icons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Work Server <work@server.local>
@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

Warning

Rate limit exceeded

@perler has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 37a6452 and 0be6c31.

📒 Files selected for processing (12)
  • packages/core/src/index.ts
  • packages/core/src/paths.ts
  • packages/core/src/session.ts
  • packages/core/src/session/cache.ts
  • packages/core/src/session/index.ts
  • packages/core/src/session/tree.ts
  • packages/core/src/utils.test.ts
  • packages/core/src/utils.ts
  • packages/vscode-extension/package.json
  • packages/vscode-extension/src/extension.ts
  • packages/vscode-extension/src/treeProvider.ts
  • packages/web/src/lib/api.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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