Add archive search and project collapse - #2758
OliverGamborg wants to merge 4 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
255f391 to
014d46f
Compare
ApprovabilityVerdict: 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. |
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.
c404b48 to
b625148
Compare
There was a problem hiding this comment.
🟡 Medium
t3code/apps/web/src/components/settings/SettingsPanels.tsx
Lines 1463 to 1466 in b625148
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`).
What Changed
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
After
Checklist
Verification
bun run --cwd apps/web test src/components/settings/SettingsPanels.logic.test.tsbun run --cwd apps/web test:browser src/components/settings/SettingsPanels.browser.tsxbun fmtbun lintbun typecheckNote
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
filterArchivedThreadGroupshelper 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 filtersvisibleArchivedGroupsfrom 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.SettingsSectiongains acontentVisibleprop to hide thread rows without removing the header.Also removes
scrollbar-gutter-bothfromSettingsPageContainer, 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
ArchivedThreadsPanelthat filters archived thread groups by project name, cwd, thread title, branch, and worktree path using token-based matching via the newfilterArchivedThreadGroupsutil in SettingsPanels.logic.ts.SettingsSectionin settingsLayout.tsx with acontentVisibleprop to support collapsing content without unmounting the header.SettingsPageContainerremoves thescrollbar-gutter-bothutility 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.