Skip to content

Folder card icons + non-destructive workspace archive - #7015

Open
jtalborough wants to merge 2 commits into
stablyai:mainfrom
jtalborough:jtalborough/folder-icons-archive-upstream
Open

jtalborough wants to merge 2 commits into
stablyai:mainfrom
jtalborough:jtalborough/folder-icons-archive-upstream

Conversation

@jtalborough

@jtalborough jtalborough commented Jul 1, 2026 •

Copy link
Copy Markdown

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 Repo with kind: 'folder', so isFolder is true on its card. Every inline-icon render site was gated to skip folders (showInlineRepoBadge excludes !isFolder; showPinnedRepoIcon only 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 the Folder glyph), including repo-less folder workspaces.

2. Archive workspaces (non-destructive) + "Show archived" filter

isArchived already 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:

  • Archive / Unarchive in the workspace context menu (works for git worktrees and folder workspaces, and for multi-select), routed through the existing updateWorktreeMeta.
  • A persisted "Show archived" filter in the sidebar Filters menu (off by default). When on, archived rows appear dimmed and can be unarchived.
  • Archived-aware filtering threaded through the sort order, the visible-worktree pipeline, and the folder-workspace row path (which had no archived filter before).

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; oxlint clean; localization catalog synced across all 5 locales.
  • Unit tests pass, including 2 new computeVisibleWorktreeIds cases (archived hidden by default; shown when the filter is on).

🤖 Generated with Claude Code


Open in Stage

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.

jtalborough and others added 2 commits July 1, 2026 06:25
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]>
@ghost

ghost commented Jul 1, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 5 individual chapters for you:

Title
1 Define archived workspace state and constants
2 Wire archived visibility through the store
3 Implement archived-aware filtering and sorting
4 Add Archive actions and UI controls
5 Render icons for folder-backed workspaces
Open in Stage

Chapters generated by Stage for commit b376981 on Jul 1, 2026 10:28am UTC.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds an archived-workspaces filter feature. A new showArchivedWorkspaces boolean flag is added to PersistedUIState, shared constants, the ui.set RPC schema, and the renderer UI store slice, with hydration and startup fallback support. The sidebar filter section gains a "Show archived" toggle, and computeVisibleWorktreeIds/WorktreeList sorting and visibility logic now respect this flag. WorktreeCard dims archived rows and adds an inline folder icon path. WorktreeContextMenu adds an archive/unarchive action updating isArchived via updateWorktreeMeta. Locale files add corresponding translation strings across five languages, and new unit tests cover archived-filtering behavior.

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 })
Loading

Related PRs: None identified.

Suggested labels: feature, renderer, i18n, needs-review

Suggested reviewers: None specified in provided summaries.

Poem

A toggle flipped, archived rows appear,
dimmed and quiet, no longer hid from here.
The rabbit clicks "Archive," then "Unarchive" too,
five locales whisper words made anew.
Sidebar sorted, visible ids realigned—
a small flag now, but neatly refined. 🐰📦

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning Summary and testing are present, but the required Screenshots, AI Review Report, Security Audit, and Notes sections are missing. Add the missing template sections, including screenshots or 'No visual change', the AI review report, a security audit summary, and notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the two main changes: folder card icons and non-destructive workspace archiving.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

Hide the folder icon when the repo badge is already shown
showInlineFolderIcon still 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 with showRepoIdentityInTitle (or the same condition as showRepoBadgeInMetaRow) 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 win

Consider extracting the repeated archived-filter branch.

The showArchivedWorkspaces ? all : all.filter(w => !w.isArchived) pattern appears here, in getVisibleWorktreeIds's fallback, and again in WorktreeList.tsx's sortedIds memo. 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

📥 Commits

Reviewing files that changed from the base of the PR and between c1fae31 and b376981.

📒 Files selected for processing (17)
  • src/main/runtime/rpc/methods/client-ui.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.tsx
  • src/renderer/src/components/sidebar/WorktreeContextMenu.tsx
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/visible-worktrees.test.ts
  • src/renderer/src/components/sidebar/visible-worktrees.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/startup-ui-hydration.ts
  • src/renderer/src/store/slices/ui.ts
  • src/shared/constants.ts
  • src/shared/types.ts

@AmethystLiang
AmethystLiang requested a review from Jinwoo-H July 1, 2026 16:51
@AmethystLiang AmethystLiang assigned OrcaWin and unassigned Jinwoo-H Jul 20, 2026
@AmethystLiang
AmethystLiang requested review from OrcaWin and removed request for Jinwoo-H July 20, 2026 18:42
@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026
@syabro

syabro commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Would be great to have! I dont work on 20 projects at once and it's a mess now :(

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants