Recency-sort browse lists; label Claude projects with session title#56
Merged
eliothedeman merged 1 commit intomainfrom Apr 24, 2026
Merged
Recency-sort browse lists; label Claude projects with session title#56eliothedeman merged 1 commit intomainfrom
eliothedeman merged 1 commit intomainfrom
Conversation
…cts with session title Browse lists (Claude projects/sessions, Pi projects/sessions, Git branches) previously rendered in backend emission order — usually alphabetical or directory-walk. Now they sort most-recently-active first, matching the convention already used by the tray popover's Recent list. For Claude projects specifically, the streaming payload deliberately skipped last_activity to avoid per-session JSONL parsing; adds a cheap stat-based hint (max mtime across the project's .jsonl files). Pi projects have no project-level timestamp, so recency is derived frontend-side from the streamed session timestamps via a maxTimestampByProject map. Also replaces the opaque worktree-basename project titles (e.g. "2f297b", "fa7bdc") with the first-user-message of each project's most-recent session, via a new `claude_project_latest_title` IPC command fetched lazily per project. Falls back to the basename while the title loads or if the conversation has no user text.
|
🔍 Preview deployed: https://46f398e4.toolpath.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related UX improvements to the toolpath-desktop Browse screens:
1. Sort by recency. Claude projects/sessions, Pi projects/sessions, and Git branches previously rendered in backend-emission order — usually alphabetical or directory-walk. Now they're sorted most-recently-active first, matching the convention the tray popover's Recent list already uses (
src/tray.rs:87).2. Label Claude projects with their latest session title. Project rows previously showed the directory basename, which is uninformative for worktrees (
2f297b,fa7bdc,c44db4…). Now each project row displays the first-user-message of its most-recent session as the primary title, falling back to the basename while the title loads.What changed
Backend (
crates/toolpath-desktop/src/commands/sources.rs,main.rs)ClaudeProjectQuickgainslast_activity: Option<String>, populated by a newnewest_jsonl_mtimehelper — a cheap directory stat walk (max mtime across the project's.jsonlfiles), no JSONL parsing. Preserves the original perf intent of the streaming payload.claude_project_latest_title(project_path)reads the most-recent session's first user message (via existingClaudeConvo::title) and returnsOption<String>. Registered in the Tauri invoke handler.Frontend (
frontend/src/lib/)byRecencyDesccomparator inupdate.ts— descending, nulls last, lexicographic on RFC3339.ClaudeProjectReceived,ClaudeSessionReceived,PiProjectReceived,PiSessionReceived,GitBranchesLoaded.PiSlice.maxTimestampByProject: Record<string, string>— Pi has no project-level timestamp, so project-list recency is derived frontend-side from streamed session timestamps.ClaudeSlice.projectTitles: Record<string, string>+ClaudeProjectTitleLoadedmsg;ClaudeProjectReceivednow kicks off the title fetch lazily so project rows paint immediately and titles fill in after.BrowseClaude.svelterendersprojectTitles[p.project_path] ?? p.display_name.Design notes for reviewers
ClaudeProjectQuickpayload previously documentedlast_activityas "deliberately omitted to avoid re-introducing per-session metadata reads." The new stat-based approach respects that intent — we only stat files (no JSON parsing) to get recency. The expensive title read is split into a separate lazy command.sortedList[0].name— unchanged semantically from "first in display order is selected" but now "first" means "most recent".Test plan
cargo build -p toolpath-desktop— cleancargo test -p toolpath-desktop— 17/17 passbun run checkin frontend — 0 errors, 0 warnings, 170 filesbun run build— 194 modules transformed, cleancargo tauri dev— manual verification:2f297b-style basenames; expanded sessions ordered newest-first.