Repository navigation
improve: tabs design - #6363
improve: tabs design#6363
Conversation
WalkthroughConsolidates 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (1)
93-93: Remove unnecessary useMemo.Since
TAB_CONFIGis a constant, thisuseMemoprovides 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_WIDTHis defined, there are hardcoded spacing values (20for margins,100for fallback width) used incalculateTabVisibility. 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
styleobject 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
📒 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()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/pages/Bruno/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.jspackages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.jspackages/bruno-app/src/components/RequestPane/HttpRequestPane/index.jspackages/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.jspackages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.jspackages/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.jspackages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.jspackages/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
!importantdeclarations in the.more-tabsstyling suggest potential specificity conflicts. These often indicate underlying CSS architecture issues.Consider investigating whether the styles can be applied without
!importantby 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: 125pxensures 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: hiddenprevents 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, andrequestPaneTabbefore 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_PANELSobject provides a maintainable lookup for tab content components, eliminating the need for a large switch statement.
77-82: Well-optimized active counts computation.Memoizing
activeCountswith proper dependencies prevents unnecessary recalculations when unrelated props change.
119-124: Proper auto-select guard implementation.Using
initialAutoSelectDone.currentprevents 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
requestAnimationFrameprevents 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.
There was a problem hiding this comment.
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
tagInput2here buttagInputin the first test (line 47). For consistency, usetagInputin 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 reducingwaitForTimeoutusage.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
📒 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()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
tests/utils/page/actions.tstests/request/settings/timeout.spec.tstests/request/settings/no-redirects.spec.tstests/collection/moving-requests/tag-persistence.spec.tstests/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 existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/utils/page/actions.tstests/request/settings/timeout.spec.tstests/request/settings/no-redirects.spec.tstests/collection/moving-requests/tag-persistence.spec.tstests/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
selectRequestPaneTabfollows 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
closeAllCollectionsimport.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.stepfor 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
selectRequestPaneTabhelper is correctly used across all four locations in the test suite.Also applies to: 45-45, 74-74, 128-128, 169-169
84d6ff9 to
4c43632
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
tests/request/settings/max-redirects.spec.ts (1)
5-44: Consider wrapping test logic intest.stepblocks.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
100on line 50 is a sensible default but could be clearer as a named constant alongsideDROPDOWN_WIDTH.const DROPDOWN_WIDTH = 60; const CALCULATION_DELAY_DEFAULT = 20; const CALCULATION_DELAY_EXTENDED = 150; +const DEFAULT_TAB_WIDTH = 100;Then use
DEFAULT_TAB_WIDTHinstead of100.
78-91: Consider addingaria-selectedfor accessibility.The dropdown items and visible tabs use
role="tab"but lackaria-selectedto 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.
getPropertydepends on[item.draft, item], butitem.draftis a boolean derived fromitem. Ifitemchanges butitem.draftstays 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
📒 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()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/RequestPane/RequestPaneTabs/index.jspackages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.jspackages/bruno-app/src/components/RequestPane/RequestPaneTabs/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/HttpRequestPane/index.jstests/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 existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/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
selectRequestPaneTabimproves 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
!importantdeclarations are acceptable here to ensure proper tab state styling overrides. The semicolon fix on.content-indicatorand the newsupstyling 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
cancelAnimationFrameandobserver.disconnect(). TheframeIdpattern 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: VerifyonSchemaLoadstability from parent.If
onSchemaLoadis not wrapped inuseCallbackby 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/variableswhile HTTP usesparams/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
rightContentRefpattern 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?.lengthanddocs?.lengthis appropriate.
119-124: LGTM on auto-select logic.The
initialAutoSelectDoneref 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.
* improve: tabs design * fixes: tests
Description
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
New Features
Style
Bug Fixes
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.