Skip to content

improve: tabs design - #6363

Merged
bijin-bruno merged 2 commits into
usebruno:mainfrom
naman-bruno:improve/tabs-design
Dec 9, 2025
Merged

bijin-bruno merged 2 commits into
usebruno:mainfrom
naman-bruno:improve/tabs-design

Conversation

@naman-bruno

@naman-bruno naman-bruno commented Dec 9, 2025 •

Copy link
Copy Markdown
Collaborator

Description

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

    • Consolidated, responsive tab system with overflow dropdown, tab-measurement, and optional right-side content.
  • Style

    • Improved tab layout, spacing, alignment, fixed indicator styling, added request body min-width, and prevented request/response pane overflow.
  • Bug Fixes

    • Safer tab rendering with guards and auto-select logic to avoid missing-context errors.
  • Tests

    • Added a test helper to select request-pane tabs and updated tests to use it.
  • Chores

    • Removed an unused styled wrapper.

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

@coderabbitai

coderabbitai Bot commented Dec 9, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Consolidates RequestPane tab rendering into a new RequestPaneTabs component used by GraphQL and HTTP panes, removes the GraphQL StyledWrapper file, adds small layout/style tweaks, and introduces a test helper selectRequestPaneTab for robust tab selection.

Changes

Cohort / File(s) Change Summary
New RequestPaneTabs Component
packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js, packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.js
Adds RequestPaneTabs with measurement (pre-measure row + ResizeObserver), visible/overflow tab calculation, dropdown overflow handling, delayed-tab logic, rightContent support, and public signature.
GraphQLRequestPane Refactor
packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js
Replaces per-tab rendering with RequestPaneTabs; introduces TAB_CONFIG/MULTIPLE_CONTENT_TABS, memoized handlers/useRefs, schema state/actions ref, conditional rendering and validation of active tab; removes prior StyledWrapper usage.
GraphQL StyledWrapper Removal
packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/StyledWrapper.js
Deleted — default export StyledWrapper removed.
HttpRequestPane Refactor
packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js
Switches to RequestPaneTabs-driven rendering, centralizes TAB_CONFIG/TAB_PANELS, computes counts/indicators via memo, manages body rightContent via ref, and consolidates tab selection/update logic.
Request Body / Layout Style Tweaks
packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js, packages/bruno-app/src/pages/Bruno/StyledWrapper.js
Adds min-width: 125px to RequestBodyMode wrapper; adds overflow: hidden to section.request-pane and section.response-pane.
Tests & Test Utilities
tests/utils/page/actions.ts, tests/.../*.spec.ts
Adds and exports selectRequestPaneTab(page, tabName) (handles visible and overflow tabs), updates multiple tests to use this helper instead of direct DOM clicks.
RequestPaneTabs Styling Fixes
packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.js
Adjusts tab and indicator styling (scoped .tabs, inline-flex tab layout, sup styling, minor CSS fix).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus review on RequestPaneTabs: measurement strategy (hidden pre-measure row), ResizeObserver usage, ref map correctness, and dropdown overflow handling.
  • Verify GraphQL/HTTP panes correctly wire rightContent refs and preserve previous tab behaviors (active selection, memo deps).
  • Confirm tests use selectRequestPaneTab reliably in overflow cases and that no imports still reference the removed StyledWrapper.

Possibly related PRs

  • feat: design updates #6345 — Touches the same GraphQLRequestPane StyledWrapper file; likely related to styling adjustments prior to this removal.

Suggested reviewers

  • helloanoop
  • lohit-bruno

Poem

Tabs find order, overflow kept mild,
Hooks hum quietly, each pane reconciled.
Hidden measures map the space,
Dropdowns tuck what would not place. 🎉

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 'improve: tabs design' directly aligns with the changeset's primary focus: refactoring the tab system architecture across GraphQL and HTTP request panes with a new RequestPaneTabs component and updated styling.
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: 0

🧹 Nitpick comments (3)
packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (1)

93-93: Remove unnecessary useMemo.

Since TAB_CONFIG is a constant, this useMemo provides no performance benefit. The mapping operation is trivial and will be optimized by the JavaScript engine.

-  const allTabs = useMemo(() => TAB_CONFIG.map(({ key, label }) => ({ key, label })), []);
+  const allTabs = TAB_CONFIG.map(({ key, label }) => ({ key, label }));
packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js (2)

7-9: Consider additional constants for magic numbers.

While DROPDOWN_WIDTH is defined, there are hardcoded spacing values (20 for margins, 100 for fallback width) used in calculateTabVisibility. Consider extracting these as named constants for clarity.

 const DROPDOWN_WIDTH = 60;
+const TAB_MARGIN = 20;
+const TAB_FALLBACK_WIDTH = 100;
 const CALCULATION_DELAY_DEFAULT = 20;
 const CALCULATION_DELAY_EXTENDED = 150;

157-159: Move inline styles to StyledWrapper.

The inline style object for the more-tabs button should be moved to the StyledWrapper component for consistency with the project's styling patterns.

Based on learnings, styled components are used for styling while Tailwind is primarily for layout. This inline padding style should be in the StyledWrapper.

-            <div className="tab more-tabs select-none flex items-center cursor-pointer rounded-md" style={{ padding: '2px 8px' }}>
+            <div className="tab more-tabs select-none flex items-center cursor-pointer rounded-md">

Then add to StyledWrapper.js:

     div.more-tabs {
       color: ${(props) => props.theme.text} !important;
       background-color: ${(props) => props.theme.requestTabs.bg} !important;
+      padding: 2px 8px;
       &:hover {
📜 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 8e855e5 and cf82697.

📒 Files selected for processing (7)
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/StyledWrapper.js (0 hunks)
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (3 hunks)
  • packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (2 hunks)
  • packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js (1 hunks)
  • packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.js (2 hunks)
  • packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js (1 hunks)
  • packages/bruno-app/src/pages/Bruno/StyledWrapper.js (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/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/pages/Bruno/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.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} : 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/pages/Bruno/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/RequestPaneTabs/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/pages/Bruno/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.js
📚 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/components/RequestPane/GraphQLRequestPane/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/RequestPane/RequestPaneTabs/StyledWrapper.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (2)
packages/bruno-app/src/components/RequestPane/GraphQLSchemaActions/index.js (1)
  • GraphQLSchemaActions (8-70)
packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js (1)
  • RequestPaneTabs (11-175)
⏰ 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 - Windows
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: Unit Tests
  • GitHub Check: CLI Tests
🔇 Additional comments (11)
packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.js (1)

5-11: Verify necessity of !important flags.

Three !important declarations in the .more-tabs styling suggest potential specificity conflicts. These often indicate underlying CSS architecture issues.

Consider investigating whether the styles can be applied without !important by adjusting selector specificity or refactoring the component hierarchy.

packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js (1)

5-5: LGTM with minor note.

The min-width: 125px ensures the body mode selector has sufficient space. Consider testing on narrow viewports to ensure this doesn't cause horizontal scrolling issues.

packages/bruno-app/src/pages/Bruno/StyledWrapper.js (1)

18-18: Verify scrolling behavior within panes.

Adding overflow: hidden prevents content from overflowing these sections. Ensure that child components within these panes properly handle scrolling for their content.

packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (2)

63-91: Excellent use of React hooks for optimization.

The memoized callbacks (onQueryChange, onRun, onSave, selectTab) with correct dependency arrays prevent unnecessary re-renders and improve performance.


135-137: Good defensive error handling.

Validating activeTabUid, focusedTab, and requestPaneTab before rendering prevents potential runtime errors from undefined state.

packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (3)

36-47: Clean component mapping pattern.

The TAB_PANELS object provides a maintainable lookup for tab content components, eliminating the need for a large switch statement.


77-82: Well-optimized active counts computation.

Memoizing activeCounts with proper dependencies prevents unnecessary recalculations when unrelated props change.


119-124: Proper auto-select guard implementation.

Using initialAutoSelectDone.current prevents the auto-select effect from re-firing inappropriately while still responding to the necessary dependencies.

packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js (3)

34-72: Robust tab visibility calculation.

The algorithm correctly handles dynamic tab visibility with overflow and promotes the active tab from overflow when needed. The measurement approach using actual DOM elements is appropriate.


110-130: Excellent performance optimization with ResizeObserver and requestAnimationFrame.

The debouncing strategy using requestAnimationFrame prevents excessive recalculations during resize events, and the delayed calculation for specific tabs prevents layout thrashing.


139-150: Clever pre-measurement approach.

Using a hidden duplicate row to measure tab widths before rendering prevents layout shifts and enables accurate visibility calculations.

@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 (2)
tests/collection/moving-requests/tag-persistence.spec.ts (2)

130-132: Inconsistent variable naming.

The variable is named tagInput2 here but tagInput in the first test (line 47). For consistency, use tagInput in both tests unless there's a specific reason for the distinction.

Apply this diff:

-    const tagInput2 = await page.getByTestId('tag-input').getByRole('textbox');
-    await tagInput2.fill('smoke');
-    await tagInput2.press('Enter');
+    const tagInput = await page.getByTestId('tag-input').getByRole('textbox');
+    await tagInput.fill('smoke');
+    await tagInput.press('Enter');

42-50: Consider reducing waitForTimeout usage.

As per coding guidelines, prefer using Playwright's built-in expectations over arbitrary timeouts. These waits can make tests slower and more flaky.

For example, instead of:

await page.waitForTimeout(200);
const tagInput = await page.getByTestId('tag-input').getByRole('textbox');

Consider:

const tagInput = page.getByTestId('tag-input').getByRole('textbox');
await expect(tagInput).toBeVisible();

Note: This applies to multiple locations in the file, though some waits may be necessary for UI transitions.

Also applies to: 75-75, 129-133, 170-170

📜 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 cf82697 and 84d6ff9.

📒 Files selected for processing (5)
  • tests/collection/moving-requests/tag-persistence.spec.ts (5 hunks)
  • tests/request/settings/max-redirects.spec.ts (2 hunks)
  • tests/request/settings/no-redirects.spec.ts (2 hunks)
  • tests/request/settings/timeout.spec.ts (2 hunks)
  • tests/utils/page/actions.ts (2 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:

  • tests/utils/page/actions.ts
  • tests/request/settings/timeout.spec.ts
  • tests/request/settings/no-redirects.spec.ts
  • tests/collection/moving-requests/tag-persistence.spec.ts
  • tests/request/settings/max-redirects.spec.ts
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/utils/page/actions.ts
  • tests/request/settings/timeout.spec.ts
  • tests/request/settings/no-redirects.spec.ts
  • tests/collection/moving-requests/tag-persistence.spec.ts
  • tests/request/settings/max-redirects.spec.ts
🧬 Code graph analysis (3)
tests/request/settings/timeout.spec.ts (1)
tests/utils/page/actions.ts (1)
  • selectRequestPaneTab (567-567)
tests/request/settings/no-redirects.spec.ts (1)
tests/utils/page/actions.ts (1)
  • selectRequestPaneTab (567-567)
tests/collection/moving-requests/tag-persistence.spec.ts (1)
tests/utils/page/actions.ts (1)
  • selectRequestPaneTab (567-567)
⏰ 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: Unit Tests
  • GitHub Check: CLI Tests
  • GitHub Check: Playwright E2E Tests
🔇 Additional comments (6)
tests/request/settings/no-redirects.spec.ts (1)

2-2: LGTM! Clean adoption of the tab helper.

The import and usage of selectRequestPaneTab follows the recommended pattern and improves maintainability by centralizing tab selection logic.

Also applies to: 17-17

tests/request/settings/max-redirects.spec.ts (1)

2-2: LGTM! Consistent with the refactoring pattern.

The helper usage is clean and aligns with the tab abstraction introduced across the test suite.

Also applies to: 17-17

tests/request/settings/timeout.spec.ts (1)

2-2: LGTM! Proper helper adoption.

The tab selection helper is correctly integrated alongside the existing closeAllCollections import.

Also applies to: 16-16

tests/utils/page/actions.ts (2)

504-529: Excellent implementation of the tab selection helper.

The function demonstrates several best practices:

  • Wrapped in test.step for better test reporting
  • Handles both visible tabs and overflow dropdown
  • Uses proper visibility checks and expectations
  • Provides descriptive error message when tab cannot be found

This abstraction will make tests more maintainable and resilient to UI changes.


566-567: LGTM! Properly exported for reuse.

The new helper is correctly added to the module exports.

tests/collection/moving-requests/tag-persistence.spec.ts (1)

2-2: LGTM! Consistent adoption of the tab helper.

The selectRequestPaneTab helper is correctly used across all four locations in the test suite.

Also applies to: 45-45, 74-74, 128-128, 169-169

@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 (4)
tests/request/settings/max-redirects.spec.ts (1)

5-44: Consider wrapping test logic in test.step blocks.

The test would benefit from organizing its flow into logical steps (e.g., "Navigate to request", "Configure max redirects", "Verify behavior", "Clean up"). This improves report readability.

Example structure:

 test('should configure and test max redirects settings', async ({
   pageWithUserData: page
 }) => {
+  await test.step('Navigate to the max-redirects request', async () => {
     await expect(page.locator('#sidebar-collection-name').getByText('settings-test')).toBeVisible();
     await page.locator('#sidebar-collection-name').getByText('settings-test').click();
     await page.getByRole('complementary').getByText('max-redirects').click();
+  });

+  await test.step('Configure max redirects settings', async () => {
     await selectRequestPaneTab(page, 'Settings');
     const maxRedirectsInput = page.locator('input[id="maxRedirects"]');
     await expect(maxRedirectsInput).toBeVisible();
     await expect(maxRedirectsInput).toHaveValue('1');
     const followRedirectsToggle = page.getByTestId('follow-redirects-toggle');
     await expect(followRedirectsToggle).toBeVisible();
     await expect(followRedirectsToggle).toBeChecked();
+  });

+  await test.step('Verify max redirects behavior', async () => {
     await page.getByTestId('send-arrow-icon').click();
     await expect(page.getByTestId('response-status-code')).toContainText('302', { timeout: 15000 });
     await maxRedirectsInput.fill('2');
     await page.getByTestId('send-arrow-icon').click();
     await expect(page.getByTestId('response-status-code')).toContainText('200', { timeout: 15000 });
+  });

+  await test.step('Close without saving changes', async () => {
     await page.locator('.close-icon-container').click();
     await page.locator('button:has-text("Don\'t Save")').first().click();
+  });
 });

Based on coding guidelines, test.step should be promoted as much as possible for better report readability.

packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js (2)

48-58: Consider extracting magic number for fallback tab width.

The fallback 100 on line 50 is a sensible default but could be clearer as a named constant alongside DROPDOWN_WIDTH.

 const DROPDOWN_WIDTH = 60;
 const CALCULATION_DELAY_DEFAULT = 20;
 const CALCULATION_DELAY_EXTENDED = 150;
+const DEFAULT_TAB_WIDTH = 100;

Then use DEFAULT_TAB_WIDTH instead of 100.


78-91: Consider adding aria-selected for accessibility.

The dropdown items and visible tabs use role="tab" but lack aria-selected to indicate the active state to assistive technologies.

         return (
           <div
             key={tab.key}
             className={classnames('dropdown-item', { active: isActive })}
             role="tab"
+            aria-selected={isActive}
             onClick={() => handleTabSelect(tab.key)}
           >

Same for the visible tab at line 98.

packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (1)

60-63: Dependency array may cause stale closures.

getProperty depends on [item.draft, item], but item.draft is a boolean derived from item. If item changes but item.draft stays the same (or vice versa), memoization might behave unexpectedly. Consider simplifying to [item] only.

   const getProperty = useCallback(
     (key) => (item.draft ? get(item, `draft.${key}`, []) : get(item, key, [])),
-    [item.draft, item]
+    [item]
   );
📜 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 84d6ff9 and 4c43632.

📒 Files selected for processing (12)
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/StyledWrapper.js (0 hunks)
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (3 hunks)
  • packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (2 hunks)
  • packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js (1 hunks)
  • packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.js (2 hunks)
  • packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js (1 hunks)
  • packages/bruno-app/src/pages/Bruno/StyledWrapper.js (1 hunks)
  • tests/collection/moving-requests/tag-persistence.spec.ts (4 hunks)
  • tests/request/settings/max-redirects.spec.ts (2 hunks)
  • tests/request/settings/no-redirects.spec.ts (2 hunks)
  • tests/request/settings/timeout.spec.ts (2 hunks)
  • tests/utils/page/actions.ts (3 hunks)
💤 Files with no reviewable changes (1)
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/StyledWrapper.js
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js
  • packages/bruno-app/src/pages/Bruno/StyledWrapper.js
  • tests/collection/moving-requests/tag-persistence.spec.ts
  • tests/utils/page/actions.ts
  • tests/request/settings/no-redirects.spec.ts
  • tests/request/settings/timeout.spec.ts
🧰 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/RequestPane/RequestPaneTabs/index.js
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js
  • tests/request/settings/max-redirects.spec.ts
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/request/settings/max-redirects.spec.ts
🧠 Learnings (4)
📚 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/components/RequestPane/GraphQLRequestPane/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/RequestPane/RequestPaneTabs/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/RequestPane/RequestPaneTabs/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} : 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/RequestPane/RequestPaneTabs/StyledWrapper.js
🧬 Code graph analysis (2)
packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js (3)
packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (1)
  • tabs (51-51)
packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.js (1)
  • StyledWrapper (3-54)
packages/bruno-app/src/components/Dropdown/index.js (1)
  • Dropdown (5-25)
packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (3)
packages/bruno-app/src/components/RequestPane/QueryParams/index.js (3)
  • QueryParams (24-276)
  • dispatch (25-25)
  • params (27-27)
packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js (1)
  • RequestHeaders (19-192)
packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js (1)
  • RequestPaneTabs (11-175)
⏰ 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: Unit Tests
  • GitHub Check: CLI Tests
🔇 Additional comments (10)
tests/request/settings/max-redirects.spec.ts (1)

2-2: Good adoption of the centralized tab helper.

Using selectRequestPaneTab improves consistency across the test suite and makes tab selection logic maintainable in one place.

Also applies to: 17-17

packages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.js (1)

4-53: LGTM!

Styling correctly uses theme props for colors and CSS for layout, aligning with the styled-components conventions. The !important declarations are acceptable here to ensure proper tab state styling overrides. The semicolon fix on .content-indicator and the new sup styling for indicators look correct.

Based on learnings, Styled Components are appropriately used as wrappers with theme-based colors.

packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.js (2)

116-130: LGTM on ResizeObserver setup.

Proper cleanup with cancelAnimationFrame and observer.disconnect(). The frameId pattern correctly debounces resize events.


1-9: Solid new component implementation.

Good separation of concerns with memoized callbacks, proper cleanup in effects, and a clean approach to tab overflow handling. The hidden measurement technique for tab widths is a reasonable pattern.

packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (3)

59-61: Verify onSchemaLoad stability from parent.

If onSchemaLoad is not wrapped in useCallback by the parent, this effect will re-run on every parent render. Ensure the prop is memoized upstream.


24-37: TAB_CONFIG differs from HttpRequestPane - intentional but worth noting.

GraphQL uses query/variables while HTTP uses params/body. If more request types are added, consider extracting shared tabs to a common config.


147-160: LGTM on RequestPaneTabs integration.

Clean handoff to the new unified tab component. The rightContentRef pattern correctly enables the overflow calculation to account for the schema actions area.

packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (3)

91-107: LGTM on indicators logic.

Clean separation of concerns. The error state indicators for scripts and tests provide good visual feedback. Optional chaining on tests?.length and docs?.length is appropriate.


119-124: LGTM on auto-select logic.

The initialAutoSelectDone ref correctly prevents repeated auto-selection after the first render. This improves UX by defaulting to the Body tab when appropriate.


36-47: Clean TAB_PANELS pattern.

Using an object lookup instead of a switch statement for tab content is a maintainable approach. Easy to extend when adding new tabs.

@bijin-bruno
bijin-bruno merged commit cf4c896 into usebruno:main Dec 9, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Mar 16, 2026
6 tasks done
@coderabbitai coderabbitai Bot mentioned this pull request May 11, 2026
6 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Jun 19, 2026
6 tasks
maxenceleblanc pushed a commit to maxenceleblanc/curly_cats2 that referenced this pull request Jul 20, 2026
* improve: tabs design

* fixes: tests
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