Added the ignore for the collection nested folders#8725
Conversation
WalkthroughAdds an “Ignore” folder action with confirmation UI, Redux handling, Electron IPC persistence for JSON/YAML collections, tab cleanup, state updates, and dynamic watcher filtering. ChangesIgnore folder workflow
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
Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/IgnoreCollectionItem/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/actions.jspackages/bruno-electron/src/app/collection-watcher.jspackages/bruno-electron/src/ipc/collection.js
| const writeBrunoConfig = async (brunoConfig, collectionPath, collectionRoot) => { | ||
| const transformedBrunoConfig = transformBrunoConfigBeforeSave(brunoConfig); | ||
| const format = getCollectionFormat(collectionPath); |
There was a problem hiding this comment.
🗄️ 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.
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:
Summary by CodeRabbit
New Features
Bug Fixes