feat(desktop): hide projects from the sidebar and delete them from the context menu
Why
Discord feedback (fluxchamber, gislol in #feature-requests): "Remove from Sidebar" on a project reads like a removal but only hides the project, and it wipes the project's groups and pins on the way out. Deleting for real lives only in project settings, and an agency user asked for an "archive" for dormant customer repos. Project folders (#4018) are out of scope here.
What
- Hide from Sidebar replaces Remove from Sidebar. It flips a new
isHiddenflag on the local placement row and touches nothing else, so unhiding brings the project back with its groups, pins and order intact. Hiding shows an undo toast. Hiding the project you are currently inside lands you on the workspaces list. - Hidden projects row at the foot of the project list ("N hidden projects") lists what is hidden and restores one per click. Survives reload.
- Any path that would add the project to the sidebar (setting it up on this device, opening one of its workspaces, an agent creating a worktree in it) reveals it, matching what re-adding a removed project used to do.
- Hidden projects leave the visible-workspace set, so their workspaces stop raising notifications until shown again.
- Delete Project… in the context menu for organization owners, sharing one
DeleteProjectDialogwith project settings. The copy states how many worktrees are removed from disk, that the repository folder is kept, that worktrees with uncommitted changes stay on disk, and how many offline devices keep their copy. - The tombstoning
removeProjectFromSidebarStatepath and its tests are deleted. New tests cover the hide flag and the ensure-reveals-hidden rule. - Eight new strings translated into all 16 locales.
Verification
Driven over CDP in the dev desktop app (worktree scandalous-tulip, signed in as the dev account), using trusted mouse events on the real context menu:
- Context menu shows Hide from Sidebar and Delete Project… for an owner.
- Hide: row gone, undo toast, "1 hidden project" row,
isHidden: truein local storage; Undo restores. - Hidden state persists across reload; the hidden-projects dropdown restores the project with its group still attached.
- Hiding from inside the project's own workspace navigates to
/v2-workspacesand stays hidden. - Delete dialog on a real project with 9 worktrees shows the plural copy; Cancel leaves it untouched. Deleting a throwaway project removes it from the host, shows the toast, and leaves its folder on disk.
- No
console.errorduring the whole journey. Typecheck, biome,check:i18nclean;sidebarMutations.test.tspasses.
https://claude.ai/code/session_01AVKoNAqhKbrqj1ZQpPkXRQ
Summary by cubic
Replaces the old "Remove from Sidebar" action, which hid a project but wiped its groups, pins, and order, with a reversible "Hide from Sidebar" that preserves them, and adds "Delete Project…" to the context menu for organization owners.
Changes
- "Hide from Sidebar" flips a local
isHiddenflag and leaves placement data untouched. - Hidden projects appear in an "N hidden projects" row at the bottom of the project list and can be restored one at a time; hidden state survives reload.
- Opening a hidden project or creating a worktree in it reveals it again.
- Hidden projects' workspaces stop raising notifications and pull-request polling until shown again; hidden ids come from persisted placement rows so this holds even when the host is offline.
- "Delete Project…" reuses the same confirmation dialog as project settings; the dialog counts only worktrees on hosts the delete will reach, using each workspace's host-reachable flag.
- Removes the old tombstoning removal path and its tests, and adds tests for hiding and re-revealing.
Side effects
- Deleting a project removes its worktrees from reachable hosts but keeps the repository folder; dirty worktrees and offline hosts keep their copies.
- Hiding the project you are currently inside navigates to the workspaces list.
Summary by CodeRabbit
-
New Features
- Projects can be hidden from the sidebar and restored from a dedicated hidden-projects list while preserving their sidebar placement.
- Added project deletion with confirmation details for devices, worktrees, offline copies, and repository folders.
- Project deletion is available to organization owners.
-
Bug Fixes
- Hidden projects no longer appear as visible workspaces or trigger related sidebar notifications.
-
Localization
- Added and updated translations for hidden-project and deletion workflows across supported languages.