Skip to content

Fix archived-only project deletion (superseded)#1896

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

Fix archived-only project deletion (superseded)#1896
SAKETH11111 wants to merge 1 commit intopingdotgg:mainfrom
SAKETH11111:codex/fix-archived-project-delete

Conversation

@SAKETH11111
Copy link
Copy Markdown

@SAKETH11111 SAKETH11111 commented Apr 10, 2026

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.

Validation

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run --cwd apps/web test -- src/components/Sidebar.logic.test.ts
  • bun run --cwd apps/server test -- src/provider/Layers/ClaudeAdapter.test.ts
  • git diff --check

Note

Fix project deletion check 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.
  • Fixes a bug in Sidebar.tsx where deleting a project with only archived threads was incorrectly blocked; the deletion guard now uses getSidebarThreadsByIds which excludes archived threads from the active thread count.
  • Also extends Claude adapter in ClaudeAdapter.ts to handle server_tool_use and mcp_tool_use content blocks alongside tool_use, validated via a new getClaudeToolStartBlock helper.

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: 09add59c-85a2-4011-b6b8-1e72aa7c01a0

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 vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Apr 10, 2026
@SAKETH11111
Copy link
Copy Markdown
Author

SAKETH11111 commented Apr 10, 2026

Closing and replacing this PR because the branch/title naming needed cleanup.

@SAKETH11111 SAKETH11111 deleted the codex/fix-archived-project-delete branch April 10, 2026 20:57
@SAKETH11111 SAKETH11111 changed the title [codex] Fix archived-only project deletion Fix archived-only project deletion (superseded) Apr 10, 2026
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.

1 participant