Skip to content

Add archive search and project collapse - #2758

Closed
OliverGamborg wants to merge 4 commits into
pingdotgg:mainfrom
OliverGamborg:feature/archive-search-collapse
Closed

OliverGamborg wants to merge 4 commits into
pingdotgg:mainfrom
OliverGamborg:feature/archive-search-collapse

Conversation

@OliverGamborg

@OliverGamborg OliverGamborg commented May 19, 2026 •

Copy link
Copy Markdown

What Changed

  • Added client-side search to Settings > Archive for archived thread titles, branches, worktree paths, project names, and project paths.
  • Added local per-project collapse controls in the archived settings section.
  • Added focused unit and browser coverage for archive filtering, search, and collapse behavior.

Why

Archived threads can become hard to scan once several projects accumulate history. This keeps the fix small and UI-only by filtering the existing archived snapshot in the web app without changing server contracts, persistence, or archive loading.

UI Changes

This changes the Settings > Archive UI by adding a search field and per-project collapse button.

Before

electron_mVFfKUL6zo

After

electron_BEJ32SrP2c

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Verification

  • bun run --cwd apps/web test src/components/settings/SettingsPanels.logic.test.ts
  • bun run --cwd apps/web test:browser src/components/settings/SettingsPanels.browser.tsx
  • bun fmt
  • bun lint
  • bun typecheck

Note

Low Risk
UI-only settings changes with pure client-side filtering; no auth, data, or server contract changes.

Overview
Adds client-side search and collapsible project sections to Settings → Archive so large archived histories are easier to scan. Filtering stays in the web app on the existing archived snapshot—no API or persistence changes.

Search uses a new filterArchivedThreadGroups helper with token-based matching across project name, cwd, thread title, branch, and worktree path. The panel shows a search field, a “no matches” empty state, and filters visibleArchivedGroups from the current query.

Collapse keeps per-project expand/collapse state (environmentId:projectId), thread counts in the header, and chevron toggles. While search is active, matching projects stay expanded and the collapse control is disabled. SettingsSection gains a contentVisible prop to hide thread rows without removing the header.

Also removes scrollbar-gutter-both from SettingsPageContainer, which may slightly change scrollbar spacing in settings. Unit and browser tests cover filtering and collapse/search interaction.

Reviewed by Cursor Bugbot for commit fe21ffc. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add search and per-project collapse to the archived threads panel

  • Adds a live text search input to ArchivedThreadsPanel that filters archived thread groups by project name, cwd, thread title, branch, and worktree path using token-based matching via the new filterArchivedThreadGroups util in SettingsPanels.logic.ts.
  • Adds per-project collapse/expand toggles that hide thread rows while keeping the section header visible; collapse state is preserved across queries but overridden (sections forced open, toggle disabled) while a search is active.
  • Extends SettingsSection in settingsLayout.tsx with a contentVisible prop to support collapsing content without unmounting the header.
  • Behavioral Change: SettingsPageContainer removes the scrollbar-gutter-both utility class, which may slightly alter scrollbar spacing in the settings layout.
📊 Macroscope summarized fe21ffc. 4 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

@coderabbitai

coderabbitai Bot commented May 19, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5a83dc52-728d-4367-bcb8-ddf3739e54c3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels May 19, 2026
@OliverGamborg
OliverGamborg force-pushed the feature/archive-search-collapse branch from 255f391 to 014d46f Compare May 19, 2026 08:07
@macroscopeapp

macroscopeapp Bot commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR adds new user-facing features (archive search and collapsible project sections) introducing new UI components, state management, and filtering logic. New feature additions warrant human review to validate the intended behavior and UX.

You can customize Macroscope's approvability policy. Learn more.

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
@OliverGamborg OliverGamborg mentioned this pull request Jun 5, 2026
2 of 3 tasks
Adds client-side filtering for archived threads in Settings > Archive, including project-level matches and thread-level matches across title, branch, and worktree path.

Adds local per-project collapse controls and focused unit/browser coverage while leaving archive data loading and server contracts unchanged.
@OliverGamborg
OliverGamborg force-pushed the feature/archive-search-collapse branch from c404b48 to b625148 Compare June 12, 2026 10:35

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.

🟡 Medium

if (clicked === "delete") {
await confirmAndDeleteThread(threadRef);
refreshArchivedThreads();
}

If confirmAndDeleteThread throws (for example, when the underlying deleteThread call fails), the "delete" branch in handleArchivedThreadContextMenu silently drops the error with no user feedback. This is inconsistent with the "unarchive" branch, which catches errors and displays a toast. Consider wrapping the confirmAndDeleteThread call in try-catch and adding a toast on error, matching the unarchive pattern.

       if (clicked === "delete") {
-        await confirmAndDeleteThread(threadRef);
-        refreshArchivedThreads();
+        try {
+          await confirmAndDeleteThread(threadRef);
+          refreshArchivedThreads();
+        } catch (error) {
+          toastManager.add(
+            stackedThreadToast({
+              type: "error",
+              title: "Failed to delete thread",
+              description: error instanceof Error ? error.message : "An error occurred.",
+            }),
+          );
+        }
       }
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/settings/SettingsPanels.tsx around lines 1463-1466:

If `confirmAndDeleteThread` throws (for example, when the underlying `deleteThread` call fails), the "delete" branch in `handleArchivedThreadContextMenu` silently drops the error with no user feedback. This is inconsistent with the "unarchive" branch, which catches errors and displays a toast. Consider wrapping the `confirmAndDeleteThread` call in try-catch and adding a toast on error, matching the unarchive pattern.

Evidence trail:
apps/web/src/components/settings/SettingsPanels.tsx lines 1447-1466 (unarchive try-catch vs delete no try-catch), line 1567 (`void handleArchivedThreadContextMenu(...)` fire-and-forget call), apps/web/src/hooks/useThreadActions.ts lines 261-283 (`confirmAndDeleteThread` calls `await deleteThread(target)` which can throw via `dispatchCommand`).

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant