Skip to content

Added the ignore for the collection nested folders#8725

Open
ravindra-bruno wants to merge 3 commits into
usebruno:mainfrom
ravindra-bruno:feat/bru-3462
Open

Added the ignore for the collection nested folders#8725
ravindra-bruno wants to merge 3 commits into
usebruno:mainfrom
ravindra-bruno:feat/bru-3462

Conversation

@ravindra-bruno

@ravindra-bruno ravindra-bruno commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

JIRA: BRU-3462

Description

Problem & Solution
Currently, users have to manually edit bruno.json to ignore folders. Now this feature adds an "Ignore Folder" option directly to the sidebar's right-click context menu, automating the configuration update.

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.
Screenshot 2026-07-02 at 4 27 48 PM

Summary by CodeRabbit

  • New Features

    • Added an Ignore Folder option for collection folders.
    • Users can confirm ignoring a folder, with support for both YAML- and JSON-based collections.
    • Ignored folders are removed from the sidebar, related tabs are closed, and confirmation or error notifications are shown.
  • Bug Fixes

    • Improved ignore-pattern handling across operating systems.
    • Ensured ignored folders are consistently saved and excluded from collection monitoring.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds an “Ignore” folder action with confirmation UI, Redux handling, Electron IPC persistence for JSON/YAML collections, tab cleanup, state updates, and dynamic watcher filtering.

Changes

Ignore folder workflow

Layer / File(s) Summary
Ignore folder confirmation UI
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/*
Adds a folder-only Ignore menu action and modal with YAML/JSON-specific configuration instructions, success/error toasts, and affected-tab cleanup.
Redux ignore action
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
Adds ignoreFolder, invoking Electron IPC, updating Bruno configuration state, and removing the ignored item from Redux.
Configuration persistence
packages/bruno-electron/src/ipc/collection.js
Centralizes JSON/YAML configuration writes and persists normalized ignored folder paths while updating in-memory configuration.
Dynamic watcher ignore rules
packages/bruno-electron/src/app/collection-watcher.js
Reads current ignore patterns, normalizes separators, and filters exact or descendant paths.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CollectionItem
  participant Redux
  participant ElectronIPC
  participant CollectionWatcher

  User->>CollectionItem: Select Ignore for folder
  CollectionItem->>Redux: Dispatch ignoreFolder
  Redux->>ElectronIPC: Invoke renderer:ignore-folder
  ElectronIPC->>ElectronIPC: Persist ignored path in collection config
  ElectronIPC->>CollectionWatcher: Unlink ignored folder path
  ElectronIPC-->>Redux: Return updated configuration
  Redux-->>CollectionItem: Remove folder from state
  CollectionItem-->>User: Close tabs and show confirmation toast
Loading

Possibly related issues

Possibly related PRs

  • usebruno/bruno#8467 — Covers the same ignore-folder UI, Redux thunk, IPC persistence, and watcher behavior.

Suggested reviewers: bijin-bruno

Poem

A folder fades from view,
Its tabs fold up anew.
JSON or YAML keeps the score,
The watcher guards the door.
One quiet click, one tidy tree.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adding ignore support for collection nested folders.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/bruno-electron/src/ipc/collection.js`:
- Around line 1712-1714: Update writeBrunoConfig to deep-clone brunoConfig
before passing it to transformBrunoConfigBeforeSave, while retaining the
transformed clone for persistence. Ensure the original config object returned to
Redux is never mutated, including the corresponding save path around the
additional referenced lines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8a837aba-3c8e-4544-ae23-020cb4608009

📥 Commits

Reviewing files that changed from the base of the PR and between 948a34a and 4227c26.

📒 Files selected for processing (5)
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/IgnoreCollectionItem/index.js
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
  • packages/bruno-electron/src/app/collection-watcher.js
  • packages/bruno-electron/src/ipc/collection.js

Comment on lines +1712 to +1714
const writeBrunoConfig = async (brunoConfig, collectionPath, collectionRoot) => {
const transformedBrunoConfig = transformBrunoConfigBeforeSave(brunoConfig);
const format = getCollectionFormat(collectionPath);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Avoid mutating the config returned to Redux.

transformBrunoConfigBeforeSave mutates BRU configs (version → schema marker and collectionVersion). This handler returns that same object, so a subsequent ignore can overwrite the real collection version with '1'. Deep-clone before transforming for persistence.

Proposed fix
-    const transformedBrunoConfig = transformBrunoConfigBeforeSave(brunoConfig);
+    const transformedBrunoConfig = transformBrunoConfigBeforeSave(_.cloneDeep(brunoConfig));

Based on the supplied transformBrunoConfigBeforeSave definition, the transform mutates its argument.

Also applies to: 1760-1764

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-electron/src/ipc/collection.js` around lines 1712 - 1714,
Update writeBrunoConfig to deep-clone brunoConfig before passing it to
transformBrunoConfigBeforeSave, while retaining the transformed clone for
persistence. Ensure the original config object returned to Redux is never
mutated, including the corresponding save path around the additional referenced
lines.

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.

1 participant