Repository navigation
Folder card icons + non-destructive workspace archive - #7015
jtalborough wants to merge 2 commits into
Conversation
Folder cards (kind: 'folder' repos and repo-less folder workspaces) rendered no leading glyph except when pinned, leaving the status dot as the only marker. Render the folder/repo icon inline in the title row across all card styles. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Archiving is a non-destructive alternative to Delete: it hides a workspace from the sidebar (and jump palette/dashboard, which already excluded archived) while keeping it on disk and recoverable. Adds: - Archive/Unarchive in the worktree context menu (worktrees + folder workspaces, routed through updateWorktreeMeta which already handles both). - A persisted 'Show archived' sidebar filter to review and unarchive. - Archived-aware filtering in the sort, visibility, and folder-workspace paths; archived rows render dimmed when shown. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Ready to review this PR? Stage has broken it down into 5 individual chapters for you: Chapters generated by Stage for commit b376981 on Jul 1, 2026 10:28am UTC. |
📝 WalkthroughWalkthroughThis PR adds an archived-workspaces filter feature. A new Sequence Diagram(s)sequenceDiagram
participant User
participant SidebarWorkspaceFilterSection
participant UISlice
participant WorktreeList
participant computeVisibleWorktreeIds
participant App
User->>SidebarWorkspaceFilterSection: toggle "Show archived"
SidebarWorkspaceFilterSection->>UISlice: setShowArchivedWorkspaces(true/false)
UISlice-->>WorktreeList: showArchivedWorkspaces state
WorktreeList->>computeVisibleWorktreeIds: opts.showArchivedWorkspaces
computeVisibleWorktreeIds-->>WorktreeList: visible worktree ids (filtered/unfiltered)
UISlice-->>App: showArchivedWorkspaces
App->>App: window.api.ui.set({ showArchivedWorkspaces })
Related PRs: None identified. Suggested labels: feature, renderer, i18n, needs-review Suggested reviewers: None specified in provided summaries. Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/sidebar/WorktreeCard.tsx (1)
1179-1186: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winHide the folder icon when the repo badge is already shown
showInlineFolderIconstill fires for folder repos in the classic card layout, so the card can render both the inline folder icon and the repo badge in the meta row. Gate it withshowRepoIdentityInTitle(or the same condition asshowRepoBadgeInMetaRow) so folder repos only show one identity marker.
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/visible-worktrees.ts (1)
132-135: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider extracting the repeated archived-filter branch.
The
showArchivedWorkspaces ? all : all.filter(w => !w.isArchived)pattern appears here, ingetVisibleWorktreeIds's fallback, and again inWorktreeList.tsx'ssortedIdsmemo. A tiny shared helper (e.g.filterByArchivedState(worktrees, showArchived)) would prevent the three copies from silently diverging if the semantics change later (e.g. adding a grace period before archived rows disappear).♻️ Proposed helper
+export function filterByArchivedState<T extends { isArchived: boolean }>( + worktrees: T[], + showArchived: boolean | undefined +): T[] { + return showArchived ? worktrees : worktrees.filter((w) => !w.isArchived) +}Then use
filterByArchivedState(all, opts.showArchivedWorkspaces)etc. in each of the three call sites.Also applies to: 281-283
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 52a7841d-3e21-4236-b270-e859459013d6
📒 Files selected for processing (17)
src/main/runtime/rpc/methods/client-ui.tssrc/renderer/src/App.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeContextMenu.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/visible-worktrees.test.tssrc/renderer/src/components/sidebar/visible-worktrees.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/startup-ui-hydration.tssrc/renderer/src/store/slices/ui.tssrc/shared/constants.tssrc/shared/types.ts
|
Would be great to have! I dont work on 20 projects at once and it's a mess now :( |
Summary
Two small, independent sidebar improvements for folder-backed projects and non-destructive workspace management.
1. Show the folder icon on sidebar folder cards
Adding a raw (non-git) folder creates a
Repowithkind: 'folder', soisFolderis true on its card. Every inline-icon render site was gated to skip folders (showInlineRepoBadgeexcludes!isFolder;showPinnedRepoIcononly fires when pinned), so a normal folder card rendered no leading glyph — only the activity status dot. This renders the folder/repo icon inline in the title row across all card styles (honoring a custom icon/badge color when set, defaulting to theFolderglyph), including repo-less folder workspaces.2. Archive workspaces (non-destructive) + "Show archived" filter
isArchivedalready existed in the data model and was honored by the jump palette and dashboard, but there was no way to set it or an archived-aware sidebar. This adds:updateWorktreeMeta.Archiving hides a workspace from the sidebar while keeping it on disk and fully recoverable — a non-destructive alternative to Delete.
Testing
typecheck(web) clean;oxlintclean; localization catalog synced across all 5 locales.computeVisibleWorktreeIdscases (archived hidden by default; shown when the filter is on).🤖 Generated with Claude Code
ELI5
Folder-backed projects show a folder icon on sidebar cards, and workspaces can be archived non-destructively. Folders no longer look blank, and archive is safer than hard delete.