Skip to content

Fix: show deleted worktree, related to issue 945#980

Open
swellee wants to merge 4 commits intoTabbyML:mainfrom
swellee:fix/show-deleted-worktree
Open

Fix: show deleted worktree, related to issue 945#980
swellee wants to merge 4 commits intoTabbyML:mainfrom
swellee:fix/show-deleted-worktree

Conversation

@swellee
Copy link
Contributor

@swellee swellee commented Dec 29, 2025

added: use-deleted-worktrees.ts, to gather deleted worktree paths from tasks;
modified: worktree-list, show deleted worktrees;
image
image
image

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.88%. Comparing base (5be99bc) to head (c1579b6).

Files with missing lines Patch % Lines
...ages/vscode-webui/src/components/worktree-list.tsx 0.00% 54 Missing ⚠️
...scode-webui/src/lib/hooks/use-deleted-worktrees.ts 0.00% 21 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #980      +/-   ##
==========================================
- Coverage   15.90%   15.88%   -0.03%     
==========================================
  Files         576      577       +1     
  Lines       52884    52958      +74     
  Branches     1704     1702       -2     
==========================================
  Hits         8411     8411              
- Misses      44236    44309      +73     
- Partials      237      238       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wsxiaoys wsxiaoys requested a review from zhanba December 29, 2025 13:40
@wsxiaoys
Copy link
Member

wsxiaoys commented Dec 30, 2025

#945

@wsxiaoys wsxiaoys requested review from liangfung and removed request for zhanba December 30, 2025 02:29
const deletedWorktrees = useMemo(
() =>
worktrees.filter(
(wt) => !activeWorktrees?.some((active) => active.path === wt.path),
Copy link
Contributor

@liangfung liangfung Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended to query using activeWorktreePaths in the backend instead of filtering on the frontend

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

return queryDb(
{
query: sql`select * from tasks where parentId is null and cwd = '${cwd}' order by updatedAt desc limit ${limit}`,
query: sql`select * from tasks where parentId is null and (cwd = '${cwd}' or git->>'$.worktree.gitdir' = '${cwd}') order by updatedAt desc limit ${limit}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert, querying only with the cwd is sufficient

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image actually, when revert to only query by 'cwd`, the pannel can't retrive the tasks of deleted worktree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liangfung briefly, to reproduce this bug, you can : let's say your current workspace=xx/main, then create worktree(eg: br-1) with vscode, and DO NOT switch to this worktree; then, hover on the worktree label on Pochi's panel, click the revealed menu btn "create task" on the worktree, hence, the new task was created with : cwd = current workspace(xx/main), and git.worktree.gitdir = xx/br-1, later you can delete the worktree br-1.
so that when you fetch deleted tasks, query by cwd= xx/br-1 won't get the task.


return queryDb(
{
query: sql`select distinct git->>'$.worktree.gitdir' as path, git->>'$.branch' as branch, cwd from tasks where parentId is null and cwd != '${cwd}' ${originFilter} and git->>'$.worktree.gitdir' is not null`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value of the worktree path should be the cwd. When filtering, compare the cwd with activeWorktrees.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@swellee swellee requested a review from liangfung January 3, 2026 09:19
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.

4 participants