Skip to content

Fix archived-only project deletion#1897

Closed
SAKETH11111 wants to merge 1 commit intopingdotgg:mainfrom
SAKETH11111:fix-archived-project-delete
Closed

Fix archived-only project deletion#1897
SAKETH11111 wants to merge 1 commit intopingdotgg:mainfrom
SAKETH11111:fix-archived-project-delete

Conversation

@SAKETH11111
Copy link
Copy Markdown

@SAKETH11111 SAKETH11111 commented Apr 10, 2026

Closes #1880

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.tsx now 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.ts and 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:

  • project rendering filtered archived threads out, so archived-only projects looked empty
  • project deletion checked raw threadIdsByProjectId, which still included archived threads

That made users hit a misleading Project is not empty warning 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.

Note

Fix project deletion guard to correctly handle archived-only projects

  • Introduces getSidebarThreadsByIds in Sidebar.logic.ts to map thread IDs to thread objects, filtering out missing entries and archived threads by default.
  • Replaces inline map/filter logic in Sidebar.tsx with calls to getSidebarThreadsByIds, fixing the deletion guard so projects containing only archived threads are treated as deletable.
  • Also extends the Claude adapter to handle server_tool_use and mcp_tool_use content blocks alongside tool_use, using a new getClaudeToolStartBlock validator.

Macroscope summarized 7d3763d.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

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: c9abd8da-33ee-4bca-b148-5a99d2b0afdb

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:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 10, 2026
@SAKETH11111 SAKETH11111 deleted the fix-archived-project-delete branch April 10, 2026 21:02
@SAKETH11111 SAKETH11111 restored the fix-archived-project-delete branch April 10, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 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.

Cannot delete project with only archived threads

1 participant