Skip to content

fix: refactor response examples to use MenuDropdown and Editable components - #6382

Merged
bijin-bruno merged 13 commits into
usebruno:mainfrom
sanish-bruno:fix/response-example-ui-update
Dec 14, 2025
Merged

bijin-bruno merged 13 commits into
usebruno:mainfrom
sanish-bruno:fix/response-example-ui-update

Conversation

@sanish-bruno

@sanish-bruno sanish-bruno commented Dec 11, 2025 •

Copy link
Copy Markdown
Collaborator

Description

Jira

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

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

    • Added "Create Example" and "Generate Code" menu items; context menus support right‑click and can be opened programmatically.
  • Style

    • Icons now inherit surrounding color and render more consistently; menu icon hover/visibility refined; close control uses a gradient button; file picker truncates filenames.
  • Improvements

    • Replaced many inline tables with unified editable tables for in-place editing; body-mode dropdown shows icons; query changes now sync URL; preserved item IDs for headers/params.
  • Tests

    • Updated tests to use row-scoped selectors and adjusted hover interactions.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 11, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Replaces 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 currentColor. Public signatures largely preserved except MenuDropdown ref API and BodyModeSelector modes prop.

Changes

Cohort / File(s) Summary
Icon Styling
packages/bruno-app/src/components/Icons/ExampleIcon/index.js
Default color changed white → currentColor; SVG props converted to camelCase (strokeWidth, strokeLinecap, strokeLinejoin); clipPath rect fill uses dynamic color.
Sidebar — Menu refactor
packages/bruno-app/src/components/Sidebar/Collections/.../ExampleItem/index.js, .../ExampleItem/StyledWrapper.js, .../CollectionItem/index.js, .../CollectionItem/StyledWrapper.js
Replace per-item Dropdowns with MenuDropdown + ActionIcon trigger; add buildMenuItems, right-click/contextmenu opening, new menu entries (Generate Code, Create Example, etc.), and visibility/hover adjustments for .menu-icon.
Menu primitive
packages/bruno-app/src/ui/MenuDropdown/index.js
Wrapped MenuDropdown with forwardRef; expose imperative methods (open, close, toggle) via useImperativeHandle on the forwarded ref.
EditableTable adoption (ResponseExample)
packages/bruno-app/src/components/ResponseExample/** (e.g., .../ResponseExampleFileBody/index.js, .../ResponseExampleFormUrlEncodedParams/index.js, .../ResponseExampleHeaders/index.js, .../ResponseExampleMultipartFormParams/index.js, .../ResponseExampleParams/index.js, .../ResponseExampleResponsePane/ResponseExampleHeaders/index.js)
Replace Table-v2/ReorderTable with EditableTable; add columns/defaultRow configs, consolidated onChange and onReorder handlers, memoized callbacks, file-browse/content-type detection (uses mime-types), and preserve editMode gating.
EditableTable wrapper & usage
packages/bruno-app/src/components/EditableTable/index.js, packages/bruno-app/src/components/EditableTable/StyledWrapper.js
Move nth-child header styles into class-scoped selectors; StyledWrapper uses has-checkbox/no-checkbox classes; EditableTable toggles className based on showCheckbox.
ResponseExample layout & style tweaks
packages/bruno-app/src/components/ResponseExample/StyledWrapper.js, .../ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js, .../ResponseExampleRequestPane/ResponseExampleBodyMode/index.js, .../ResponseExampleRequestPane/ResponseExampleFileBody/index.js, .../ResponseExampleRequestPane/ResponseExampleParams/index.js
Add .request-pane { flex-shrink: 0 } and .response-pane { min-width: 0 }; adjust header/cell styling for EditableTable; change body-mode initialization behavior and file-mode handling.
BodyModeSelector
packages/bruno-app/src/components/BodyModeSelector/index.js, packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js
Add StyledWrapper, include icons per body mode, render icons in dropdown, and add new modes prop (default DEFAULT_MODES).
Small UI & layout tweaks
packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js, packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js, packages/bruno-app/src/components/RequestTabPanel/StyledWrapper.js, packages/bruno-app/src/components/FilePickerEditor/index.js
Replace CloseTabIcon with GradientCloseButton (hasChanges prop); set .flex-boundary to column with flex children; pane flex/min-width tweaks; FilePickerEditor layout changed to flex row with truncation and fixed clear-button flex.
Redux — Example reducers
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js
Preserve existing uid when mapping headers/params (fallback to uuid() only if missing). Sync example.request.url with query params when params change.
Tests / Interaction updates
tests/response-examples/menu-operations.spec.ts, tests/collection/draft/draft-values-in-requests.spec.ts, tests/request/copy-request/copy-request.spec.ts, tests/utils/page/actions.ts
Scope test interactions to row-local selectors via filter({ hasText: ... }), add parent-element hovers before menu clicks, and adapt selectors to new menu/icon structure.
Menu & ExampleItem tests
tests/response-examples/menu-operations.spec.ts
Updated to open/operate menu via row-local .menu-icon and new menu option test-ids.
File picker / editors
packages/bruno-app/src/components/FilePickerEditor/index.js
Change rendering/truncation to use flex layout: filename span flex:1 with ellipsis, clear button non-shrinking.
Dependency
packages/bruno-app/package.json
Added dependency mime-types (used for content-type auto-detection).

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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Focus areas:
    • buildMenuItems conditional branching (folder vs file, clipboard state).
    • MenuDropdown forwardRef/useImperativeHandle behaviors and lifecycle.
    • EditableTable column renderers, onChange/onReorder flows, and mime-types-based content-type detection.
    • UID preservation and URL sync logic in exampleReducers.
    • Test changes that rely on hover timing and row-scoped selectors.

Possibly related PRs

Suggested reviewers

  • lohit-bruno
  • naman-bruno

Poem

✨ A dot to click, a menu that bends,
Rows that reorder where logic ascends,
Icons now inherit the color they wear,
UIDs hold steady — no surprises there,
Tests hover in place, and changes sail fair.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the primary changes: refactoring response example components to use MenuDropdown and EditableTable, which aligns with the substantial modifications across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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'] and div[aria-expanded='false'] are set to visibility: 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-icon styles 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). ExampleItem also checks example?.request?.url, but more importantly, both use slightly different logic patterns. Consider extracting a shared hasValidUrl utility for consistency.


289-410: Consider extracting menu item groups.

buildMenuItems is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 98513c6 and 2026504.

📒 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() not func ()
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.js
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/StyledWrapper.js
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js
  • packages/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.js
  • packages/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.js
  • packages/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 with currentColor.

ClipPath rectangles define the clipping region shape—typically filled with a neutral color like white. Using {color} (which defaults to currentColor) may cause unexpected behavior if the inherited color is transparent or varies. Consider keeping fill="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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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: Potential undefined values in reordered params array.

Same issue as in ResponseExampleFormUrlEncodedParams: if a uid isn't found in params, the resulting array will contain undefined.

   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 behavior

The comment mentions showing a loading spinner, but the component just returns null until the timeout fires. Also, the setTimeout isn’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 clearTimeout in a cleanup function from useEffect.
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleBodyMode/index.js (1)

17-45: Consider consistent array initialization across all array-typed body modes.

The file mode uses an explicit Array.isArray() check (line 38), while formUrlEncoded and multipartForm rely 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.

  1. Line 24: Including item in dependencies is redundant since item.draft and item.examples are already listed.

  2. Line 26: enabledFileUid is initialized once from params[0].uid but won't sync if params changes 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 useEffect to update enabledFileUid when params change, or derive it directly from params if 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 !important declarations 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 since params is already defaulted to [] in the useMemo on lines 14-18.

       <EditableTable
         columns={columns}
-        rows={params || []}
+        rows={params}
         onChange={handleParamsChange}
tests/response-examples/menu-operations.spec.ts (1)

25-31: Consider replacing waitForSelector with Playwright's expect assertion.

Using expect().not.toBeVisible() or expect().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 since headers already defaults to [] in the useMemo on lines 20-24.

       <EditableTable
         columns={columns}
-        rows={headers || []}
+        rows={headers}
         onChange={handleHeadersChange}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2026504 and 27e9280.

📒 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() not func ()
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.js
  • packages/bruno-app/src/components/RequestTabPanel/StyledWrapper.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/ResponseExampleBodyMode/index.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js
  • packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js
  • tests/response-examples/menu-operations.spec.ts
  • packages/bruno-app/src/components/BodyModeSelector/index.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleHeaders/index.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js
  • packages/bruno-app/src/components/ResponseExample/StyledWrapper.js
  • packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js
  • packages/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture 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.js
  • packages/bruno-app/src/components/EditableTable/index.js
  • packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js
  • packages/bruno-app/src/components/ResponseExample/StyledWrapper.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js
  • packages/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.js
  • packages/bruno-app/src/components/BodyModeSelector/StyledWrapper.js
  • packages/bruno-app/src/components/ResponseExample/StyledWrapper.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/StyledWrapper.js
  • packages/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.js
  • packages/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-boundary flex tweaks look good and align with layout wrapper usage

Adding min-width: 0 and switching .flex-boundary to flex-direction: column is 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 of HeightBoundContainer. 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: 0 keeps the request pane from collapsing, and min-width: 0 is 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 to GradientCloseButton looks good; confirm hasChanges usage

The move to GradientCloseButton with onClick={handleCloseClick} matches the rest of the UI refresh. One thing to double‑check: should hasChanges always be true for a “Not Found” tab, or should it reflect actual dirty/changed state? If hasChanges controls 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-pane and .response-pane classes are correctly applied in the component JSX (lines 256 and response-pane section in index.js). The parent container has display: flex via Tailwind's flex class. The min-width: 0 on .response-pane is a standard flexbox pattern that allows the pane to shrink below content width when the user drags the divider, and it works properly with the overflow-x-auto handling 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 onSave and onRun callbacks 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 editMode and empty state is handled correctly.

packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js (3)

332-338: LGTM — UID preservation for headers.

Destructuring uid from input and using uid || 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 uid and includes type in 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 the StyledWrapper.js changes.

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-checkbox ensures 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.value correctly guards against unnecessary dispatches.

One edge case: if a user adds a new content-type header (not updating an existing one), oldContentTypeHeader will 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 moveResponseExampleHeader action 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 SingleLineEditor integration with autocomplete for headers and MIME types is a nice touch.

Note: onSave={() => {}} and onRun={() => {}} 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/disable
  • reorderable={editMode} properly gates drag-and-drop
  • showAddRow={editMode} prevents adding rows in read-only mode
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js (1)

46-81: Clean column definitions and defaultRow structure.

The columns configuration with isKeyField, readOnly toggle, and custom MultiLineEditor render is well-structured. The defaultRow aligns 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 afterAll hook ensures the .bru file 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-icon is 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 handleHeadersChange and handleHeaderDrag are properly memoized with correct dependencies. The drag handler delegates to moveResponseExampleRequestHeader, which handles the reordering logic in the reducer.


91-106: Verify allowNewlines={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 handleParamsChange for existing params and delegating to onChange for 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:

  1. File selected → shows filename with clear button
  2. Text value → shows editor without upload button
  3. 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: true on 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, and showAddRow are all false, which is correct—path parameters are URL-driven and shouldn't be manually added/removed by users.

Comment on lines +10 to +19
.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;
}

@coderabbitai coderabbitai Bot Dec 11, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Suggested change
.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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@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

@sanish-bruno
sanish-bruno marked this pull request as draft December 12, 2025 07:28
@sanish-bruno sanish-bruno changed the title fix: update example ui to match new ui fix: refactor examples to use MenuDropdown and Editable components Dec 12, 2025
@sanish-bruno sanish-bruno changed the title fix: refactor examples to use MenuDropdown and Editable components fix: refactor response examples to use MenuDropdown and Editable components Dec 12, 2025
@sanish-bruno
sanish-bruno marked this pull request as ready for review December 12, 2025 09:27

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js (1)

5-5: Remove unused import.

The updateResponseExampleParam import 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-boundary to 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 unused onChange parameter.

The onChange callback parameter (line 39, passed from line 141) is never invoked within handleFilePathChange. The function dispatches updates directly via handleParamsChange instead. If EditableTable's onChange callback 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

📥 Commits

Reviewing files that changed from the base of the PR and between 27e9280 and 5ddb29e.

📒 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() not func ()
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.ts
  • tests/request/copy-request/copy-request.spec.ts
  • packages/bruno-app/src/ui/MenuDropdown/index.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleParams/index.js
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js
  • packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js
  • tests/utils/page/actions.ts
  • packages/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture 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.ts
  • tests/request/copy-request/copy-request.spec.ts
  • tests/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: 0 is the right fix for flex children that need to shrink without overflowing; flex-direction: column also matches the “boundary” intent.


18-24: Consider adding min-height: 0 on .flex-boundary to guarantee scroll containment.
Depending on nesting, overflow-y: auto often needs min-height: 0 on 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 of currentColor for 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 use fill="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: true for 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 forwardRef and useImperativeHandle correctly exposes open(), close(), and toggle() 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, and ExampleIcon while maintaining existing functionality. The menuDropdownRef addition enables imperative control of the dropdown.

Also applies to: 30-31, 49-49, 72-72


286-290: LGTM! Right-click context menu support.

The handleContextMenu implementation correctly opens the MenuDropdown on right-click, providing expected context menu behavior.


294-416: LGTM! Declarative menu item construction.

The buildMenuItems function 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, and handlePasteItem no 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 ActionIcon wrapper and IconDots correctly replaces the old dropdown pattern. The ref={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 in params.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (1)

19-24: Tighten useMemo deps to avoid unnecessary recalcs
You’re already depending on item, so item.draft / item.examples are redundant (and could cause confusion about what actually drives recompute).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ddb29e and 4995233.

📒 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() not func ()
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: handleParamsChange looks clean and consistently gates on editMode
Dispatch payload is minimal and dependency list is reasonable.


89-103: Good fix: filtering missing UIDs out of reordered rows
filter(Boolean) prevents undefined rows from leaking downstream.


186-207: defaultRow + EditableTable wiring looks consistent
Reorder/add-row gating on editMode is straightforward.


77-87: No action needed — native radio behavior prevents checked === false
Native HTML radio inputs only fire onChange when selected, so e.target.checked is always true in that event. The unchecked path will never execute for a radio group, making the current implementation safe.


125-185: Use uid as isKeyField for consistency with other tables

All other EditableTable implementations use key: 'name' with isKeyField: true (e.g., QueryParams, Headers, MultipartFormParams). Since isKeyField controls EditableTable's auto-row-add behavior and row objects already have a stable uid property, prefer using that instead of filePath for semantic clarity and pattern consistency.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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={() => {}} and onRun={() => {}} 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4995233 and e4b77b8.

📒 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() not func ()
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.

handleParamsChange correctly guards with editMode and 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, and handleSelectedChange ensures 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 about isKeyField: filePath breaking row identity—uid is the actual key

EditableTable uses row.uid for row identity (line 254 in EditableTable: key={row.uid}), not the isKeyField column. The isKeyField: true on filePath is only used to determine if a row is empty; it doesn't affect row identification. Every row receives an auto-generated uid via uuid(), including empty rows added by the table.

The checked={row.selected} concern is also unnecessary—selected is always boolean (defaulting to false and updated as boolean in line 87), so no controlled/uncontrolled warning will occur.

The memoization suggestion is reasonable: consider wrapping columns and defaultRow with useMemo to avoid unnecessary dependency changes in EditableTable's internal rowsWithEmpty calculation.

🧹 Nitpick comments (1)
packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js (1)

19-25: Tighten useMemo deps to avoid unnecessary recompute

Right now the deps include both item and its subfields (item.draft, item.examples), which is redundant and can cause noisy recomputes. Consider depending on item + exampleUid (or just the minimal fields actually used).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4b77b8 and 5b3eee4.

📒 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() not func ()
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: handleParamsChange gating + 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 uid

The code safely relies on row.uid being present. EditableTable's createEmptyRow() function (line 26–34) always generates a uid via the project's uuid() 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5b3eee4 and 8916b77.

📒 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() not func ()
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: 1 properly handles long filenames and prevents layout overflow.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 in handleGenerateCode (currently passes when URL is undefined).
item?.request?.url !== '' is true for undefined, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8916b77 and 4d9ca4a.

📒 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() not func ()
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 — MenuDropdown correctly handles component references.

The renderSection function (lines 182–194 of MenuDropdown) explicitly detects component references using typeof section === 'function' and instantiates them with default icon props (size={16}, stroke={1.5}). Passing leftSection: IconInfoCircle is the correct pattern here.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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. Since CollectionItem is 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 of items={buildMenuItems()}.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08f4c5f and 7e7fb27.

📒 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() not func ()
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. The placement="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

@bijin-bruno
bijin-bruno force-pushed the fix/response-example-ui-update branch from 143b70a to b1f549d Compare December 13, 2025 12:18

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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, this handleParamDrag doesn't filter out potential undefined values 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.

handleHeadersChange and handleBulkHeadersChange share 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 handleBulkHeadersChange in useCallback for consistency.

Also applies to: 52-61


71-71: Unused row parameter in column render functions.

Both Key and Value column render functions destructure row but 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: Unused row parameter.

The row parameter is destructured but not used. Consider removing it:

-      render: ({ row, value, onChange, isLastEmptyRow }) => (
+      render: ({ value, onChange, isLastEmptyRow }) => (

89-97: Minor: Redundant fallback.

params already defaults to [] via the useMemo on line 17, so params || [] 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: Unused row parameter in column render functions.

Same as other files - row is 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 since params is already guaranteed to be an array from the useMemo hook (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 buildMenuItems function 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7fb27 and b1f549d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is 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() not func ()
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.js
  • packages/bruno-app/src/ui/MenuDropdown/index.js
  • packages/bruno-app/src/components/BodyModeSelector/index.js
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleMultipartFormParams/index.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFormUrlEncodedParams/index.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/ExampleItem/index.js
  • tests/response-examples/menu-operations.spec.ts
  • packages/bruno-app/src/ui/HeightBoundContainer/StyledWrapper.js
  • packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js
  • packages/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture 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. The flex-direction: column in .flex-boundary is 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-boundary is 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-height from blocking flex shrinking in column direction (critical CSS fix)
  • Work correctly with overflow-y: auto

All direct children of HeightBoundContainer are 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 modes prop 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 SingleLineEditor with appropriate autocomplete lists (headerAutoCompleteList for keys, MimeTypes for values). The readOnly behavior is correctly tied to editMode, 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: reorderable and showAddRow are properly gated by editMode, and onReorder delegates to handleHeaderDrag.

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 where params.find() might return undefined. 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-type header value changes and updates the response body type accordingly. The guard checking newBodyType !== currentBodyType prevents 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: Handle mime.contentType() returning false.

mime.contentType() returns false (not undefined) 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.

getFileName correctly handles edge cases: null values, empty arrays, mixed array/string inputs, and Windows vs POSIX path separators using isWindowsOS().


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. The browseFiles implementation in packages/bruno-electron/src/utils/filesystem.js is 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-generates uid for all rows, including empty ones created from defaultRow. The createEmptyRow function (line 27 in EditableTable) explicitly generates a uid via uuid() before spreading defaultRow, ensuring row.uid is 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 currentColor makes 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 isExample and exampleUid, 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.step for readability as per coding guidelines.

Also applies to: 34-40, 60-73, 93-112

@bijin-bruno
bijin-bruno merged commit 8cbda5f into usebruno:main Dec 14, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Jan 21, 2026
1 of 6 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Feb 14, 2026
6 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Mar 16, 2026
6 tasks done
@coderabbitai coderabbitai Bot mentioned this pull request Apr 9, 2026
6 tasks
maxenceleblanc pushed a commit to maxenceleblanc/curly_cats2 that referenced this pull request Jul 20, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants