Conversation
02c05e9 to
a2736b0
Compare
|
@codex review Comment posted automatically by outer-loop |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2736b0715
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b687b69 to
b9126e9
Compare
Discover git worktrees for each project and expose them throughout the stack — backend discovery, cache, file scanning, comments, MCP tools, and frontend UI. Backend: - Discover worktrees via `git worktree list --porcelain` during project scan - Add worktree-scoped file scanning (ScanProjectSourcesForWorktree) that remaps both tree and files sources to worktree paths - Scope comments/threads to worktrees via optional worktree parameter - Handle worktree `.git` files (not directories) in git info resolution - Add `/api/ready` endpoint so Tauri waits for full server initialization before loading the webview, fixing a startup race condition - File watcher monitors worktree paths for changes Frontend: - Parse `@worktree` suffix in URLs for worktree-scoped navigation - Sidebar shows worktree sub-items with stacked name + branch layout - Project cards show worktree list with stacked presentation - File and project pages pass worktree param to all API calls - Comments panel scopes threads to active worktree Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b9126e9 to
c4269a2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4269a218e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { setSidebarExtra } = useOutletContext<LayoutContext>(); | ||
| const qn = location.pathname.replace(/^\/project\//, ''); | ||
| const qnRaw = location.pathname.replace(/^\/project\//, ''); | ||
| const { project: qn, worktree } = parseProjectWorktree(qnRaw); |
There was a problem hiding this comment.
Parse project routes without splitting literal '@' names
This page now unconditionally calls parseProjectWorktree(qnRaw), so any project qualified name that legitimately contains @ (e.g. Team/foo@bar) is misparsed into project Team/foo + worktree bar, and all subsequent API calls (getProjectFiles, getReviews, links) target the wrong project/worktree. Fresh evidence versus the earlier fallback-only discussion: this commit made the parse call unconditional in ProjectPage, so the misparse can persist for normal navigation.
Useful? React with 👍 / 👎.
| for _, wt := range p.Worktrees { | ||
| if wt.IsMain { | ||
| continue | ||
| } | ||
| // Watch worktree source directories (thoughts/, etc.) |
There was a problem hiding this comment.
Watch each worktree root for newly created content
The worktree watch setup only adds watches for directories that already exist (AutoDetectDir, remapped RootPath, and .penpal/comments), but it never watches wt.Path itself; as a result, creating new top-level worktree content (for example the first .penpal/comments tree or root-level files from a files source) produces no fsnotify event to attach new watches, so files/comments SSE updates can silently stop until a restart/rescan.
Useful? React with 👍 / 👎.
Penpal now understands git worktrees. Each worktree is treated as a scoped view with its own file listing, comments, and branch context.
Why
Penpal had no worktree awareness — files from the wrong worktree would leak into views, and comments left on worktree files would show up unpredictably across checkouts.
What changed
Worktree discovery: Projects are scanned for git worktrees on startup. Each worktree's name, path, and branch are exposed to the frontend.
Scoped files and comments: Navigating to a worktree shows only its files. Threads are stored in the worktree's own
.penpal/sidecar directory — comments in one worktree don't appear in another.Navigation: Worktrees appear as sub-items in the sidebar and on workspace project cards. URLs use
@worktreesuffix encoding (e.g.,/file/ws/repo@my-worktree/path/to/file).MCP tools: All MCP tools (
list_threads,create_thread,reply, etc.) now accept an optionalworktreeparameter so Claude agents can scope operations to the correct worktree.Startup readiness: Added
/api/readyendpoint that blocks until file scanning completes, fixing an intermittent startup race where the UI loaded before projects were discovered.Testing
Added tests for worktree discovery, cache resolution, MCP tool scoping, HTTP API routing, and
FilePageworktree switching.