Repository navigation
fix: refactor response examples to use MenuDropdown and Editable components - #6382
Conversation
WalkthroughReplaces per-item Dropdowns with a ref-capable MenuDropdown + ActionIcon trigger, migrates many Table-v2/ReorderTable usages to EditableTable, adds mime-types dependency and UID/url-syncing in example reducers, adjusts multiple styled wrappers/layouts, and tweaks ExampleIcon default color to Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Item as CollectionItem (UI)
participant Menu as MenuDropdown (ref)
participant Store as Redux
participant Modal as Modal/Toast
User->>Item: right-click or click menu-icon
Item->>Menu: menuDropdownRef.open(buildMenuItems(item))
Menu-->>User: renders menu
User->>Menu: select action (Rename/Clone/Generate/Delete/...)
Menu->>Item: invoke selected handler
alt handler updates state
Item->>Store: dispatch set/update/delete action
Store-->>Item: state updated
Item->>Modal: open modal or show toast
Modal-->>User: modal/toast shown
else handler opens UI only
Item->>Modal: open modal
Modal-->>User: modal shown
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js (1)
17-24: Redundant visibility rules for aria-expanded states.Both
div[aria-expanded='true']anddiv[aria-expanded='false']are set tovisibility: visible, making the distinction unnecessary. Consider simplifying:.dropdown { - div[aria-expanded='true'] { - visibility: visible; - } - div[aria-expanded='false'] { + div[aria-expanded] { visibility: visible; } }packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.js (1)
6-26: Duplicate.menu-iconstyles across StyledWrappers.This block is nearly identical to the one in
CollectionItem/StyledWrapper.js. Consider extracting shared menu-icon styles into a common mixin or a shared styled component to reduce duplication.packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js (1)
102-113: Simplify URL validation logic.The nested conditionals checking multiple URL sources are hard to follow. Consider extracting to a helper or simplifying:
const handleGenerateCode = () => { - // Check if example has a request URL - if ( - (example?.request?.url !== '' && example?.request?.url !== undefined) - || (item?.request?.url !== '' && item?.request?.url !== undefined) - || (item?.draft?.request?.url !== undefined && item?.draft?.request?.url !== '') - ) { + const hasUrl = [ + example?.request?.url, + item?.request?.url, + item?.draft?.request?.url + ].some((url) => url !== '' && url !== undefined); + + if (hasUrl) { setGenerateCodeItemModalOpen(true); } else { toast.error('URL is required'); } };packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (2)
491-500: Inconsistent URL validation between CollectionItem and ExampleItem.This URL check differs from
ExampleItem/index.js(Lines 102-112).ExampleItemalso checksexample?.request?.url, but more importantly, both use slightly different logic patterns. Consider extracting a sharedhasValidUrlutility for consistency.
289-410: Consider extracting menu item groups.
buildMenuItemsis quite long (~120 lines). For maintainability, consider extracting logical groups (e.g.,getFolderActions(),getRequestActions()) or at least adding section comments to delineate groups.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/bruno-app/src/components/Icons/ExampleIcon/index.js(1 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.js(2 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js(7 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js(2 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js(6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/Icons/ExampleIcon/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js
🧠 Learnings (4)
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Use styled component's theme prop to manage CSS colors and not CSS variables when in the context of a styled component or any React component using the styled component
Applied to files:
packages/bruno-app/src/components/Icons/ExampleIcon/index.js
📚 Learning: 2025-12-05T09:50:38.173Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6319
File: packages/bruno-app/src/components/Icons/IconBottombarToggle/index.js:5-5
Timestamp: 2025-12-05T09:50:38.173Z
Learning: In JSX/TSX files, use double quotes for JSX attributes (e.g., `<svg xmlns="..." viewBox="...">`), while using single quotes for regular JavaScript strings. This follows React conventions.
Applied to files:
packages/bruno-app/src/components/Icons/ExampleIcon/index.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Components are used as wrappers to define both self and children components style; Tailwind classes are used specifically for layout based styles
Applied to files:
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Component CSS might also change layout but Tailwind classes shouldn't define colors
Applied to files:
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - macOS
- GitHub Check: CLI Tests
- GitHub Check: Unit Tests
- GitHub Check: Playwright E2E Tests
🔇 Additional comments (4)
packages/bruno-app/src/components/Icons/ExampleIcon/index.js (1)
13-13: Verify clipPath fill behavior withcurrentColor.ClipPath rectangles define the clipping region shape—typically filled with a neutral color like
white. Using{color}(which defaults tocurrentColor) may cause unexpected behavior if the inherited color is transparent or varies. Consider keepingfill="white"for the clipPath rect.packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js (2)
129-163: LGTM!Clean declarative menu definition with appropriate test IDs. The structure is clear and maintainable.
196-204: LGTM!MenuDropdown integration with ActionIcon trigger is clean. The placement and test IDs are properly configured.
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (1)
661-669: LGTM!Clean MenuDropdown integration matching the pattern used in ExampleItem. The migration from right-click context menus to this declarative approach improves consistency.
There was a problem hiding this comment.
Actionable comments posted: 6
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/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js (1)
128-141: Potentialundefinedvalues in reordered params array.Same issue as in
ResponseExampleFormUrlEncodedParams: if a uid isn't found inparams, the resulting array will containundefined.const handleParamDrag = useCallback(({ updateReorderedItem }) => { if (!editMode) return; const reorderedParams = updateReorderedItem.map((uid) => { return params.find((p) => p.uid === uid); - }); + }).filter(Boolean); dispatch(updateResponseExampleMultipartFormParams({
🧹 Nitpick comments (8)
packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js (1)
8-15: Optional: clean up timeout and align the comment with behaviorThe comment mentions showing a loading spinner, but the component just returns
nulluntil the timeout fires. Also, thesetTimeoutisn’t cleared on unmount, which is a minor footgun. Consider either:
- Updating the comment to match current behavior, and/or
- Storing the timeout id and calling
clearTimeoutin a cleanup function fromuseEffect.packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleBodyMode/index.js (1)
17-45: Consider consistent array initialization across all array-typed body modes.The
filemode uses an explicitArray.isArray()check (line 38), whileformUrlEncodedandmultipartFormrely on the||operator for defaults. For defensive programming and consistency, apply the same Array.isArray pattern to all array fields.Apply this diff to make array handling consistent:
case 'formUrlEncoded': - newBody.formUrlEncoded = body?.formUrlEncoded || []; + newBody.formUrlEncoded = Array.isArray(body?.formUrlEncoded) ? body.formUrlEncoded : []; break; case 'multipartForm': - newBody.multipartForm = body?.multipartForm || []; + newBody.multipartForm = Array.isArray(body?.multipartForm) ? body.multipartForm : []; break;packages/bruno-app/src/components/BodyModeSelector/index.js (1)
40-48: Add displayName for better debugging.The forwardRef component lacks a displayName, which makes debugging with React DevTools harder.
const Icon = forwardRef((props, ref) => { return ( <div ref={ref} className="flex items-center justify-center pl-3 py-1 select-none selected-body-mode"> {humanizeRequestBodyMode(currentMode)} {' '} <IconCaretDown className="caret ml-2" size={14} strokeWidth={2} /> </div> ); }); + Icon.displayName = 'BodyModeSelectorIcon';packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (1)
19-26: Redundant dependency and potential stale state.
Line 24: Including
itemin dependencies is redundant sinceitem.draftanditem.examplesare already listed.Line 26:
enabledFileUidis initialized once fromparams[0].uidbut won't sync ifparamschanges externally (e.g., undo/redo, external updates). This could lead to the radio button selection being out of sync.Consider removing redundant dependency and syncing state:
}, [item.draft, item.examples, item, exampleUid]); + }, [item.draft, item.examples, exampleUid]);For state sync, consider using
useEffectto updateenabledFileUidwhen params change, or derive it directly fromparamsif selection should always reflect the data.packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js (1)
53-60: Pragmatic override for nested EditableTable styling.The
!importantdeclarations are necessary here to override the parent's uppercase transformation for the nested EditableTable. The comment explaining the purpose is helpful.Consider whether this override pattern might be needed in other StyledWrappers that embed EditableTable. If so, extracting to a shared mixin or utility could reduce duplication.
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js (1)
89-97: Minor: Redundant null coalescing.
params || []on line 91 is unnecessary sinceparamsis already defaulted to[]in theuseMemoon lines 14-18.<EditableTable columns={columns} - rows={params || []} + rows={params} onChange={handleParamsChange}tests/response-examples/menu-operations.spec.ts (1)
25-31: Consider replacingwaitForSelectorwith Playwright'sexpectassertion.Using
expect().not.toBeVisible()orexpect().toBeAttached({ attached: false })is more idiomatic in Playwright and provides better error messages.await page.getByRole('button', { name: 'Create Example' }).click(); // Wait for modal to close - await page.waitForSelector('text=Save Response as Example', { state: 'detached' }); + await expect(page.getByText('Save Response as Example')).not.toBeVisible(); await page.locator('.collection-item-name').filter({ hasText: 'menu-operations' }).getByTestId('request-item-chevron').click();packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js (1)
134-142: Minor: Redundant null coalescing.
headers || []on line 136 is unnecessary sinceheadersalready defaults to[]in theuseMemoon lines 20-24.<EditableTable columns={columns} - rows={headers || []} + rows={headers} onChange={handleHeadersChange}
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/BodyModeSelector/index.js(2 hunks)packages/bruno-app/src/components/EditableTable/StyledWrapper.js(2 hunks)packages/bruno-app/src/components/EditableTable/index.js(1 hunks)packages/bruno-app/src/components/RequestTabPanel/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js(2 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleBodyMode/index.js(1 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js(2 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js(3 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js(5 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js(4 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js(5 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js(5 hunks)packages/bruno-app/src/components/ResponseExample/StyledWrapper.js(1 hunks)packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js(3 hunks)packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js(1 hunks)tests/response-examples/menu-operations.spec.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.jspackages/bruno-app/src/components/RequestTabPanel/StyledWrapper.jspackages/bruno-app/src/components/EditableTable/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleBodyMode/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.jspackages/bruno-app/src/components/BodyModeSelector/StyledWrapper.jstests/response-examples/menu-operations.spec.tspackages/bruno-app/src/components/BodyModeSelector/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.jspackages/bruno-app/src/components/ResponseExample/StyledWrapper.jspackages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.jspackages/bruno-app/src/components/EditableTable/StyledWrapper.js
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/response-examples/menu-operations.spec.ts
🧠 Learnings (5)
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Component CSS might also change layout but Tailwind classes shouldn't define colors
Applied to files:
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.jspackages/bruno-app/src/components/EditableTable/index.jspackages/bruno-app/src/components/BodyModeSelector/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.jspackages/bruno-app/src/components/EditableTable/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Components are used as wrappers to define both self and children components style; Tailwind classes are used specifically for layout based styles
Applied to files:
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.jspackages/bruno-app/src/components/BodyModeSelector/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.jspackages/bruno-app/src/components/EditableTable/StyledWrapper.js
📚 Learning: 2025-12-02T09:45:31.709Z
Learnt from: sid-bruno
Repo: usebruno/bruno PR: 6266
File: packages/bruno-app/src/components/ResponsePane/ResponseCopy/index.js:38-38
Timestamp: 2025-12-02T09:45:31.709Z
Learning: In the ResponseCopy component (packages/bruno-app/src/components/ResponsePane/ResponseCopy/index.js), the copy button is intentionally disabled using `!response.data` to prevent copying stream resets which result in empty strings.
Applied to files:
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleBodyMode/index.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Use styled component's theme prop to manage CSS colors and not CSS variables when in the context of a styled component or any React component using the styled component
Applied to files:
packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.test.{js,jsx,ts,tsx} : Add tests for any new functionality or meaningful changes. If code is added, removed, or significantly modified, corresponding tests should be updated or created
Applied to files:
tests/response-examples/menu-operations.spec.ts
🧬 Code graph analysis (8)
packages/bruno-app/src/components/EditableTable/index.js (1)
packages/bruno-app/src/components/EditableTable/StyledWrapper.js (1)
StyledWrapper(3-152)
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (4)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js (1)
headers(20-24)packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js (1)
headers(21-23)packages/bruno-app/src/utils/collections/index.js (3)
headers(966-966)headers(1212-1212)params(965-965)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js (1)
params(17-21)
packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js (3)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js (3)
handleHeadersChange(26-35)headers(20-24)dispatch(16-16)packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (34)
setResponseExampleHeaders(312-339)setResponseExampleHeaders(312-339)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)packages/bruno-app/src/components/EditableTable/index.js (2)
isLastEmptyRow(76-79)EditableTable(7-316)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (3)
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (34)
updateResponseExampleFileBodyParams(525-559)updateResponseExampleFileBodyParams(525-559)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)packages/bruno-app/src/components/FilePickerEditor/index.js (1)
FilePickerEditor(8-74)packages/bruno-app/src/components/EditableTable/index.js (2)
isLastEmptyRow(76-79)EditableTable(7-316)
packages/bruno-app/src/components/BodyModeSelector/index.js (2)
packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js (1)
StyledWrapper(3-36)packages/bruno-app/src/components/Dropdown/index.js (1)
Dropdown(5-25)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js (3)
packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js (5)
handleHeadersChange(29-65)dispatch(17-17)columns(119-163)defaultRow(165-168)headers(21-23)packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (34)
setResponseExampleRequestHeaders(904-931)setResponseExampleRequestHeaders(904-931)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)packages/bruno-app/src/components/EditableTable/index.js (1)
EditableTable(7-316)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js (3)
packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js (8)
handleParamsChange(27-33)dispatch(20-20)handleBrowseFiles(43-68)params(22-22)handleValueChange(81-95)getFileName(97-110)columns(112-193)defaultRow(195-200)packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (34)
updateResponseExampleMultipartFormParams(489-523)updateResponseExampleMultipartFormParams(489-523)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)packages/bruno-app/src/components/EditableTable/index.js (3)
handleValueChange(81-128)isLastEmptyRow(76-79)EditableTable(7-316)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js (2)
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (36)
setResponseExampleParams(933-961)setResponseExampleParams(933-961)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)moveResponseExampleParam(462-486)moveResponseExampleParam(462-486)packages/bruno-app/src/components/EditableTable/index.js (2)
isLastEmptyRow(76-79)EditableTable(7-316)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: CLI Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - macOS
- GitHub Check: Playwright E2E Tests
- GitHub Check: Unit Tests
🔇 Additional comments (36)
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js (1)
18-24:.flex-boundaryflex tweaks look good and align with layout wrapper usageAdding
min-width: 0and switching.flex-boundarytoflex-direction: columnis a sensible change for a height‑bounded flex container: it avoids horizontal overflow from long content and stacks children vertically to better match a “new UI” style, without impacting the external API ofHeightBoundContainer. From the styled‑wrapper perspective this remains consistent with using styled‑components to own layout/overflow boundaries while Tailwind handles higher‑level layout.Based on learnings, styled wrappers defining boundaries & layout here match the repo’s preferred pattern.
packages/bruno-app/src/components/ResponseExample/StyledWrapper.js (1)
12-18: LGTM — solid flexbox fixes.
flex-shrink: 0keeps the request pane from collapsing, andmin-width: 0is the classic fix for allowing flex children to shrink below their content size (preventing overflow). These integrate cleanly with the existing vertical-layout overrides below.packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js (1)
3-3: Swap toGradientCloseButtonlooks good; confirmhasChangesusageThe move to
GradientCloseButtonwithonClick={handleCloseClick}matches the rest of the UI refresh. One thing to double‑check: shouldhasChangesalways betruefor a “Not Found” tab, or should it reflect actual dirty/changed state? IfhasChangescontrols a “modified” visual cue elsewhere, this might be the odd one out.Also applies to: 31-31
packages/bruno-app/src/components/RequestTabPanel/StyledWrapper.js (1)
12-18: The CSS implementation is correct and properly integrated.No changes needed. The
.request-paneand.response-paneclasses are correctly applied in the component JSX (lines 256 and response-pane section in index.js). The parent container hasdisplay: flexvia Tailwind'sflexclass. Themin-width: 0on.response-paneis a standard flexbox pattern that allows the pane to shrink below content width when the user drags the divider, and it works properly with theoverflow-x-autohandling already in place.packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js (1)
1-4: LGTM!Clean import and proper use of theme props for font sizing.
packages/bruno-app/src/components/BodyModeSelector/index.js (4)
2-11: LGTM!Icon imports are properly structured and all imported icons are used in the DEFAULT_MODES configuration.
14-14: LGTM!StyledWrapper import follows standards.
17-24: LGTM!DEFAULT_MODES properly extended with icon fields. Consistent structure across all mode definitions.
66-99: LGTM!Main render logic properly integrates StyledWrapper and icon rendering. Clean conditional rendering of icons with proper fallback handling. Follows all coding standards.
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (4)
1-12: LGTM!Imports are clean and appropriate for the component's functionality.
28-77: LGTM!The file path change handler cleanly handles both update and add scenarios with proper content-type auto-detection.
153-165: LGTM!The SingleLineEditor setup is appropriate for a content-type field. Empty
onSaveandonRuncallbacks are acceptable here since this field doesn't require those actions.
190-223: LGTM!The default row structure and render logic are well-implemented. Conditional rendering based on
editModeand empty state is handled correctly.packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (3)
332-338: LGTM — UID preservation for headers.Destructuring
uidfrom input and usinguid || uuid()ensures stable row identity when editing via EditableTable. This prevents unnecessary DOM reconciliation.
924-930: LGTM — Consistent UID preservation for request headers.Same pattern applied here as in
setResponseExampleHeaders. Good consistency.
953-960: LGTM — UID preservation for params with type support.Correctly preserves
uidand includestypein destructuring with a sensible default of'query'.packages/bruno-app/src/components/EditableTable/index.js (1)
226-226: LGTM — Class-based styling toggle.Using
className={showCheckbox ? 'has-checkbox' : 'no-checkbox'}is cleaner than nth-child selectors and properly decouples layout from column position. Aligns well with theStyledWrapper.jschanges.packages/bruno-app/src/components/EditableTable/StyledWrapper.js (2)
44-47: LGTM — Scoped header checkbox column styling.Gating the first column width and border removal behind
.has-checkboxensures these styles only apply when the checkbox column is rendered.
72-83: LGTM — Scoped body checkbox column styling.Good attention to detail with
vertical-align,line-height, and the nested checkbox input styling for proper alignment. This complements the header styling above.packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js (5)
1-12: LGTM — Clean imports for EditableTable migration.Import changes align with the shift from legacy table rendering to the unified EditableTable component.
29-65: Smart content-type synchronization.The logic to detect content-type header changes and automatically update the response body type is a solid UX improvement. The comparison
contentTypeHeader.value !== oldContentTypeHeader.valuecorrectly guards against unnecessary dispatches.One edge case: if a user adds a new content-type header (not updating an existing one),
oldContentTypeHeaderwill be undefined and this sync won't trigger. Likely acceptable behavior, but verify this is intentional.
67-78: LGTM — Reorder handler with edit mode guard.Clean delegation to the existing
moveResponseExampleHeaderaction with proper edit mode gating.
119-168: Well-structured columns definition.The column configuration follows established patterns from other EditableTable usages in this codebase. The
SingleLineEditorintegration with autocomplete for headers and MIME types is a nice touch.Note:
onSave={() => {}}andonRun={() => {}}are no-ops. Verify these are intentional for response headers context (no save-on-blur or run action needed).
172-181: LGTM — EditableTable integration.Props are correctly configured:
showCheckbox={false}since response headers don't need enable/disablereorderable={editMode}properly gates drag-and-dropshowAddRow={editMode}prevents adding rows in read-only modepackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js (1)
46-81: Clean column definitions and defaultRow structure.The columns configuration with
isKeyField,readOnlytoggle, and customMultiLineEditorrender is well-structured. ThedefaultRowaligns with the expected param schema.tests/response-examples/menu-operations.spec.ts (3)
6-11: Good test setup with proper cleanup.Serial execution prevents race conditions between tests modifying the same fixture. The
afterAllhook ensures the.brufile is reset, maintaining test isolation.
33-41: Well-structured row-based menu interaction.The pattern of locating by text, hovering, then clicking the scoped
.menu-iconis robust and aligns with the new MenuDropdown UI.
97-113: Thorough rename verification.Good approach asserting both that the old name is no longer visible and the new name is visible. This confirms the rename operation completed successfully.
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js (2)
26-46: Consistent handler patterns with useCallback.Both
handleHeadersChangeandhandleHeaderDragare properly memoized with correct dependencies. The drag handler delegates tomoveResponseExampleRequestHeader, which handles the reordering logic in the reducer.
91-106: VerifyallowNewlines={true}for header values.HTTP header values typically shouldn't contain newlines (they can cause header injection issues). This might be intentional for display purposes, but worth confirming the value is sanitized before being sent in actual requests.
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js (3)
37-91: Solid file browsing implementation.The logic correctly handles:
- Path relativization when files are within the collection directory
- Updating existing params vs creating new ones
- Auto-detection of content-type from the first file
Good alignment with the pattern in
RequestPane/MultipartFormParams.
110-126: Dual-path value change handling.The pattern of calling
handleParamsChangefor existing params and delegating toonChangefor new rows is intentional—it lets EditableTable manage the empty row lifecycle while ensuring persisted params update immediately. This works correctly with EditableTable's internal state management.
173-223: Well-structured conditional rendering for file vs text values.The value column render function cleanly handles three states:
- File selected → shows filename with clear button
- Text value → shows editor without upload button
- Empty → shows editor with upload button
UX is intuitive.
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js (3)
26-67: Correct merge logic for query and path params.The handlers properly merge updated query/path params with the other type before dispatching, ensuring the full params array is preserved. Dependencies are correctly listed.
144-171: Path params column configuration is appropriate.Setting
readOnly: trueon the name column is correct since path parameter names are derived from the URL template (e.g.,:id). Users should only edit the values.
221-230: Path params table correctly disabled for user additions.
showCheckbox,showDelete, andshowAddRoware allfalse, which is correct—path parameters are URL-driven and shouldn't be manually added/removed by users.
| .dropdown-item { | ||
| padding: 0.2rem 0.6rem !important; | ||
| padding-left: 1.5rem !important; | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .label-item { | ||
| padding: 0.2rem 0.6rem !important; | ||
| } |
There was a problem hiding this comment.
Avoid !important flags - indicates specificity issues.
Lines 11, 12, and 18 use !important to override padding. This is a code smell suggesting CSS specificity conflicts. Consider refactoring the selector hierarchy or increasing specificity naturally rather than forcing overrides.
.dropdown-item {
- padding: 0.2rem 0.6rem !important;
- padding-left: 1.5rem !important;
+ padding: 0.2rem 0.6rem;
+ padding-left: 1.5rem;
display: flex;
align-items: center;
}
.label-item {
- padding: 0.2rem 0.6rem !important;
+ padding: 0.2rem 0.6rem;
}If specificity issues persist, review the parent/global styles to identify the conflicting rules.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .dropdown-item { | |
| padding: 0.2rem 0.6rem !important; | |
| padding-left: 1.5rem !important; | |
| display: flex; | |
| align-items: center; | |
| } | |
| .label-item { | |
| padding: 0.2rem 0.6rem !important; | |
| } | |
| .dropdown-item { | |
| padding: 0.2rem 0.6rem; | |
| padding-left: 1.5rem; | |
| display: flex; | |
| align-items: center; | |
| } | |
| .label-item { | |
| padding: 0.2rem 0.6rem; | |
| } |
🤖 Prompt for AI Agents
In packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js around
lines 10 to 19, the .dropdown-item and .label-item rules use !important on
padding which masks specificity issues; remove the !important flags and instead
resolve specificity by either making the selector more specific (e.g., scope to
the component or add a parent class), refactor or override the conflicting
global/parent rules in a single higher-specificity selector, or move these
styles into the component-scoped style block so they naturally take precedence;
if conflicts persist, inspect the parent/global stylesheet to identify and
adjust the conflicting declarations rather than reintroducing !important.
There was a problem hiding this comment.
we use the similar code to force the behaviour else where in code too, where even we use .dropdown-item. I guess it is better to keep it to avoid any unintended styling issues. for now. This can be refactored at a later stage.
There was a problem hiding this comment.
@sanish-bruno, understood! Maintaining consistency with existing patterns makes sense, especially to avoid introducing style regressions across the codebase. Keeping the !important flags for now is a reasonable approach.
If you'd like to track this for future cleanup, I can help create an issue to refactor all .dropdown-item padding overrides across the codebase in one go. That way, the technical debt is documented and can be addressed systematically later. Let me know if you'd like me to do that!
🧠 Learnings used
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Components are used as wrappers to define both self and children components style; Tailwind classes are used specifically for layout based styles
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Use styled component's theme prop to manage CSS colors and not CSS variables when in the context of a styled component or any React component using the styled component
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Component CSS might also change layout but Tailwind classes shouldn't define colors
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js (1)
5-5: Remove unused import.The
updateResponseExampleParamimport is not used anywhere in the file.Apply this diff:
-import { moveResponseExampleParam, setResponseExampleParams, updateResponseExampleParam } from 'providers/ReduxStore/slices/collections'; +import { moveResponseExampleParam, setResponseExampleParams } from 'providers/ReduxStore/slices/collections';
🧹 Nitpick comments (2)
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js (1)
23-28:> * { flex: 1 1 0 }is risky—scope to intended child(ren).
This will force every direct child of.flex-boundaryto grow/shrink equally (including headers/toolbars/etc.) and can easily distort layouts. Consider targeting a specific wrapper/class instead of*..flex-boundary { width: 100%; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; - > * { + /* apply only to the scrollable content region */ + > .flex-content { flex: 1 1 0; min-height: 0; } }packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (1)
39-77: Consider removing unusedonChangeparameter.The
onChangecallback parameter (line 39, passed from line 141) is never invoked withinhandleFilePathChange. The function dispatches updates directly viahandleParamsChangeinstead. If EditableTable'sonChangecallback isn't needed here, remove it from the signature and the call site.- const handleFilePathChange = useCallback((row, newFilePath, onChange) => { + const handleFilePathChange = useCallback((row, newFilePath) => { if (!editMode) return; ...And on line 141:
- onChange={(newPath) => handleFilePathChange(row, newPath, onChange)} + onChange={(newPath) => handleFilePathChange(row, newPath)}
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/Icons/ExampleIcon/index.js(1 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js(2 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js(3 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js(5 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js(8 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js(8 hunks)packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js(1 hunks)packages/bruno-app/src/ui/MenuDropdown/index.js(3 hunks)tests/collection/draft/draft-values-in-requests.spec.ts(1 hunks)tests/request/copy-request/copy-request.spec.ts(3 hunks)tests/utils/page/actions.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js
- packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js
- packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
tests/collection/draft/draft-values-in-requests.spec.tstests/request/copy-request/copy-request.spec.tspackages/bruno-app/src/ui/MenuDropdown/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.jspackages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.jstests/utils/page/actions.tspackages/bruno-app/src/components/Icons/ExampleIcon/index.js
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/collection/draft/draft-values-in-requests.spec.tstests/request/copy-request/copy-request.spec.tstests/utils/page/actions.ts
🧠 Learnings (5)
📚 Learning: 2025-12-02T20:48:05.670Z
Learnt from: NikHillAgar
Repo: usebruno/bruno PR: 6279
File: packages/bruno-app/src/components/RequestPane/PromptVariables/PromptVariablesModal/index.js:79-86
Timestamp: 2025-12-02T20:48:05.670Z
Learning: In React 19+, ref callbacks support returning cleanup functions. When a ref callback returns a function, React will call it when the element unmounts or the ref changes, similar to useEffect cleanup. This is documented at https://react.dev/learn/manipulating-the-dom-with-refs#how-to-manage-a-list-of-refs-using-a-ref-callback
Applied to files:
packages/bruno-app/src/ui/MenuDropdown/index.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Components are used as wrappers to define both self and children components style; Tailwind classes are used specifically for layout based styles
Applied to files:
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Component CSS might also change layout but Tailwind classes shouldn't define colors
Applied to files:
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js
📚 Learning: 2025-12-05T09:50:38.173Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6319
File: packages/bruno-app/src/components/Icons/IconBottombarToggle/index.js:5-5
Timestamp: 2025-12-05T09:50:38.173Z
Learning: In JSX/TSX files, use double quotes for JSX attributes (e.g., `<svg xmlns="..." viewBox="...">`), while using single quotes for regular JavaScript strings. This follows React conventions.
Applied to files:
packages/bruno-app/src/components/Icons/ExampleIcon/index.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., <svg xmlns="..." viewBox="...">)
Applied to files:
packages/bruno-app/src/components/Icons/ExampleIcon/index.js
🧬 Code graph analysis (3)
tests/request/copy-request/copy-request.spec.ts (1)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (1)
collection(66-66)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js (2)
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (36)
setResponseExampleParams(933-961)setResponseExampleParams(933-961)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)moveResponseExampleParam(462-486)moveResponseExampleParam(462-486)packages/bruno-app/src/components/EditableTable/index.js (2)
isLastEmptyRow(76-79)EditableTable(7-316)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (3)
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (34)
updateResponseExampleFileBodyParams(525-559)updateResponseExampleFileBodyParams(525-559)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)packages/bruno-app/src/components/FilePickerEditor/index.js (1)
FilePickerEditor(8-74)packages/bruno-app/src/components/EditableTable/index.js (1)
EditableTable(7-316)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: SSL Tests - Linux
- GitHub Check: Unit Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: Playwright E2E Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: CLI Tests
🔇 Additional comments (20)
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js (2)
18-23: Good flexbox hardening (min-width: 0, column direction).
min-width: 0is the right fix for flex children that need to shrink without overflowing;flex-direction: columnalso matches the “boundary” intent.
18-24: Consider addingmin-height: 0on.flex-boundaryto guarantee scroll containment.
Depending on nesting,overflow-y: autooften needsmin-height: 0on the scrolling flex item itself to avoid “won’t scroll” bugs.packages/bruno-app/src/components/Icons/ExampleIcon/index.js (2)
3-3: LGTM! Good use ofcurrentColorfor icon color inheritance.The change from
'white'to'currentColor'allows the icon to inherit the current text color, making it more flexible for different themes and contexts.
13-13: Revert clipPath rect fill to 'white' for consistency.The clipPath's rect currently uses
fill={color}, but all other icon components in the codebase usefill="white". The fill color in a clipPath does not affect the clipping behavior—only the geometry matters. Using a static"white"aligns with SVG best practices and maintains consistency across the icon library.packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js (3)
100-171: Column definitions look correct.The query and path column definitions are well-structured:
- Query columns use
isKeyField: truefor the name field, enabling proper empty-row detection in EditableTable- Path columns correctly set name as
readOnly: true(path params are auto-generated from URL)- SingleLineEditor integration with proper props for autocomplete and theme
187-230: EditableTable integration is clean.The dual EditableTable setup correctly reflects the different behaviors:
- Query params: editable, reorderable, with add/delete/checkbox controls
- Path params: name read-only, no add/delete/checkbox, not reorderable (auto-generated from URL patterns)
26-39: The param merge logic correctly preserves all properties and types. Query params are consistently placed before path params, and the reducer's map normalization maintains uid, name, value, enabled, and type fields for all parameters. No duplication occurs since params are filtered by type and merged once per update.tests/utils/page/actions.ts (1)
220-220: LGTM! Hover aligns with new MenuDropdown interaction pattern.The added hover action correctly reflects the updated UI where the menu icon is revealed on hover, consistent with the MenuDropdown-based refactor across the application.
tests/collection/draft/draft-values-in-requests.spec.ts (1)
63-63: LGTM! Hover updated for MenuDropdown pattern.The hover target change from the specific menu icon to the folder element aligns with the new MenuDropdown-based UI where the menu trigger is revealed on parent hover.
tests/request/copy-request/copy-request.spec.ts (1)
14-14: LGTM! Test interactions updated for MenuDropdown pattern.All hover actions correctly target parent elements (collection/requestItem) rather than specific menu icons, aligning with the new MenuDropdown-based UI interaction pattern.
Also applies to: 26-26, 41-41
packages/bruno-app/src/ui/MenuDropdown/index.js (1)
1-1: LGTM! Clean forwardRef implementation with imperative API.The addition of
forwardRefanduseImperativeHandlecorrectly exposesopen(),close(), andtoggle()methods to parent components without breaking existing usage. This is consistent with React 19 patterns and enables programmatic control of the dropdown.Also applies to: 41-58, 285-285
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (5)
1-1: LGTM! Clean imports for MenuDropdown refactor.Updated imports correctly bring in
MenuDropdown,ActionIcon, andExampleIconwhile maintaining existing functionality. ThemenuDropdownRefaddition enables imperative control of the dropdown.Also applies to: 30-31, 49-49, 72-72
286-290: LGTM! Right-click context menu support.The
handleContextMenuimplementation correctly opens the MenuDropdown on right-click, providing expected context menu behavior.
294-416: LGTM! Declarative menu item construction.The
buildMenuItemsfunction cleanly constructs menu items based on:
- Item type (folder vs. file)
- Request type (HTTP vs. GraphQL for Generate Code)
- Clipboard state (Paste availability)
- Action availability (Create Example only for HTTP requests)
This declarative approach is more maintainable than the previous per-item dropdown logic.
497-506: LGTM! Simplified handlers without dropdown instance dependency.Handlers like
handleGenerateCode,handleCopyItem, andhandlePasteItemno longer need to manage dropdown visibility—MenuDropdown handles that internally. This simplifies the logic.Also applies to: 524-544
668-678: LGTM! MenuDropdown integration with ActionIcon trigger.The MenuDropdown with
ActionIconwrapper andIconDotscorrectly replaces the old dropdown pattern. Theref={menuDropdownRef}enables imperative control for context menu support.packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (4)
28-37: LGTM!Clean handler with appropriate guard and correct dependencies.
95-108: Good fix for the undefined values issue.The
.filter(Boolean)on line 100 correctly addresses the past review comment about potential undefined entries when a UID isn't found inparams.
172-186: Radio button selection correctly simplified.Using only
checked={row.selected}(line 179) properly addresses the past review comment about conflicting sources of truth. The single-source approach ensures only one radio button is checked at a time.
200-221: EditableTable integration looks clean.The column configuration, defaultRow, and EditableTable props are well-structured. The component correctly toggles reorderable and showAddRow based on editMode.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (1)
19-24: TightenuseMemodeps to avoid unnecessary recalcs
You’re already depending onitem, soitem.draft/item.examplesare redundant (and could cause confusion about what actually drives recompute).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Playwright E2E Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: CLI Tests
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - Windows
- GitHub Check: Unit Tests
🔇 Additional comments (5)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (5)
26-35:handleParamsChangelooks clean and consistently gates oneditMode
Dispatch payload is minimal and dependency list is reasonable.
89-103: Good fix: filtering missing UIDs out of reordered rows
filter(Boolean)preventsundefinedrows from leaking downstream.
186-207:defaultRow+EditableTablewiring looks consistent
Reorder/add-row gating oneditModeis straightforward.
77-87: No action needed — native radio behavior preventschecked === false
Native HTML radio inputs only fireonChangewhen selected, soe.target.checkedis alwaystruein that event. The unchecked path will never execute for a radio group, making the current implementation safe.
125-185: UseuidasisKeyFieldfor consistency with other tablesAll other EditableTable implementations use
key: 'name'withisKeyField: true(e.g., QueryParams, Headers, MultipartFormParams). SinceisKeyFieldcontrols EditableTable's auto-row-add behavior and row objects already have a stableuidproperty, prefer using that instead offilePathfor semantic clarity and pattern consistency.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (2)
153-165: Consider removing or documenting empty callbacks.Lines 156 and 161 pass
onSave={() => {}}andonRun={() => {}}to SingleLineEditor. If these props are required but unused, consider adding a comment explaining why they're no-ops; if optional, omit them to reduce noise.
202-211: Redundant fallback in rows prop.Line 204:
rows={params || []}– params is already guaranteed to be an array (line 24), so|| []is unnecessary.- rows={params || []} + rows={params}
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (3)
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (34)
updateResponseExampleFileBodyParams(525-559)updateResponseExampleFileBodyParams(525-559)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)packages/bruno-app/src/components/FilePickerEditor/index.js (1)
FilePickerEditor(8-74)packages/bruno-app/src/components/EditableTable/index.js (2)
isLastEmptyRow(76-79)EditableTable(7-316)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - Windows
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
- GitHub Check: Unit Tests
🔇 Additional comments (9)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (9)
1-13: LGTM – Clean imports and proper hook additions.The migration to EditableTable brings in necessary hooks (useCallback, useMemo) and utilities (uuid). Import structure follows coding guidelines.
27-36: LGTM – Proper callback memoization.
handleParamsChangecorrectly guards witheditModeand has accurate dependencies.
38-78: LGTM – Comprehensive file path change handler.Handles both existing and new params, auto-detects contentType, and correctly clears contentType when filePath is empty. The selection logic for new params (line 67) appropriately auto-selects only the first file.
80-90: LGTM – Correct single-selection enforcement.Ensures only one file is selected at a time by toggling the target and clearing others.
92-105: LGTM – Reorder handler correctly filters undefined entries.The
.filter(Boolean)at line 97 prevents undefined values from past reviews.
107-127: LGTM – addFile properly initializes new param with uid.Deselects existing files and creates a new param with a unique uid and selected: true, as addressed in past reviews.
172-186: LGTM – Radio button logic uses single source of truth.
checked={row.selected}correctly reflects selection state, andhandleSelectedChangeensures mutual exclusivity.
190-194: LGTM – defaultRow aligns with column schema.Provides sensible defaults for new rows.
200-223: LGTM – EditableTable integration is correct.All props align with EditableTable's API, and the addFile button provides a clear entry point for adding files in edit mode.
There was a problem hiding this comment.
Actionable comments posted: 0
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/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (1)
108-190: Remove the concern aboutisKeyField: filePathbreaking row identity—uidis the actual keyEditableTable uses
row.uidfor row identity (line 254 in EditableTable:key={row.uid}), not theisKeyFieldcolumn. TheisKeyField: trueonfilePathis only used to determine if a row is empty; it doesn't affect row identification. Every row receives an auto-generateduidviauuid(), including empty rows added by the table.The
checked={row.selected}concern is also unnecessary—selectedis always boolean (defaulting tofalseand updated as boolean in line 87), so no controlled/uncontrolled warning will occur.The memoization suggestion is reasonable: consider wrapping
columnsanddefaultRowwithuseMemoto avoid unnecessary dependency changes in EditableTable's internalrowsWithEmptycalculation.
🧹 Nitpick comments (1)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (1)
19-25: TightenuseMemodeps to avoid unnecessary recomputeRight now the deps include both
itemand its subfields (item.draft,item.examples), which is redundant and can cause noisy recomputes. Consider depending onitem+exampleUid(or just the minimal fields actually used).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js(3 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - macOS
- GitHub Check: Unit Tests
- GitHub Check: SSL Tests - Windows
🔇 Additional comments (2)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (2)
26-36:handleParamsChangegating + dispatch looks good
Edit-mode guard is in the right place and keeps downstream handlers simple.
37-79: No guard needed—EditableTable always provides a uidThe code safely relies on
row.uidbeing present. EditableTable'screateEmptyRow()function (line 26–34) always generates a uid via the project'suuid()utility and assigns it to every row, including the empty row. This guarantee holds throughout the component's lifecycle, so the concern about undefined uid values is unfounded.
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/FilePickerEditor/index.js (1)
11-11: Use strict equality operators.Lines 11 and 47 use loose equality (
!=,==) instead of strict equality (!==,===), which can lead to unexpected type coercion.Apply this diff:
- .filter((v) => v != null && v != '') + .filter((v) => v !== null && v !== '')-if (filenames.length == 1) { +if (filenames.length === 1) {Also applies to: 47-47
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/bruno-app/src/components/FilePickerEditor/index.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/FilePickerEditor/index.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: SSL Tests - Linux
- GitHub Check: Playwright E2E Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - macOS
- GitHub Check: Unit Tests
- GitHub Check: CLI Tests
🔇 Additional comments (2)
packages/bruno-app/src/components/FilePickerEditor/index.js (2)
58-64: LGTM - Flex layout improves overflow handling.The flex container styling properly centers items and handles overflow, which aligns with the PR's goal of improving UI consistency.
73-81: LGTM - Text truncation pattern is correct.The span with ellipsis styling and
flex: 1properly handles long filenames and prevents layout overflow.
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/Sidebar/Collections/Collection/CollectionItem/index.js (1)
497-507: Fix URL validation inhandleGenerateCode(currently passes when URL isundefined).
item?.request?.url !== ''is true forundefined, so “Generate Code” can open with no URL.- const handleGenerateCode = () => { - if ( - (item?.request?.url !== '') - || (item?.draft?.request?.url !== undefined && item?.draft?.request?.url !== '') - ) { - setGenerateCodeItemModalOpen(true); - } else { - toast.error('URL is required'); - } - }; + const handleGenerateCode = () => { + const url = (item?.draft?.request?.url ?? item?.request?.url ?? '').trim(); + if (url.length > 0) { + setGenerateCodeItemModalOpen(true); + return; + } + toast.error('URL is required'); + };
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.js(2 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js(8 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js(2 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js(8 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js
- packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js
- packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (2)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js (3)
menuDropdownRef(33-33)handleContextMenu(167-171)buildMenuItems(131-164)packages/bruno-app/src/ui/MenuDropdown/index.js (1)
MenuDropdown(41-285)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
- GitHub Check: Unit Tests
- GitHub Check: SSL Tests - Windows
🔇 Additional comments (1)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (1)
294-416: No issue found —MenuDropdowncorrectly handles component references.The
renderSectionfunction (lines 182–194 of MenuDropdown) explicitly detects component references usingtypeof section === 'function'and instantiates them with default icon props (size={16},stroke={1.5}). PassingleftSection: IconInfoCircleis the correct pattern here.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (1)
294-415: Consider memoizing menu items for performance.
buildMenuItems()is called inline on every render (line 669), creating a new array each time. SinceCollectionItemis recursive and can render many items, this adds unnecessary overhead.+ // Memoize menu items to avoid recreation on every render + const menuItems = React.useMemo(() => { + const items = [ { id: 'info', leftSection: IconInfoCircle, label: 'Info', onClick: () => setItemInfoModalOpen(true) } ]; - // ... rest of buildMenuItems logic ... - return items; - }; + }, [isFolder, hasCopiedItems, item.type, item.pathname, item.request?.url, item.draft?.request?.url]);Then use
items={menuItems}at line 669 instead ofitems={buildMenuItems()}.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js(8 hunks)packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: CLI Tests
- GitHub Check: Unit Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: Playwright E2E Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - Linux
🔇 Additional comments (4)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (4)
284-289: LGTM!Clean context menu handler that properly prevents default browser behavior and propagation before imperatively opening the MenuDropdown.
667-674: MenuDropdown integration looks good.The ref-based imperative control pattern is correctly implemented for both click trigger (via child
IconDots) and right-click context menu. Theplacement="bottom-start"is appropriate for sidebar positioning.
496-505: LGTM!Simplified handler after removing the legacy dropdown hide call. Logic correctly validates URL presence before opening the modal.
30-31: LGTM!Imports and ref setup are correctly aligned with the new MenuDropdown-based approach.
Also applies to: 48-48, 71-71
143b70a to
b1f549d
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
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/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js (1)
128-141: Missing.filter(Boolean)- potential undefined values in reordered params.Unlike the fixed version in
ResponseExampleFormUrlEncodedParams, thishandleParamDragdoesn't filter out potentialundefinedvalues if a uid isn't found:const handleParamDrag = useCallback(({ updateReorderedItem }) => { if (!editMode) return; const reorderedParams = updateReorderedItem.map((uid) => { return params.find((p) => p.uid === uid); - }); + }).filter(Boolean); dispatch(updateResponseExampleMultipartFormParams({This mirrors the fix applied in
ResponseExampleFormUrlEncodedParams(lines 34-36).
🧹 Nitpick comments (9)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js (2)
26-35: Consider extracting the common dispatch logic to reduce duplication.
handleHeadersChangeandhandleBulkHeadersChangeshare the same dispatch pattern. You could consolidate them:+ const dispatchHeadersUpdate = useCallback((headers) => { + if (!editMode) return; + dispatch(setResponseExampleRequestHeaders({ + itemUid: item.uid, + collectionUid: collection.uid, + exampleUid: exampleUid, + headers + })); + }, [editMode, dispatch, item.uid, collection.uid, exampleUid]); + const handleHeadersChange = useCallback((updatedHeaders) => { - if (editMode) { - dispatch(setResponseExampleRequestHeaders({ - itemUid: item.uid, - collectionUid: collection.uid, - exampleUid: exampleUid, - headers: updatedHeaders - })); - } - }, [editMode, dispatch, item.uid, collection.uid, exampleUid]); + dispatchHeadersUpdate(updatedHeaders); + }, [dispatchHeadersUpdate]); - const handleBulkHeadersChange = (newHeaders) => { - if (editMode) { - dispatch(setResponseExampleRequestHeaders({ - itemUid: item.uid, - collectionUid: collection.uid, - exampleUid: exampleUid, - headers: newHeaders - })); - } - }; + const handleBulkHeadersChange = useCallback((newHeaders) => { + dispatchHeadersUpdate(newHeaders); + }, [dispatchHeadersUpdate]);This also wraps
handleBulkHeadersChangeinuseCallbackfor consistency.Also applies to: 52-61
71-71: Unusedrowparameter in column render functions.Both
KeyandValuecolumn render functions destructurerowbut never use it. Remove or prefix with underscore to indicate it's intentionally unused.- render: ({ row, value, onChange, isLastEmptyRow }) => ( + render: ({ value, onChange, isLastEmptyRow }) => (Also applies to: 91-91
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js (2)
61-61: Unusedrowparameter.The
rowparameter is destructured but not used. Consider removing it:- render: ({ row, value, onChange, isLastEmptyRow }) => ( + render: ({ value, onChange, isLastEmptyRow }) => (
89-97: Minor: Redundant fallback.
paramsalready defaults to[]via theuseMemoon line 17, soparams || []on line 91 is unnecessary.- rows={params || []} + rows={params}packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js (2)
21-23: Consider formatting this long line for readability.The ternary expression spans a single line making it hard to read:
const headers = useMemo(() => { - return item.draft ? get(item, 'draft.examples', []).find((e) => e.uid === exampleUid)?.response?.headers || [] : get(item, 'examples', []).find((e) => e.uid === exampleUid)?.response?.headers || []; + const examples = item.draft + ? get(item, 'draft.examples', []) + : get(item, 'examples', []); + return examples.find((e) => e.uid === exampleUid)?.response?.headers || []; }, [item, exampleUid]);
127-127: Unusedrowparameter in column render functions.Same as other files -
rowis destructured but unused:- render: ({ row, value, onChange, isLastEmptyRow }) => ( + render: ({ value, onChange, isLastEmptyRow }) => (Also applies to: 147-147
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (1)
183-183: Remove redundant fallback.The
|| []fallback is unnecessary sinceparamsis already guaranteed to be an array from theuseMemohook (line 23).- rows={params || []} + rows={params}packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (1)
294-415: Consider adding inline comments to group menu sections.The
buildMenuItemsfunction is comprehensive but quite long (122 lines). While the logic is clear, adding brief comments to delineate sections (e.g.,// Folder-specific actions,// Common actions,// Generate code options,// Destructive actions) would improve scanability.const buildMenuItems = () => { const items = [ + // Item information { id: 'info', leftSection: IconInfoCircle, label: 'Info', onClick: () => setItemInfoModalOpen(true) } ]; if (isFolder) { + // Folder-specific actions items.push( { id: 'new-request', ...packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js (1)
103-114: URL validation logic is comprehensive.The validation checks three possible URL sources (
example?.request?.url,item?.request?.url,item?.draft?.request?.url), which properly handles different states. However, the condition could be simplified for readability.const handleGenerateCode = () => { - if ( - (example?.request?.url !== '' && example?.request?.url !== undefined) - || (item?.request?.url !== '' && item?.request?.url !== undefined) - || (item?.draft?.request?.url !== undefined && item?.draft?.request?.url !== '') - ) { + const hasUrl = example?.request?.url || item?.request?.url || item?.draft?.request?.url; + if (hasUrl) { setGenerateCodeItemModalOpen(true); } else { toast.error('URL is required'); } };
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (29)
packages/bruno-app/package.json(3 hunks)packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/BodyModeSelector/index.js(2 hunks)packages/bruno-app/src/components/EditableTable/StyledWrapper.js(2 hunks)packages/bruno-app/src/components/EditableTable/index.js(1 hunks)packages/bruno-app/src/components/FilePickerEditor/index.js(1 hunks)packages/bruno-app/src/components/Icons/ExampleIcon/index.js(1 hunks)packages/bruno-app/src/components/RequestTabPanel/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js(2 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleBodyMode/index.js(1 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js(3 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js(3 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js(5 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js(4 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js(5 hunks)packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js(5 hunks)packages/bruno-app/src/components/ResponseExample/StyledWrapper.js(1 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.js(2 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js(8 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js(2 hunks)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js(8 hunks)packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js(3 hunks)packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js(1 hunks)packages/bruno-app/src/ui/MenuDropdown/index.js(3 hunks)tests/collection/draft/draft-values-in-requests.spec.ts(1 hunks)tests/request/copy-request/copy-request.spec.ts(3 hunks)tests/response-examples/menu-operations.spec.ts(3 hunks)tests/utils/page/actions.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (16)
- packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js
- tests/collection/draft/draft-values-in-requests.spec.ts
- packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js
- packages/bruno-app/src/components/RequestTabPanel/StyledWrapper.js
- packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleBodyMode/index.js
- packages/bruno-app/src/components/FilePickerEditor/index.js
- packages/bruno-app/src/components/EditableTable/index.js
- packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js
- packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js
- packages/bruno-app/src/components/ResponseExample/StyledWrapper.js
- packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js
- packages/bruno-app/src/components/EditableTable/StyledWrapper.js
- packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js
- tests/request/copy-request/copy-request.spec.ts
- tests/utils/page/actions.ts
- packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.js
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.jspackages/bruno-app/src/ui/MenuDropdown/index.jspackages/bruno-app/src/components/BodyModeSelector/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.jstests/response-examples/menu-operations.spec.tspackages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.jspackages/bruno-app/src/components/Icons/ExampleIcon/index.js
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/response-examples/menu-operations.spec.ts
🧠 Learnings (6)
📚 Learning: 2025-12-02T20:48:05.670Z
Learnt from: NikHillAgar
Repo: usebruno/bruno PR: 6279
File: packages/bruno-app/src/components/RequestPane/PromptVariables/PromptVariablesModal/index.js:79-86
Timestamp: 2025-12-02T20:48:05.670Z
Learning: In React 19+, ref callbacks support returning cleanup functions. When a ref callback returns a function, React will call it when the element unmounts or the ref changes, similar to useEffect cleanup. This is documented at https://react.dev/learn/manipulating-the-dom-with-refs#how-to-manage-a-list-of-refs-using-a-ref-callback
Applied to files:
packages/bruno-app/src/ui/MenuDropdown/index.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.test.{js,jsx,ts,tsx} : Add tests for any new functionality or meaningful changes. If code is added, removed, or significantly modified, corresponding tests should be updated or created
Applied to files:
tests/response-examples/menu-operations.spec.ts
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Components are used as wrappers to define both self and children components style; Tailwind classes are used specifically for layout based styles
Applied to files:
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Component CSS might also change layout but Tailwind classes shouldn't define colors
Applied to files:
packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js
📚 Learning: 2025-12-05T09:50:38.173Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6319
File: packages/bruno-app/src/components/Icons/IconBottombarToggle/index.js:5-5
Timestamp: 2025-12-05T09:50:38.173Z
Learning: In JSX/TSX files, use double quotes for JSX attributes (e.g., `<svg xmlns="..." viewBox="...">`), while using single quotes for regular JavaScript strings. This follows React conventions.
Applied to files:
packages/bruno-app/src/components/Icons/ExampleIcon/index.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., <svg xmlns="..." viewBox="...">)
Applied to files:
packages/bruno-app/src/components/Icons/ExampleIcon/index.js
🧬 Code graph analysis (4)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js (2)
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (34)
setResponseExampleRequestHeaders(904-931)setResponseExampleRequestHeaders(904-931)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)packages/bruno-app/src/components/EditableTable/index.js (2)
isLastEmptyRow(76-79)EditableTable(7-316)
packages/bruno-app/src/components/BodyModeSelector/index.js (2)
packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js (1)
StyledWrapper(3-36)packages/bruno-app/src/components/Dropdown/index.js (1)
Dropdown(5-25)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js (3)
packages/bruno-app/src/components/RequestTabs/ExampleTab/index.js (2)
example(21-21)item(20-20)packages/bruno-app/src/ui/MenuDropdown/index.js (1)
MenuDropdown(41-285)packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/index.js (1)
GenerateCodeItem(25-149)
packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js (1)
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (34)
setResponseExampleHeaders(312-339)setResponseExampleHeaders(312-339)item(14-14)item(66-66)item(144-144)item(166-166)item(184-184)item(207-207)item(237-237)item(267-267)item(291-291)item(318-318)item(348-348)item(379-379)item(426-426)item(468-468)item(495-495)item(531-531)collection(10-10)collection(62-62)collection(140-140)collection(162-162)collection(180-180)collection(203-203)collection(233-233)collection(263-263)collection(287-287)collection(314-314)collection(344-344)collection(375-375)collection(422-422)collection(464-464)collection(491-491)collection(527-527)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: CLI Tests
- GitHub Check: Unit Tests
- GitHub Check: Playwright E2E Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - Linux
🔇 Additional comments (20)
packages/bruno-app/package.json (1)
58-58: mime-types@^3.0.2 is secure and actively maintained. No vulnerabilities detected across npm, Snyk, and ReversingLabs. The dependency addition aligns with the enhanced content-type handling in this PR.packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js (2)
20-22: No action needed. Theflex-direction: columnin.flex-boundaryis intentional component design, not a breaking change. The component is explicitly structured for vertical content stacking with proper flex overflow handling (min-width: 0,> *child distribution). All usages across ResponsePane, RequestPane variants, and ResponseExamplePane expect this vertical layout and function correctly.
24-28: The> *selector is intentional and correct for this component's purpose.The
flex: 1 1 0; min-height: 0;styling on all direct children of.flex-boundaryis a standard CSS flexbox pattern, not a problem. The component is explicitly designed to normalize flex properties across children to:
- Enable equal flex distribution within a bounded scrollable container
- Prevent
min-heightfrom blocking flex shrinking in column direction (critical CSS fix)- Work correctly with
overflow-y: autoAll direct children of
HeightBoundContainerare intended to participate in this flex layout. No conflicts or unintended side effects detected.packages/bruno-app/src/components/BodyModeSelector/index.js (1)
2-11: LGTM! Clean refactoring with proper icon integration.The changes follow all coding guidelines and maintain backwards compatibility through the
modesprop default. Icon rendering is safely guarded with conditional checks, and the StyledWrapper integration aligns well with the provided styled component structure.Also applies to: 14-14, 17-24, 66-99
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js (2)
63-107: LGTM on the column definitions.Good use of
SingleLineEditorwith appropriate autocomplete lists (headerAutoCompleteListfor keys,MimeTypesfor values). ThereadOnlybehavior is correctly tied toeditMode, and newline stripping on the Key column (line 77) is appropriate for header names.
134-142: EditableTable integration looks correct.The props are well-configured:
reorderableandshowAddRoware properly gated byeditMode, andonReorderdelegates tohandleHeaderDrag.packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js (1)
31-44: LGTM - Previous issue addressed.The
.filter(Boolean)on line 36 correctly handles the case whereparams.find()might returnundefined. Good fix.packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js (2)
34-57: Nice feature: Auto-sync body type on content-type header change.The logic correctly detects when the
content-typeheader value changes and updates the response body type accordingly. The guard checkingnewBodyType !== currentBodyTypeprevents unnecessary dispatches.
172-181: LGTM on EditableTable configuration.
showCheckbox={false}is appropriate for response headers since they don't need enable/disable functionality. Props are correctly wired.packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js (4)
60-62: Handlemime.contentType()returningfalse.
mime.contentType()returnsfalse(notundefined) when the extension is unknown. The current code handles this with|| '', which works but could be more explicit:- const contentType = mime.contentType(path.extname(processedPaths[0])); - updated.contentType = contentType || ''; + const contentType = mime.contentType(path.extname(processedPaths[0])) || ''; + updated.contentType = contentType;Current implementation works, just noting for clarity.
Also applies to: 79-81
143-156: LGTM - Robust filename extraction.
getFileNamecorrectly handles edge cases: null values, empty arrays, mixed array/string inputs, and Windows vs POSIX path separators usingisWindowsOS().
167-224: Good conditional rendering for file vs text value.The value column render logic cleanly distinguishes between file-type params (showing filename with clear button) and text-type params (showing editor with upload button). The upload button visibility condition (
!hasTextValue && !isLastEmptyRow) provides good UX.
37-91: No action needed. ThebrowseFilesimplementation inpackages/bruno-electron/src/utils/filesystem.jsis well-protected and always resolves to an array: it returns[]if no files are selected, or a filtered array of file paths. The.map()call on line 42 is safe.packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (1)
60-76: No changes needed. EditableTable auto-generatesuidfor all rows, including empty ones created fromdefaultRow. ThecreateEmptyRowfunction (line 27 in EditableTable) explicitly generates a uid viauuid()before spreadingdefaultRow, ensuringrow.uidis always defined at line 65. The code is correct as written.packages/bruno-app/src/ui/MenuDropdown/index.js (1)
1-1: LGTM! Clean ref API implementation.The forwardRef wrapper and useImperativeHandle correctly expose an imperative API for programmatic control. The implementation follows React best practices and integrates well with the existing component logic.
Also applies to: 41-49, 54-58, 285-285
packages/bruno-app/src/components/Icons/ExampleIcon/index.js (1)
3-3: LGTM! Better color inheritance pattern.Changing the default color to
currentColormakes the icon more flexible by inheriting the text color from its parent. The dynamic fill on the clipPath rect ensures consistent color application throughout the icon.Also applies to: 13-13
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (1)
667-674: LGTM! MenuDropdown integration is well-implemented.The context menu pattern is correctly wired: right-click triggers
menuDropdownRef.current?.open(), and the MenuDropdown receives dynamically built items. The optional chaining prevents errors if the ref isn't initialized.Also applies to: 284-289
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js (2)
130-164: LGTM! MenuDropdown integration matches CollectionItem pattern.The buildMenuItems function and context menu handler follow the same pattern as CollectionItem, ensuring consistency across the codebase. The menu items are properly structured with test IDs for each action.
Also applies to: 166-171, 205-212
256-264: GenerateCodeItem properly handles example-specific props.The component correctly accepts
isExampleandexampleUid, uses them to locate the specific example from the examples array, and retrieves example-specific request data including URL, params, and request body. Falls back gracefully to normal request data if the example is not found.tests/response-examples/menu-operations.spec.ts (1)
27-30: LGTM! Row-based selectors improve test reliability.The updated selector pattern using
.filter({ hasText: ... })and row-scoped interactions (.locator('.menu-icon').click()) is more specific and reduces the risk of interacting with the wrong element. The test IDs align with the updated MenuDropdown implementation in ExampleItem.Good use of
test.stepfor readability as per coding guidelines.Also applies to: 34-40, 60-73, 93-112
…onents (usebruno#6382) * feat: use common dropdown component * fix: update example ui to match v3 * fix: test cases, bugs * fix: review comments * fix: review comments * fix: review * fix: file body/binary table within response examples * fix: file name, close btn not visible issue * fix: unnessary transition for three dots * fix: install missing deps in bruno-app * update example url when param is updated * empty commit * chore: update package-lock.json --------- Co-authored-by: Bijin A B <[email protected]>
Description
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.
Summary by CodeRabbit
New Features
Style
Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.