Skip to content

fix: close all collection in workspace#6434

Merged
bijin-bruno merged 2 commits intousebruno:mainfrom
naman-bruno:bugfix/close-all
Dec 17, 2025
Merged

fix: close all collection in workspace#6434
bijin-bruno merged 2 commits intousebruno:mainfrom
naman-bruno:bugfix/close-all

Conversation

@naman-bruno
Copy link
Collaborator

@naman-bruno naman-bruno commented Dec 17, 2025

Description

JIRA

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

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

    • Clarified messaging in the collection removal dialog to state collections are removed from the current workspace but remain available in the file system.
  • Bug Fixes

    • Ensured collection bulk actions (e.g., close/select all) are correctly scoped to the active workspace so they only affect collections in that workspace.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Walkthrough

The 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 useMemo to ensure the close-all action only affects collections in the active workspace.

Changes

Cohort / File(s) Summary
Remove Collections Modal UI Text
packages/bruno-app/src/components/Sidebar/Collections/RemoveCollectionsModal/index.js
Updated confirmation messages and hints to explicitly state that removed collections are removed from the current workspace but remain in the filesystem.
Workspace-Scoped Collection Filtering
packages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js
Added useMemo hook to compute workspaceCollections by filtering collections against the active workspace using normalizePath. Updated selectAllCollectionsToClose to operate on workspace-scoped collections instead of the full set.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the clarified UI text accurately represents the intended behavior
  • Confirm normalizePath filtering logic correctly scopes collections to the active workspace
  • Check that selectAllCollectionsToClose behavior aligns with the new workspace-focused scope

Possibly related PRs

Suggested reviewers

  • helloanoop
  • lohit-bruno

Poem

🗂️ Collections dance within their workspace home,
But files remain where filesystems roam—
A gentle clarification in the modal's call,
Scoped by workspace, remembered by all.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing the close-all collections behavior to be workspace-scoped instead of global.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cee71f2 and d2f8002.

📒 Files selected for processing (1)
  • packages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js
⏰ 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: SSL Tests - macOS
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: Unit Tests
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: CLI 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 activeWorkspace without 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

📥 Commits

Reviewing files that changed from the base of the PR and between 639c8e5 and cee71f2.

📒 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() not func ()
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.js
  • packages/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 workspaceCollections computation correctly filters collections by active workspace using normalizePath for cross-platform path consistency. The pattern is consistent with the existing implementation in packages/bruno-app/src/components/Sidebar/Collections/index.js.


117-119: LGTM!

The update to use workspaceCollections correctly 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

@bijin-bruno bijin-bruno merged commit 4c1fba6 into usebruno:main Dec 17, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants