Fix archived-only project deletion (superseded)#1896
Fix archived-only project deletion (superseded)#1896SAKETH11111 wants to merge 1 commit intopingdotgg:mainfrom
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 |
|
Closing and replacing this PR because the branch/title naming needed cleanup. |
What changed
This fixes the sidebar bug where a project that only contains archived threads appears empty but still cannot be removed.
The project deletion guard in
Sidebar.tsxnow checks only visible project threads, matching the same archived-thread filtering the sidebar already uses when rendering per-project thread lists.To keep that logic consistent, I extracted a small shared helper in
Sidebar.logic.tsand used it in the relevant sidebar call sites.I also added focused regression coverage for the archived-thread filtering helper.
Why
The root cause was a mismatch between two sidebar code paths:
threadIdsByProjectId, which still included archived threadsThat made users hit a misleading
Project is not emptywarning even when the UI showed no threads under the project.Impact
Projects that only contain archived threads can now be removed successfully from the sidebar.
Validation
bun fmtbun lintbun typecheckbun run --cwd apps/web test -- src/components/Sidebar.logic.test.tsbun run --cwd apps/server test -- src/provider/Layers/ClaudeAdapter.test.tsgit diff --checkNote
Fix project deletion check to correctly handle archived-only projects
getSidebarThreadsByIdsin Sidebar.logic.ts to map thread IDs to thread objects, filtering out missing entries and archived threads by default.getSidebarThreadsByIdswhich excludes archived threads from the active thread count.server_tool_useandmcp_tool_usecontent blocks alongsidetool_use, validated via a newgetClaudeToolStartBlockhelper.Macroscope summarized 7d3763d.