Repository navigation
feat: multi-file upload in multipart form body - #7971
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a chip-based multi-file UI for multipart form params with responsive chip truncation (ResizeObserver), per-file removal, overflow dropdown, multi-select browse with path normalization and dedupe/merge, a multipart content-type helper, and Playwright/Jest tests and fixtures. ChangesMultipart File Chips UI with Multiple File Support
Sequence Diagram(s)sequenceDiagram
participant UI as MultipartFileChipsCell (UI)
participant Dialog as Electron dialog.showOpenDialog
participant Collection as Collection (collection.pathname)
participant Store as Request/Row state
UI->>Dialog: browseFiles([], ['multiSelections'])
Dialog-->>UI: selected absolute file paths
UI->>Collection: getRelativePath(selectedPath, collection.pathname)
Collection-->>UI: relative paths (when possible)
UI->>Store: merge/dedupe existing files + new relative paths (update param)
Store-->>UI: updated file list (render chips / overflow)
UI->>Store: onRemove(filePath) -> remove single path (downgrade to text if empty)
Store-->>UI: updated file list (re-render)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 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)
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js (1)
213-247:⚠️ Potential issue | 🟠 Major | ⚡ Quick winSelecting more files overwrites previous selection (and cancel wipes it too).
Two real problems here that don’t exist in the sibling
ResponseExampleMultipartFormParams.handleBrowseFiles:
- No merge/dedupe. When a user has already picked files and opens the dialog again to add more,
processedPathsreplaces the row’s existingvalueoutright. Users will reasonably expect adding files, not swapping them. The ResponseExample variant already merges + dedupes — please mirror that.- No cancel guard. If the user cancels the dialog (or selects nothing),
filePathsis[],processedPathsis[], and the row is set to{ type: 'file', value: [] }. That clobbers any previously selected files purely from opening and cancelling the picker. The ResponseExample variant guards with an early-return; this one should too.Bonus: the ResponseExample variant also auto-derives
contentTypefrom the first file viamime-types/path.extnamewhen none is set. Worth aligning so request-pane and example-pane behave identically.🐛 Proposed fix (merge + cancel guard; optionally mirror content-type detection)
const handleBrowseFiles = useCallback((row, onChange) => { dispatch(browseFiles([], ['multiSelections'])) .then((filePaths) => { + if (!Array.isArray(filePaths) || filePaths.length === 0) return; + const processedPaths = filePaths.map((filePath) => { const collectionDir = collection.pathname; if (filePath.startsWith(collectionDir)) { return path.relative(collectionDir, filePath); } return filePath; }); const currentParams = item.draft ? get(item, 'draft.request.body.multipartForm') : get(item, 'request.body.multipartForm'); - const existsInParams = (currentParams || []).some((p) => p.uid === row.uid); + const existingParam = (currentParams || []).find((p) => p.uid === row.uid); + const existingValue = existingParam && existingParam.type === 'file' && Array.isArray(existingParam.value) + ? existingParam.value + : []; + const merged = [...existingValue]; + for (const p of processedPaths) { + if (!merged.includes(p)) merged.push(p); + } let updatedParams; - if (existsInParams) { + if (existingParam) { updatedParams = currentParams.map((p) => { if (p.uid === row.uid) { - return { ...p, type: 'file', value: processedPaths }; + return { ...p, type: 'file', value: merged }; } return p; }); } else { updatedParams = [ ...(currentParams || []), - { uid: row.uid, name: row.name || '', enabled: true, type: 'file', value: processedPaths, contentType: '' } + { uid: row.uid, name: row.name || '', enabled: true, type: 'file', value: merged, contentType: '' } ]; } handleParamsChange(updatedParams); }) .catch((error) => { console.error(error); }); }, [dispatch, collection.pathname, item, handleParamsChange]);🤖 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-app/src/components/RequestPane/MultipartFormParams/index.js` around lines 213 - 247, handleBrowseFiles currently replaces the row's file list and also clobbers it if the picker is cancelled; change it to early-return when filePaths is empty (or undefined) to avoid wiping previous selections, and instead of overwriting when existsInParams is true, merge processedPaths with the existing p.value and dedupe (e.g., concat existing p.value and processedPaths then filter unique) before setting p.type='file' and p.value to the merged array; when creating a new param entry, set value to the processedPaths (non-empty) and derive contentType from the first file if contentType is falsy by using path.extname + mime-types lookup to mirror ResponseExampleMultipartFormParams behavior, then call handleParamsChange with the updatedParams.
🧹 Nitpick comments (7)
packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js (2)
142-143: 💤 Low valueEmpty
<div className="file-chips-row" />in the collapsed branch.This renders an empty flex row alongside the summary dropdown. If it’s there to preserve cell width/flex layout, a brief inline comment would help; otherwise it can be removed.
🤖 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-app/src/components/RequestPane/MultipartFormParams/index.js` around lines 142 - 143, The empty self-closing div with className "file-chips-row" in the collapsed branch of the MultipartFormParams component is rendering an unnecessary flex row; either remove this element or replace it with a clear intent comment/placeholder. Locate the collapsed render branch (around the JSX that returns the summary dropdown and the empty <div className="file-chips-row" />) and: if the element is not required for layout, delete it; if it is required to preserve spacing, add a brief inline comment like "preserve flex spacing for summary" or replace it with a semantic spacer element (e.g., a <div aria-hidden> spacer) and ensure it has explanatory text in the code next to the "file-chips-row" reference so future readers understand why it remains.
38-69: 💤 Low valueSplit this effect and memoize the files array from parent.
The observer is torn down and recreated on every render because the parent generates a fresh
filesarray on line 306 (const files = row.type === 'file' ? getFileList(value) : []). Split into two effects: one for the observer (depends only on the DOM element), another for the compute call (depends onfiles.length). This keeps the observer stable and prevents unnecessary teardown cycles. Also have the parent memoize the files array so it only changes when content actually changes.Alternatively, consider moving to a ref callback pattern with ResizeObserver for React 19 StrictMode compatibility (avoids double-invoke issues), but that's a larger refactor.
🤖 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-app/src/components/RequestPane/MultipartFormParams/index.js` around lines 38 - 69, The current useLayoutEffect recreates the ResizeObserver whenever the parent passes a new files array; split this into two effects: (1) an effect that creates and manages the ResizeObserver (use the existing containerRef and observe the td element) which should only depend on DOM refs (no files) so the observer is stable, and (2) a separate effect that runs the compute logic (the compute function or its body) which depends only on files.length and calls setVisibleCount; also change the parent to memoize the files array (the code that does const files = row.type === 'file' ? getFileList(value) : []) so files identity only changes when content changes (e.g., wrap getFileList result in useMemo) to avoid unnecessary recomputations.tests/request/multipart-form/multipart-form-file-chips.spec.ts (2)
69-80: ⚡ Quick win
beforeEachonly trims rows; doesn’t reset row 0’s file state.After the first test mutates row 0 into a
file-type row with chips, the loop here only deletes extra rows (rowCount > 1) and saves. The subsequent test still starts on that same file-typed row and uploads onto it. Today it passes because RequestPane overwrites with the new selection, but it’s fragile to behavior changes (e.g. if upload starts merging like the ResponseExample variant, chip counts would diverge).Consider explicitly resetting row 0 (e.g., removing the only remaining row via the row’s remove control if available, or driving the row back to an empty/text state) so each test starts from a known-clean slate.
🤖 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 `@tests/request/multipart-form/multipart-form-file-chips.spec.ts` around lines 69 - 80, The beforeEach currently only removes extra rows and leaves row 0 potentially in a mutated file/chips state; update the setup in the test.beforeEach (the block using buildCommonLocators(page).table('editable-table'), table.allRows(), table.rowDeleteButton and saveRequest) to explicitly reset the remaining row: either remove row 0 with the table.rowDeleteButton for that row (or click the row’s remove control) and/or drive the UI to switch row 0 back to an empty/text type before calling saveRequest, ensuring each test starts from a known-clean single-row state.
93-115: ⚡ Quick winWrap test bodies in
test.stepfor richer reports.Per coding guidelines, please promote
test.stepusage. The two test cases each have a couple of clear logical phases (upload, assert chip render; upload, remove a chip, assert) that read well as steps.♻️ Suggested structure
test('uploading multiple files shows one chip per file', async ({ page, electronApp }) => { - await uploadFiles(page, electronApp, [fileA, fileB, fileC]); - - const chips = page.locator('.file-chip'); - await expect(chips).toHaveCount(3); - await expect(chips.nth(0).locator('.file-chip-name')).toHaveText('alpha.txt'); - await expect(chips.nth(1).locator('.file-chip-name')).toHaveText('beta.txt'); - await expect(chips.nth(2).locator('.file-chip-name')).toHaveText('gamma.txt'); + await test.step('upload three files', async () => { + await uploadFiles(page, electronApp, [fileA, fileB, fileC]); + }); + + await test.step('renders one chip per file with correct names', async () => { + const chips = page.locator('.file-chip'); + await expect(chips).toHaveCount(3); + await expect(chips.nth(0).locator('.file-chip-name')).toHaveText('alpha.txt'); + await expect(chips.nth(1).locator('.file-chip-name')).toHaveText('beta.txt'); + await expect(chips.nth(2).locator('.file-chip-name')).toHaveText('gamma.txt'); + }); });As per coding guidelines: “Promote the use of
test.stepas much as possible so the generated reports are easier to read”.🤖 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 `@tests/request/multipart-form/multipart-form-file-chips.spec.ts` around lines 93 - 115, Wrap the logical phases of each test in test.step calls: for the "uploading multiple files shows one chip per file" test, add test.step("upload files", ...) around the uploadFiles(page, electronApp, [fileA, fileB, fileC]) call and test.step("assert chips rendered", ...) around the expectations that reference the chips locator ('.file-chip') and the '.file-chip-name' checks; for the "each chip can be removed individually" test, add test.step("upload files", ...) around the uploadFiles call, test.step("remove beta chip", ...) around the chips.filter(...).locator('.file-chip-remove').click() action, and test.step("assert remaining chips", ...) around the subsequent expectations that use chips.filter({ hasText: ... }) and toHaveCount assertions so the report shows upload, action, and verification phases.packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js (2)
226-229: 💤 Low valueDedupe is O(n²) — fine for typical inputs, but worth noting.
merged.includes(p)inside the loop is quadratic. With user-driven file pickers this will never matter, but if you ever programmatically batch-add hundreds of paths, switch to aSet:♻️ Optional refactor
- const merged = [...existingValue]; - for (const p of processedPaths) { - if (!merged.includes(p)) merged.push(p); - } + const seen = new Set(existingValue); + const merged = [...existingValue]; + for (const p of processedPaths) { + if (!seen.has(p)) { + seen.add(p); + merged.push(p); + } + }🤖 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-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js` around lines 226 - 229, The current merging loop uses merged.includes(p) causing O(n²) behavior; change it to use a Set for O(1) membership checks: create a Set from existingValue (e.g., const seen = new Set(existingValue)), keep merged as a copy of existingValue, then for each p in processedPaths do if (!seen.has(p)) { seen.add(p); merged.push(p); } — update the code around merged, existingValue, and processedPaths accordingly to preserve original order while avoiding quadratic checks.
29-173: 💤 Low valueNear-identical
FileChipsCellduplicated with the RequestPane copy.The whole component,
basename, and the four sizing constants are duplicated between this file andpackages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js, moduloeditModegates. With only two consumers it’s under the “3+ places before abstracting” threshold, so leave as-is unless a third caller materializes — just keep them in sync when one side changes (e.g., the cancel-guard fix on the request side).As per coding guidelines: “Avoid abstractions unless the exact same code is being used in more than 3 places.”
🤖 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-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js` around lines 29 - 173, Duplicate FileChipsCell and its helpers (basename, MIN_CHIP_W, CHIP_GAP, UPLOAD_RESERVE, MORE_CHIP_RESERVE) exist intentionally between this component and the RequestPane MultipartFormParams copy; do not refactor now — instead, when changing behavior (e.g., the cancel-guard fix applied in the request-side copy) update both implementations to keep them in sync. Locate the FileChipsCell function and the basename/constant definitions in this file and the corresponding MultipartFormParams copy and apply identical changes to both (preserve the editMode gating here), ensuring event handlers (onRemove/onAdd), ResizeObserver logic, and visibleCount computation remain consistent across the two copies.packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/StyledWrapper.js (1)
257-319: 💤 Low valueConsider extracting the duplicated
OverflowListstyling.The exact same
OverflowListblock also lives inpackages/bruno-app/src/components/RequestPane/MultipartFormParams/StyledWrapper.js. Two-place duplication is within the “3+ places before abstracting” bar, so feel free to leave it — flagging in case a third consumer appears.As per coding guidelines: “Avoid abstractions unless the exact same code is being used in more than 3 places.”
🤖 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-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/StyledWrapper.js` around lines 257 - 319, Duplicate OverflowList styled block should be extracted into a shared styled component: create a new exported styled component (e.g. StyledOverflowList or OverflowListShared) in a common styles module, move the full CSS (including .overflow-row, .overflow-row-icon, .overflow-row-name, .overflow-row-remove and the hover/theme prop logic) into it, then replace the local OverflowList definitions with imports of that shared component in both places where OverflowList currently exists; ensure the theme prop usage is preserved and update imports/exports accordingly so both StyledWrapper.js files use the single shared OverflowList component.
🤖 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-app/src/components/RequestPane/MultipartFormParams/index.js`:
- Around line 23-27: The basename function can return wrong results for
mixed-separator paths; update the implementation in the basename function to use
Node's path module (e.g., path.basename) or normalize/split on both separators
instead of relying on isWindowsOS() ? '\\' : '/'. Locate the basename function
and replace the single-separator split logic with a call to
path.basename(String(filePath)) (or, if avoiding path, split on / and \\ and
take the last segment), ensuring String(filePath) is still handled and
empty/undefined inputs return '' as before.
---
Outside diff comments:
In `@packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js`:
- Around line 213-247: handleBrowseFiles currently replaces the row's file list
and also clobbers it if the picker is cancelled; change it to early-return when
filePaths is empty (or undefined) to avoid wiping previous selections, and
instead of overwriting when existsInParams is true, merge processedPaths with
the existing p.value and dedupe (e.g., concat existing p.value and
processedPaths then filter unique) before setting p.type='file' and p.value to
the merged array; when creating a new param entry, set value to the
processedPaths (non-empty) and derive contentType from the first file if
contentType is falsy by using path.extname + mime-types lookup to mirror
ResponseExampleMultipartFormParams behavior, then call handleParamsChange with
the updatedParams.
---
Nitpick comments:
In `@packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js`:
- Around line 142-143: The empty self-closing div with className
"file-chips-row" in the collapsed branch of the MultipartFormParams component is
rendering an unnecessary flex row; either remove this element or replace it with
a clear intent comment/placeholder. Locate the collapsed render branch (around
the JSX that returns the summary dropdown and the empty <div
className="file-chips-row" />) and: if the element is not required for layout,
delete it; if it is required to preserve spacing, add a brief inline comment
like "preserve flex spacing for summary" or replace it with a semantic spacer
element (e.g., a <div aria-hidden> spacer) and ensure it has explanatory text in
the code next to the "file-chips-row" reference so future readers understand why
it remains.
- Around line 38-69: The current useLayoutEffect recreates the ResizeObserver
whenever the parent passes a new files array; split this into two effects: (1)
an effect that creates and manages the ResizeObserver (use the existing
containerRef and observe the td element) which should only depend on DOM refs
(no files) so the observer is stable, and (2) a separate effect that runs the
compute logic (the compute function or its body) which depends only on
files.length and calls setVisibleCount; also change the parent to memoize the
files array (the code that does const files = row.type === 'file' ?
getFileList(value) : []) so files identity only changes when content changes
(e.g., wrap getFileList result in useMemo) to avoid unnecessary recomputations.
In
`@packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js`:
- Around line 226-229: The current merging loop uses merged.includes(p) causing
O(n²) behavior; change it to use a Set for O(1) membership checks: create a Set
from existingValue (e.g., const seen = new Set(existingValue)), keep merged as a
copy of existingValue, then for each p in processedPaths do if (!seen.has(p)) {
seen.add(p); merged.push(p); } — update the code around merged, existingValue,
and processedPaths accordingly to preserve original order while avoiding
quadratic checks.
- Around line 29-173: Duplicate FileChipsCell and its helpers (basename,
MIN_CHIP_W, CHIP_GAP, UPLOAD_RESERVE, MORE_CHIP_RESERVE) exist intentionally
between this component and the RequestPane MultipartFormParams copy; do not
refactor now — instead, when changing behavior (e.g., the cancel-guard fix
applied in the request-side copy) update both implementations to keep them in
sync. Locate the FileChipsCell function and the basename/constant definitions in
this file and the corresponding MultipartFormParams copy and apply identical
changes to both (preserve the editMode gating here), ensuring event handlers
(onRemove/onAdd), ResizeObserver logic, and visibleCount computation remain
consistent across the two copies.
In
`@packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/StyledWrapper.js`:
- Around line 257-319: Duplicate OverflowList styled block should be extracted
into a shared styled component: create a new exported styled component (e.g.
StyledOverflowList or OverflowListShared) in a common styles module, move the
full CSS (including .overflow-row, .overflow-row-icon, .overflow-row-name,
.overflow-row-remove and the hover/theme prop logic) into it, then replace the
local OverflowList definitions with imports of that shared component in both
places where OverflowList currently exists; ensure the theme prop usage is
preserved and update imports/exports accordingly so both StyledWrapper.js files
use the single shared OverflowList component.
In `@tests/request/multipart-form/multipart-form-file-chips.spec.ts`:
- Around line 69-80: The beforeEach currently only removes extra rows and leaves
row 0 potentially in a mutated file/chips state; update the setup in the
test.beforeEach (the block using
buildCommonLocators(page).table('editable-table'), table.allRows(),
table.rowDeleteButton and saveRequest) to explicitly reset the remaining row:
either remove row 0 with the table.rowDeleteButton for that row (or click the
row’s remove control) and/or drive the UI to switch row 0 back to an empty/text
type before calling saveRequest, ensuring each test starts from a known-clean
single-row state.
- Around line 93-115: Wrap the logical phases of each test in test.step calls:
for the "uploading multiple files shows one chip per file" test, add
test.step("upload files", ...) around the uploadFiles(page, electronApp, [fileA,
fileB, fileC]) call and test.step("assert chips rendered", ...) around the
expectations that reference the chips locator ('.file-chip') and the
'.file-chip-name' checks; for the "each chip can be removed individually" test,
add test.step("upload files", ...) around the uploadFiles call,
test.step("remove beta chip", ...) around the
chips.filter(...).locator('.file-chip-remove').click() action, and
test.step("assert remaining chips", ...) around the subsequent expectations that
use chips.filter({ hasText: ... }) and toHaveCount assertions so the report
shows upload, action, and verification phases.
🪄 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: efe9e05e-c9aa-417f-83a0-b34d3a74d6f0
📒 Files selected for processing (5)
packages/bruno-app/src/components/RequestPane/MultipartFormParams/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/MultipartFormParams/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.jstests/request/multipart-form/multipart-form-file-chips.spec.ts
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-app/src/components/RequestPane/MultipartFormParams/index.js`:
- Around line 89-101: The multipart file param handling in MultipartFormParams
is missing automatic contentType detection, causing UX inconsistency with
ResponseExampleMultipartFormParams; update the logic in the block that
constructs updatedParams (the branch that returns { uid: row.uid, ... type:
'file', value: merged, contentType: '' } and the branch that sets type: 'file',
value: merged) to set contentType to mime.contentType(path.extname(merged[0]))
when merged is a non-empty array (falling back to '' if detection returns
falsy), and add the required imports for mime and path at the top of the file so
contentType is inferred the same way as in ResponseExampleMultipartFormParams.
🪄 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: 7aa71e9d-708b-4194-bd38-945d2ea39430
📒 Files selected for processing (7)
packages/bruno-app/src/components/MultipartFileChipsCell/StyledWrapper.jspackages/bruno-app/src/components/MultipartFileChipsCell/index.jspackages/bruno-app/src/components/RequestPane/MultipartFormParams/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/MultipartFormParams/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.jstests/request/multipart-form/multipart-form-file-chips.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/request/multipart-form/multipart-form-file-chips.spec.ts
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 `@tests/response-examples/multipart-form-chips.spec.ts`:
- Around line 13-14: Replace the two uses of execSync that interpolate
fixturePath with execFileSync and pass the command and arguments as arrays to
avoid shell parsing; specifically, change the execSync calls that run "git
ls-files --error-unmatch \"${fixturePath}\"" and "git checkout --
\"${fixturePath}\"" to use child_process.execFileSync('git',
['ls-files','--error-unmatch', fixturePath], { stdio: 'ignore' }) and
execFileSync('git', ['checkout','--', fixturePath], { stdio: 'ignore' })
respectively, keeping the same options (stdio: 'ignore') and referencing the
existing fixturePath variable and the execSync symbol to locate the
replacements.
🪄 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: 13e9d575-7f1c-4b9d-ab74-75f8ca11cbef
📒 Files selected for processing (2)
tests/response-examples/fixtures/collection/multipart-example.brutests/response-examples/multipart-form-chips.spec.ts
✅ Files skipped from review due to trivial changes (1)
- tests/response-examples/fixtures/collection/multipart-example.bru
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-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js`:
- Around line 65-77: In handleBrowseFiles where existingValue is computed,
normalize legacy string values by checking if existingParam.value is a string
and wrapping it into an array (e.g., [existingParam.value]) before treating it
as existingValue; currently the code only handles arrays and drops single-string
legacy values, so update the logic that defines existingValue (referencing
existingParam, existingValue, processedPaths, and getMultipartAutoContentType)
to accept string or array and produce a consistent array to merge with
processedPaths.
🪄 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: 69e3c8eb-cf99-40b5-9497-c87b5054a167
📒 Files selected for processing (4)
packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.jspackages/bruno-app/src/utils/common/multipartContentType.jspackages/bruno-app/src/utils/common/multipartContentType.spec.js
✅ Files skipped from review due to trivial changes (2)
- packages/bruno-app/src/utils/common/multipartContentType.js
- packages/bruno-app/src/utils/common/multipartContentType.spec.js
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js
e0edc10 to
2c488a4
Compare
…ltipart-multi-file-upload # Conflicts: # packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js # packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js
Description
Upgrades the multipart form body UI to support multi-file uploads properly.
JIRA
Contribution Checklist:
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.
Screen.Recording.2026-05-11.at.3.33.04.PM.mov
Summary by CodeRabbit
New Features
Tests
Utilities