Fix archived-only project deletion#1897
Closed
SAKETH11111 wants to merge 1 commit intopingdotgg:mainfrom
Closed
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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.
Note
Fix project deletion guard 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.getSidebarThreadsByIds, fixing the deletion guard so projects containing only archived threads are treated as deletable.server_tool_useandmcp_tool_usecontent blocks alongsidetool_use, using a newgetClaudeToolStartBlockvalidator.Macroscope summarized 7d3763d.