fix: 3144 - Unable to Select Multiple Files for Upload in Multipart Form#7873
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughEnables multi-file selection for multipart form file picking by passing ChangesMultipart Form Multi-File Selection
Sequence Diagram(s)sequenceDiagram
participant Renderer as Renderer UI
participant Main as Electron Main (dialog)
participant Store as App Store
Renderer->>Main: browseFiles([],[ 'multiSelections' ])
Main-->>Renderer: filePaths[] (1..N)
Renderer->>Store: merge multipartForm params with filePaths
Store-->>Renderer: updated multipartForm state
Renderer->>Renderer: update attachments table UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Review rate limit: 6/8 reviews remaining, refill in 10 minutes and 40 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/request/multipart-form/multipart-form-multi-file-select.spec.ts`:
- Around line 21-28: The tear-down is removing the saved original handler so
subsequent tests can't restore it; update the test.afterEach hook (where
dialog.showOpenDialog and (dialog as any).__originalShowOpenDialog are
referenced) to restore the original by assigning dialog.showOpenDialog = (dialog
as any).__originalShowOpenDialog when that property exists but do NOT delete
(dialog as any).__originalShowOpenDialog; alternatively, only set (dialog as
any).__originalShowOpenDialog when it is undefined (so first stub saves the
original) and always restore from it in afterEach — apply the same change for
the other occurrence around lines 98-103.
🪄 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: 02b6b01f-8c22-4366-bb5a-316c14401c02
📒 Files selected for processing (3)
packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.jstests/request/multipart-form/multipart-form-multi-file-select.spec.tstests/request/multipart-form/multipart-form-single-file-select.spec.ts
|
|
||
| const handleBrowseFiles = useCallback((row, onChange) => { | ||
| dispatch(browseFiles()) | ||
| dispatch(browseFiles([], ['multiSelections'])) |
There was a problem hiding this comment.
may need to do the same in ResponseExampleMultipartFormParams for consistency sake
There was a problem hiding this comment.
Agreed - Added — updated ResponseExampleMultipartFormParams to use browseFiles([], ['multiSelections']) for consistency.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/request/multipart-form/multipart-form-multi-file-select.spec.ts`:
- Around line 29-31: The suite-level hooks test.beforeAll and test.afterAll are
using the test-scoped fixture page (seen in the call to
closeAllCollections(page)), which Playwright disallows; remove the page
parameter from those hooks and move the collection setup/cleanup into per-test
hooks or switch to a worker-scoped fixture. Update test.beforeAll/test.afterAll
to either (a) not use page and perform only worker-scoped setup, or (b) move the
calls to closeAllCollections(page) into test.beforeEach and test.afterEach where
the page fixture is available, referencing the closeAllCollections helper and
any other code that currently relies on page.
🪄 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: c5171df9-7fdc-4764-8266-33567d1d5bfc
📒 Files selected for processing (1)
tests/request/multipart-form/multipart-form-multi-file-select.spec.ts
This PR restores the ability to select multiple files in the multipart form body editor file picker, fixing a regression introduced in v3.
Previously, the file browser was invoked without enabling multi-selection, restricting users to a single file. This change updates the multipart form file picker to pass the multiSelections property to the underlying browseFiles function.
With this fix, users can now select multiple files using shift-click or cmd/ctrl-click, and the selected files are correctly attached as separate form entries under the same key—matching the behavior from v2.
Contribution Checklist:
Before:

After:

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
New Features
Tests