fix: close all collection in workspace#6434
Conversation
WalkthroughThe PR clarifies that removing collections from the workspace doesn't delete them from the filesystem, updating confirmation messages accordingly. Additionally, workspace-scoped collection filtering is introduced using Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js (1)
35-35: Consider adding a fallback to the default workspace for consistency.Line 35 retrieves
activeWorkspacewithout falling back to the default workspace. While the null check at line 42 handles the missing workspace defensively,packages/bruno-app/src/components/Sidebar/Collections/index.js(line 17) uses a fallback pattern:const activeWorkspace = workspaces.find((w) => w.uid === activeWorkspaceUid) || workspaces.find((w) => w.type === 'default');Either approach is valid, but aligning these patterns would improve consistency across similar components.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/bruno-app/src/components/Sidebar/Collections/RemoveCollectionsModal/index.js(2 hunks)packages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js(4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/Sidebar/Collections/RemoveCollectionsModal/index.jspackages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js
🧬 Code graph analysis (2)
packages/bruno-app/src/components/Sidebar/Collections/RemoveCollectionsModal/index.js (1)
packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js (1)
collectionUids(112-112)
packages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js (4)
packages/bruno-app/src/components/Sidebar/Collections/index.js (2)
workspaceCollections(19-24)activeWorkspace(17-17)packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.js (1)
activeWorkspace(94-94)packages/bruno-app/src/components/Sidebar/ApiSpecs/index.js (1)
activeWorkspace(20-20)packages/bruno-app/src/utils/common/path.js (1)
normalizePath(166-169)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Playwright E2E Tests
- GitHub Check: Unit Tests
- GitHub Check: CLI Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - macOS
🔇 Additional comments (4)
packages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js (3)
1-1: LGTM!The necessary imports for workspace-scoped collection filtering are correctly added.
Also applies to: 18-18
41-46: LGTM!The
workspaceCollectionscomputation correctly filters collections by active workspace usingnormalizePathfor cross-platform path consistency. The pattern is consistent with the existing implementation inpackages/bruno-app/src/components/Sidebar/Collections/index.js.
117-119: LGTM!The update to use
workspaceCollectionscorrectly scopes the close-all action to collections in the active workspace, addressing the PR objective.packages/bruno-app/src/components/Sidebar/Collections/RemoveCollectionsModal/index.js (1)
210-212: LGTM!The updated user-facing messages correctly clarify that collections are removed from the current workspace but remain in the filesystem. This aligns with the workspace-scoped behavior and sets proper user expectations.
Also applies to: 246-256
Description
JIRA
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
Improvements
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.