Skip to content

fix: 3144 - Unable to Select Multiple Files for Upload in Multipart Form#7873

Open
sharan-bruno wants to merge 3 commits intousebruno:mainfrom
sharan-bruno:fix/unable-to-select-multiple-files-for-upload-in-multipart-form
Open

fix: 3144 - Unable to Select Multiple Files for Upload in Multipart Form#7873
sharan-bruno wants to merge 3 commits intousebruno:mainfrom
sharan-bruno:fix/unable-to-select-multiple-files-for-upload-in-multipart-form

Conversation

@sharan-bruno
Copy link
Copy Markdown
Contributor

@sharan-bruno sharan-bruno commented Apr 28, 2026

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:

  • 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.

Before:
image

After:
image

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

    • Multipart form requests support selecting multiple files in one action; UI shows aggregated file counts for multi-file attachments.
  • Tests

    • Added end-to-end tests for multi-file selection, single-file fallback, and clearing attachments (verifies file count display and upload button visibility).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 366988e3-e4f5-44a2-8bb7-45e72e465c63

📥 Commits

Reviewing files that changed from the base of the PR and between ba32137 and 4440aa6.

📒 Files selected for processing (1)
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js

Walkthrough

Enables multi-file selection for multipart form file picking by passing ['multiSelections'] to browseFiles, and adds Playwright/Electron tests that verify multi-file selection, single-file display, and clearing attachments.

Changes

Multipart Form Multi-File Selection

Layer / File(s) Summary
Core UI behavior
packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js, packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js
handleBrowseFiles now calls browseFiles([], ['multiSelections']) to request multi-selection from the file dialog.
Test setup / fixtures
tests/request/multipart-form/multipart-form-multi-file-select.spec.ts
New serial Playwright/Electron test creates temp files, stubs electron.dialog.showOpenDialog to return controlled filePaths (multi and single), and restores original dialog after each test.
UI interaction tests
tests/request/multipart-form/multipart-form-multi-file-select.spec.ts
Three assertions: (1) uploading via first row shows 3 file(s), (2) single-file upload shows file1.txt, (3) clearing attachments restores upload button; each test saves the request.
Minor formatting
packages/bruno-app/src/components/ResponseExample/.../index.js
Whitespace-only reformat of onSave/onRun inline handlers (no logic change).

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno

Poem

🌟 A picker widened, multiple in sight,
Files gather neatly, three or just one light.
Tests march forward, dialogs play their part,
Rows fill, clear, and save — a tiny work of art.

🚥 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 accurately describes the main fix: enabling multi-file selection in the multipart form file picker, addressing the regression from v3 mentioned in the PR objectives.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Review rate limit: 6/8 reviews remaining, refill in 10 minutes and 40 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between a305b41 and 19c0f74.

📒 Files selected for processing (3)
  • packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js
  • tests/request/multipart-form/multipart-form-multi-file-select.spec.ts
  • tests/request/multipart-form/multipart-form-single-file-select.spec.ts


const handleBrowseFiles = useCallback((row, onChange) => {
dispatch(browseFiles())
dispatch(browseFiles([], ['multiSelections']))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

may need to do the same in ResponseExampleMultipartFormParams for consistency sake

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed - Added — updated ResponseExampleMultipartFormParams to use browseFiles([], ['multiSelections']) for consistency.

Copy link
Copy Markdown
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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 19c0f74 and ba32137.

📒 Files selected for processing (1)
  • tests/request/multipart-form/multipart-form-multi-file-select.spec.ts

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