Repository navigation
refactor: enhance GrpcRequestPane and GrpcResponsePane with ResponsiveTabs component - #6649
Conversation
WalkthroughCentralized gRPC pane tabs by migrating request/response panes to ResponsiveTabs, removed pane-specific tab CSS, adjusted multiple auth/layout spacings, added a "No Auth" view, introduced a SearchInput StyledWrapper, and updated test locators to the new tab DOM structure. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GrpcRequestPane
participant ResponsiveTabs
participant GrpcAuthMode
participant TabPanel
User->>GrpcRequestPane: open pane / click tab
GrpcRequestPane->>ResponsiveTabs: render(allTabs, activeTab, rightContent)
ResponsiveTabs->>GrpcRequestPane: onTabSelect(tabKey)
GrpcRequestPane->>TabPanel: render panel for active tab (Body/Metadata/Docs)
GrpcRequestPane->>GrpcAuthMode: render rightContent when Auth tab active
TabPanel-->>User: display content
sequenceDiagram
participant User
participant GrpcResponsePane
participant ResponsiveTabs
participant ResponseControls
participant TimelinePanel
User->>GrpcResponsePane: select Response/Timeline tab
GrpcResponsePane->>ResponsiveTabs: render(tabs with indicators, activeTab)
ResponsiveTabs->>GrpcResponsePane: onTabSelect(tabKey)
GrpcResponsePane->>ResponseControls: show controls when Response tab active
GrpcResponsePane->>TimelinePanel: show timeline when Timeline tab selected
GrpcResponsePane-->>User: update visible panel
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (CODING_STANDARDS.md)
Files:
🧠 Learnings (1)📚 Learning: 2025-12-17T21:41:24.730ZApplied to files:
⏰ 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)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (2)
30-37: Consider wrappingselectTabinuseCallbackfor consistency.
GrpcRequestPaneusesuseCallbackfor itsselectTabfunction while this file does not. Consider wrapping for consistency and to prevent unnecessary re-renders ofResponsiveTabs.🔎 Proposed fix
- const selectTab = (tab) => { + const selectTab = useCallback((tab) => { dispatch( updateResponsePaneTab({ uid: item.uid, responsePaneTab: tab }) ); - }; + }, [dispatch, item.uid]);Update the import:
-import React, { useMemo, useRef } from 'react'; +import React, { useMemo, useRef, useCallback } from 'react';
69-87: Consider memoizinggetTabPanelfor consistency.
GrpcRequestPaneusesuseMemofor itstabPanelwhile this file uses a regular function. For consistency and potential performance gains, consider memoizing.🔎 Proposed refactor
- const getTabPanel = (tab) => { - switch (tab) { + const tabPanel = useMemo(() => { + switch (focusedTab?.responsePaneTab) { case 'response': { return <GrpcQueryResult item={item} collection={collection} />; } // ... rest of cases } - }; + }, [focusedTab?.responsePaneTab, item, collection, response.metadata, response.trailers]);Then use
{tabPanel}instead of{getTabPanel(focusedTab.responsePaneTab)}at line 154.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
💤 Files with no reviewable changes (1)
- packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
🧠 Learnings (1)
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (1)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
ResponsiveTabs(19-267)
⏰ 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 (10)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (5)
1-13: LGTM on imports restructuring.Clean import organization with the new ResponsiveTabs component and hooks.
20-30: LGTM on tab state derivation and callback.The
selectTabcallback is correctly memoized with appropriate dependencies. Thefindoperation forfocusedTabis acceptable given the typically small tabs array.
32-50: LGTM on tabPanel memoization.The memoized panel selection is well-structured. Dependencies are necessary since child components consume these props.
100-102: LGTM on error guard.Good defensive check to prevent rendering in invalid states.
104-120: LGTM on ResponsiveTabs integration.Clean replacement of the custom tab implementation with the unified ResponsiveTabs component. Props align with the component's API.
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (5)
1-17: LGTM on imports restructuring.Clean import updates with ResponsiveTabs and hook adjustments.
41-67: LGTM on tab configuration.Good defensive checks with
Array.isArraybefore accessinglength. TheallTabsstructure aligns with the pattern inGrpcRequestPane.
89-112: LGTM on early return guards.Appropriate defensive checks for various invalid or loading states.
114-134: LGTM on rightContent implementation.The conditional rendering logic for the right-side content is well-structured. The
rightContentRefintegration withResponsiveTabsfollows the component's API for responsive layout calculations.
136-158: LGTM on ResponsiveTabs integration and layout.Clean migration to
ResponsiveTabswith proper use ofrightContentandrightContentRefprops. Theh-0withflex-growpattern is appropriate for the flex layout.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (1)
64-98: Suggest consistent optional chaining on line 90.The past review concern about potential null reference on
auth.modehas been largely addressed with the use ofauth?.mode. However, for consistency and clarity, the second part of the condition on line 90 should also use optional chaining.🔎 Suggested consistency improvement
{ key: 'auth', label: 'Auth', - indicator: auth?.mode && auth.mode !== 'none' ? <StatusDot type="default" /> : null + indicator: auth?.mode && auth?.mode !== 'none' ? <StatusDot type="default" /> : null },While the current code is safe due to short-circuit evaluation, using optional chaining in both places improves readability and maintains consistency with the dependency array at line 98.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
🧠 Learnings (2)
📚 Learning: 2025-12-02T07:24:50.311Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6263
File: packages/bruno-requests/src/auth/oauth2-helper.ts:249-249
Timestamp: 2025-12-02T07:24:50.311Z
Learning: In OAuth2 Basic Auth headers for Bruno, clientSecret is optional and can be omitted. When constructing the Authorization header in `packages/bruno-requests/src/auth/oauth2-helper.ts`, use `clientSecret || ''` instead of `clientSecret!` to properly handle cases where only clientId is provided, per community requests.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (5)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js (1)
dispatch(23-23)packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (8)
tabs(50-50)activeTabUid(51-51)focusedTab(55-55)requestPaneTab(56-56)selectTab(82-87)tabPanel(112-115)allTabs(107-110)docs(69-69)packages/bruno-app/src/components/StatusDot/index.js (1)
StatusDot(4-12)packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js (1)
StyledWrapper(3-4)packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
ResponsiveTabs(19-267)
⏰ 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: Unit Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - Windows
🔇 Additional comments (7)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (7)
1-1: LGTM! Clean import additions.The new imports (
useMemo,useCallback,find,ResponsiveTabs) are all properly utilized in the refactored tab handling logic.Also applies to: 9-9, 12-13
20-21: LGTM! Proper state derivation.The use of
findwith optional chaining follows React-Redux best practices and safely handles cases where the focused tab might not exist.
23-30: LGTM! Properly memoized callback.The
selectTabcallback is correctly memoized with appropriate dependencies, following React performance best practices.
32-50: LGTM! Comprehensive tab panel memoization.The switch statement covers all expected tab cases with a sensible default, and the dependencies correctly capture all values referenced within the memo.
100-102: LGTM! Appropriate error handling.The early return guards against missing essential state and provides a clear error message for cases where the component cannot render properly.
106-110: LGTM! Clean ResponsiveTabs integration.The ResponsiveTabs component is properly configured with all required props, successfully replacing the custom tab implementation with a unified, maintainable solution.
112-118: LGTM! Streamlined tab panel rendering.The simplified rendering approach using the memoized
tabPaneleliminates conditional logic duplication and maintains a single source of truth for tab content.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (1)
115-135: Consider memoizing rightContent for consistency.The
rightContentconditional rendering works correctly, but since it depends on multiple props (isLoading,focusedTab.responsePaneTab,item.response,response.*), wrapping it inuseMemowould prevent unnecessary re-creation on unrelated renders and align with the optimization pattern used elsewhere in this refactor.🔎 Optional optimization
+ const rightContent = useMemo(() => { + if (isLoading) return null; + - const rightContent = !isLoading ? ( + return ( <div ref={rightContentRef} className="flex items-center"> {focusedTab?.responsePaneTab === 'timeline' ? ( <> <ResponseLayoutToggle /> <ClearTimeline item={item} collection={collection} /> </> ) : item?.response ? ( <> <ResponseLayoutToggle /> <ResponseClear item={item} collection={collection} /> <GrpcStatusCode status={response.statusCode} text={response.statusText} details={response.statusDescription} /> <ResponseTime duration={response.duration} /> </> ) : null} </div> - ) : null; + ); + }, [isLoading, focusedTab?.responsePaneTab, item, collection, response.statusCode, response.statusText, response.statusDescription, response.duration]);packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (1)
9-9: Consider using specific lodash import for optimal tree-shaking.The import was changed from
import find from 'lodash/find'toimport { find } from 'lodash'. While both work, the specific import path typically results in better tree-shaking and smaller bundle sizes.🔎 Revert to specific import
-import { find } from 'lodash'; +import find from 'lodash/find';
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
🧠 Learnings (2)
📚 Learning: 2025-12-02T07:24:50.311Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6263
File: packages/bruno-requests/src/auth/oauth2-helper.ts:249-249
Timestamp: 2025-12-02T07:24:50.311Z
Learning: In OAuth2 Basic Auth headers for Bruno, clientSecret is optional and can be omitted. When constructing the Authorization header in `packages/bruno-requests/src/auth/oauth2-helper.ts`, use `clientSecret || ''` instead of `clientSecret!` to properly handle cases where only clientId is provided, per community requests.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
🧬 Code graph analysis (2)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (1)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
ResponsiveTabs(19-267)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (1)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
ResponsiveTabs(19-267)
🔇 Additional comments (11)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (4)
1-1: LGTM! Clean integration of ResponsiveTabs infrastructure.The new imports for
useMemo,useRef, andResponsiveTabsare properly structured and follow the coding guidelines.Also applies to: 17-17, 24-24
41-43: LGTM! Safe count calculations.The array checks before accessing
.lengthproperly guard against undefined values.
45-68: LGTM! Well-structured tab configuration.The memoized
allTabsarray correctly includes all count dependencies and provides clear tab indicators. The structure aligns well with the ResponsiveTabs API.
139-147: LGTM! ResponsiveTabs correctly integrated.The component receives all required props (
tabs,activeTab,onTabSelect) and optional props (rightContent,rightContentRef) as specified in the ResponsiveTabs API.packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (7)
1-1: LGTM! Clean hook and component imports.The new React hooks (
useMemo,useCallback,useEffect) and UI components are properly imported following the coding guidelines.Also applies to: 12-13
20-21: LGTM! Proper tab state derivation and memoized selection.The
focusedTabandrequestPaneTabare safely derived with optional chaining, andselectTabis correctly memoized with appropriate dependencies.Also applies to: 23-30
32-50: LGTM! Well-structured tab panel memoization.The switch-based
tabPanelmemo correctly includes all dependencies and provides clean separation of panel logic from rendering.
64-98: LGTM! Comprehensive tab configuration with proper safeguards.The
allTabsmemoization includes:
- Correct use of optional chaining for
auth?.mode(addressing the previous review concern)- Dynamic indicators based on message count and streaming type
- Proper dependency array including all referenced values
The nested
getMessageIndicatorhelper keeps the logic clean and readable.
101-105: LGTM! Sensible default tab initialization.The
useEffectensures a valid tab is always selected by defaulting to 'body' when needed, with correct dependencies to avoid infinite loops.
107-109: Error guard works correctly with initialization effect.The error guard at lines 107-109 will briefly show during the first render when
requestPaneTabis undefined, then theuseEffectat lines 101-105 will initialize it to 'body'. This brief flash is acceptable and the pattern is consistent with React's rendering model.
113-117: LGTM! ResponsiveTabs correctly integrated.The component receives all required props with the memoized
allTabsconfiguration and the memoizedselectTabcallback, ensuring optimal performance.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
221-234:useMemodependency on derived array negates memoization.
overflowTabs(line 218) is a new array created every render, so including it in the dependency array meansoverflowMenuItemsrecalculates on every render anyway.Consider using
overflowTabKeysinstead and deriving the menu items from the keys array combined with a tabs lookup:Proposed fix
const overflowMenuItems = useMemo(() => { - return overflowTabs.map((tab) => ({ - id: tab.key, + return overflowTabKeys.map((key) => { + const tab = tabs.find((t) => t.key === key); + if (!tab) return null; + return { + id: key, label: ( <span className="flex items-center gap-1"> {tab.label} {tab.indicator} </span> ), ariaLabel: typeof tab.label === 'string' ? tab.label : tab.key, - onClick: () => handleTabSelect(tab.key), - className: classnames({ active: tab.key === activeTab }) - })); - }, [overflowTabs, activeTab, handleTabSelect]); + onClick: () => handleTabSelect(key), + className: classnames({ active: key === activeTab }) + }; + }).filter(Boolean); + }, [overflowTabKeys, tabs, activeTab, handleTabSelect]);packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (2)
26-28: Filter callback can be simplified.The filter returns
trueexplicitly but relies on implicitundefinedfor thefalsecase.Suggested improvement
- const requestTimeline = [...(collection?.timeline || [])].filter((obj) => { - if (obj.itemUid === item.uid) return true; - }); + const requestTimeline = [...(collection?.timeline || [])].filter((obj) => obj.itemUid === item.uid);
45-71: Consider memoizingallTabs.The
allTabsarray is recreated on every render. WhileResponsiveTabsnow uses key-based comparison (mitigating re-render issues), memoizing based on the count values would be more consistent with the performance optimizations mentioned in the PR objectives.Optional refactor
+import React, { useRef, useMemo } from 'react'; ... - const allTabs = [ + const allTabs = useMemo(() => [ { key: 'response', ... }, ... - ]; + ], [responsesCount, metadataCount, trailersCount]);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.jspackages/bruno-app/src/ui/ResponsiveTabs/index.jstests/utils/page/locators.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:
tests/utils/page/locators.tspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.jspackages/bruno-app/src/ui/ResponsiveTabs/index.js
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/utils/page/locators.ts
🧠 Learnings (1)
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.jspackages/bruno-app/src/ui/ResponsiveTabs/index.js
🧬 Code graph analysis (2)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (6)
packages/bruno-app/src/components/ResponsePane/index.js (6)
dispatch(32-32)tabs(33-33)rightContentRef(37-37)response(39-39)allTabs(112-142)rightContent(220-272)packages/bruno-app/src/components/ResponsePane/ResponseClear/index.js (1)
ResponseClear(25-45)packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/GrpcStatusCode/index.js (1)
GrpcStatusCode(6-25)packages/bruno-app/src/components/ResponsePane/ResponseTime/index.js (1)
ResponseTime(5-21)packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/GrpcQueryResult/StyledWrapper.js (1)
StyledWrapper(3-79)packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
ResponsiveTabs(19-278)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (5)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (1)
tabs(21-21)packages/bruno-app/src/components/ResponsePane/index.js (1)
tabs(33-33)packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (1)
tabs(40-40)packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (1)
tabs(50-50)packages/bruno-app/src/components/RequestTabPanel/index.js (1)
tabs(49-49)
⏰ 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: Playwright E2E Tests
- GitHub Check: Unit Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: CLI Tests
🔇 Additional comments (7)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (3)
13-17: LGTM! Clean, focused utility for key-based equality checks. This approach avoids reference-comparison pitfalls and prevents infinite loops when tab objects are recreated.
82-91: Well-structured state update pattern. Storing keys and comparing them before updating state is a solid strategy to prevent unnecessary re-renders and infinite loops.
216-218: Mapping keys to fresh tab objects ensures indicators stay current. This correctly retrieves up-to-date indicator props from the provided tabs array on each render.packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (3)
1-17: Clean import refactor. Switching touseRefand integratingResponsiveTabsaligns with the PR's goal of unifying tab implementations.
118-138: Right content integration looks correct. Conditional rendering based onresponsePaneTabandisLoadingstate is properly structured, and the ref is correctly attached for layout calculations.
142-149: LGTM! Clean integration ofResponsiveTabswith all required props. The component now aligns with the unified tab approach used across the codebase.tests/utils/page/locators.ts (1)
201-201: Good use of role-based locator scoping. This aligns with Playwright best practices and correctly targets thegrpc-tab-response-counttestId within theResponsetab rendered byResponsiveTabs(which appliesrole="tab"to each tab element).
97dada4 to
de7201c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Fix all issues with AI Agents 🤖
In @packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js:
- Around line 100-109: The synchronous guard that returns "An error occurred!"
can flash before the useEffect initializes the tab; update the logic around
activeTabUid, focusedTab?.uid, requestPaneTab and the useEffect that calls
selectTab('body') so the component renders a neutral initializing state (e.g.,
null or a small loader) while initialization is pending rather than an error,
and only show the error after initialization has completed and the conditions
truly indicate a failure; adjust the conditional that currently returns the
error to distinguish an "initializing" state (when activeTabUid &&
focusedTab?.uid && !requestPaneTab and the effect has not run yet) from a real
error, or add an isInitializing flag derived from those symbols to control
whether to return null/loader vs the error.
🧹 Nitpick comments (2)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
216-234:overflowMenuItemsuseMemo has an unstable dependency.
overflowTabsis derived inline without memoization (line 218), creating a new array reference on every render. This causesoverflowMenuItemsuseMemo to recalculate unnecessarily.Consider memoizing both derived arrays:
🔎 Proposed fix
- // Map stored keys to fresh tab objects from props (ensures indicators stay up-to-date) - const visibleTabs = visibleTabKeys.map((key) => tabs.find((t) => t.key === key)).filter(Boolean); - const overflowTabs = overflowTabKeys.map((key) => tabs.find((t) => t.key === key)).filter(Boolean); + // Map stored keys to fresh tab objects from props (ensures indicators stay up-to-date) + const visibleTabs = useMemo( + () => visibleTabKeys.map((key) => tabs.find((t) => t.key === key)).filter(Boolean), + [visibleTabKeys, tabs] + ); + const overflowTabs = useMemo( + () => overflowTabKeys.map((key) => tabs.find((t) => t.key === key)).filter(Boolean), + [overflowTabKeys, tabs] + );packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (1)
41-71: Consider memoizingallTabs.The
allTabsarray is recreated on every render. Since this is passed toResponsiveTabs, it could trigger unnecessary recalculations. Consider wrapping withuseMemo:🔎 Proposed fix
+import React, { useRef, useMemo } from 'react'; -import React, { useRef } from 'react';- const allTabs = [ + const allTabs = useMemo(() => [ { key: 'response', label: 'Response', indicator: responsesCount > 0 ? ( <sup data-testid="grpc-tab-response-count" className="ml-1 font-medium"> {responsesCount} </sup> ) : null }, { key: 'headers', label: 'Metadata', indicator: metadataCount > 0 ? <sup className="ml-1 font-medium">{metadataCount}</sup> : null }, { key: 'trailers', label: 'Trailers', indicator: trailersCount > 0 ? <sup className="ml-1 font-medium">{trailersCount}</sup> : null }, { key: 'timeline', label: 'Timeline', indicator: null } - ]; + ], [responsesCount, metadataCount, trailersCount]);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.jspackages/bruno-app/src/ui/ResponsiveTabs/index.jstests/utils/page/locators.ts
💤 Files with no reviewable changes (1)
- packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/utils/page/locators.ts
🧰 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/ui/ResponsiveTabs/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
🧠 Learnings (2)
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/ui/ResponsiveTabs/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
📚 Learning: 2025-12-02T07:24:50.311Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6263
File: packages/bruno-requests/src/auth/oauth2-helper.ts:249-249
Timestamp: 2025-12-02T07:24:50.311Z
Learning: In OAuth2 Basic Auth headers for Bruno, clientSecret is optional and can be omitted. When constructing the Authorization header in `packages/bruno-requests/src/auth/oauth2-helper.ts`, use `clientSecret || ''` instead of `clientSecret!` to properly handle cases where only clientId is provided, per community requests.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (5)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (1)
tabs(21-21)packages/bruno-app/src/components/ResponsePane/index.js (1)
tabs(33-33)packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (1)
tabs(40-40)packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (1)
tabs(50-50)packages/bruno-app/src/components/RequestTabPanel/index.js (1)
tabs(49-49)
⏰ 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 - Windows
- GitHub Check: SSL Tests - Linux
- GitHub Check: Unit Tests
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
🔇 Additional comments (11)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (3)
13-17: LGTM!Clean key-based equality check. This approach correctly avoids reference comparison issues that can cause infinite re-render loops when comparing tab objects.
29-30: LGTM!Storing keys instead of full tab objects is a solid pattern. This ensures indicators always reflect the latest props when tabs are re-derived for rendering.
82-91: LGTM!The functional setState with key comparison is the right approach to prevent infinite re-render loops. This ensures state only updates when the actual key sequence changes.
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (3)
1-24: LGTM!Imports and ref setup are correct. The
rightContentRefis properly initialized for ResponsiveTabs integration.
118-138: LGTM!The conditional
rightContentrendering logic is well-structured. Good use of optional chaining and clear separation between timeline vs other tab controls.
140-162: LGTM!Clean integration with
ResponsiveTabs. The component properly handles loading states, missing responses, and timeline-specific rendering.packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (5)
1-13: LGTM!Imports are clean and appropriate. Good choice using lodash's
findfor tab lookup.
20-30: LGTM!Good use of
useCallbackforselectTabwith correct dependencies. ThefocusedTabderivation is straightforward.
32-50: LGTM!Memoizing
tabPanelis a good optimization. Dependencies are complete and the switch logic correctly maps tabs to their respective components.
64-98: LGTM!The
allTabsmemoization is well-implemented with correct dependencies. Good to seeauth?.modeused defensively (addresses the previous review concern about potential null reference).
111-127: LGTM!Clean integration with
ResponsiveTabs. The layout structure withHeightBoundContaineris appropriate for the tab content.
de7201c to
ae8a11a
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js:
- Around line 100-109: Guard is returning the error UI before the useEffect can
initialize the tab, causing a flash; keep the existing useEffect (useEffect with
selectTab and deps activeTabUid, focusedTab?.uid, requestPaneTab, selectTab) but
change the render guards so that missing activeTabUid or focusedTab?.uid still
render the error, while a missing requestPaneTab (which will be initialized by
selectTab) returns null during initialization instead of the error message;
update the conditional logic to check requestPaneTab separately and return null
when it's not set, preserving the existing error return for truly missing
active/focused tabs.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.jstests/utils/page/locators.ts
💤 Files with no reviewable changes (1)
- packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
tests/utils/page/locators.tspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/utils/page/locators.ts
🧠 Learnings (2)
📚 Learning: 2025-12-02T07:24:50.311Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6263
File: packages/bruno-requests/src/auth/oauth2-helper.ts:249-249
Timestamp: 2025-12-02T07:24:50.311Z
Learning: In OAuth2 Basic Auth headers for Bruno, clientSecret is optional and can be omitted. When constructing the Authorization header in `packages/bruno-requests/src/auth/oauth2-helper.ts`, use `clientSecret || ''` instead of `clientSecret!` to properly handle cases where only clientId is provided, per community requests.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
🧬 Code graph analysis (2)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (5)
packages/bruno-app/src/components/ResponsePane/index.js (4)
dispatch(32-32)tabs(33-33)activeTabUid(34-34)allTabs(112-142)packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (6)
dispatch(39-39)tabs(40-40)activeTabUid(41-41)requestPaneTab(56-56)tabPanel(94-132)allTabs(92-92)packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js (1)
dispatch(23-23)packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/GrpcQueryResult/StyledWrapper.js (1)
StyledWrapper(3-79)packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
ResponsiveTabs(19-278)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (3)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/GrpcQueryResult/index.js (1)
response(16-16)packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/GrpcStatusCode/index.js (1)
GrpcStatusCode(6-25)packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
ResponsiveTabs(19-278)
⏰ 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: Unit Tests
- GitHub Check: SSL Tests - Linux
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Windows
🔇 Additional comments (10)
tests/utils/page/locators.ts (1)
201-201: LGTM! Good use of role-based selection.The locator now correctly targets the Response tab by role before accessing the count indicator, aligning with the new ResponsiveTabs component structure. This is a more robust and accessible approach.
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (4)
1-24: LGTM!Clean import changes. The switch to
useRefforrightContentRefis appropriate for the DOM reference needed by ResponsiveTabs.
41-71: LGTM!Good defensive checks with
Array.isArraybefore accessing length. The tab definitions with conditional indicators are clean and well-structured.
140-162: LGTM!ResponsiveTabs integration is clean. The flex layout with
h-0andflex-growensures proper height distribution in the flex container.
129-133: Remove unuseddetailsprop from GrpcStatusCode.The
GrpcStatusCodecomponent only acceptsstatusandtextprops. Thedetailsprop is not destructured or used by the component and should be removed.packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (5)
1-21: LGTM!Clean imports and early derivation of
focusedTabandrequestPaneTabimproves readability.
23-30: LGTM!Proper use of
useCallbackwith correct dependencies. This prevents unnecessary re-renders of ResponsiveTabs.
32-50: LGTM!Good use of
useMemofor the tab panel. Dependencies are comprehensive and the switch handles all expected cases with a sensible fallback.
64-98: LGTM!Good memoization of tab definitions. The
auth?.modeoptional chaining properly handles the potential null reference (previously flagged). The helper functiongetMessageIndicatorkeeps the logic clean.
111-127: LGTM!Clean ResponsiveTabs integration. The layout with
HeightBoundContainerproperly constrains the tab panel height.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js (1)
1-9: Consider consolidating React imports.The React imports are currently split across multiple lines (1, 8, 9). While this doesn't affect functionality, consolidating them improves readability.
🔎 Proposed consolidation
-import React, { useRef, forwardRef } from 'react'; +import React, { useRef, forwardRef, useEffect, useState } from 'react'; import get from 'lodash/get'; import Dropdown from 'components/Dropdown'; import { useDispatch } from 'react-redux'; import StyledWrapper from './StyledWrapper'; import { IconCaretDown, IconKey } from '@tabler/icons'; import { humanizeGrantType } from 'utils/collections'; -import { useEffect } from 'react'; -import { useState } from 'react';packages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.js (1)
27-43: Optional: Remove unreachable break statements.The
break;statements afterreturnare unreachable. While this doesn't affect functionality, removing them improves clarity.🔎 Proposed cleanup
switch (grantType) { case 'password': return <OAuth2PasswordCredentials item={item} save={save} request={request} handleRun={handleRun} updateAuth={updateAuth} collection={collection} />; - break; case 'authorization_code': return <OAuth2AuthorizationCode item={item} save={save} request={request} handleRun={handleRun} updateAuth={updateAuth} collection={collection} />; - break; case 'implicit': return <OAuth2Implicit item={item} save={save} request={request} handleRun={handleRun} updateAuth={updateAuth} collection={collection} />; - break; case 'client_credentials': return <OAuth2ClientCredentials item={item} save={save} request={request} handleRun={handleRun} updateAuth={updateAuth} collection={collection} />; - break; default: return <div>TBD</div>; - break; }packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (2)
10-10: Prefer modular lodash import for bundle optimization.Importing
findfrom the fulllodashpackage imports the entire library, increasing bundle size.🔎 Proposed fix
-import { find } from 'lodash'; +import find from 'lodash/find';
114-128: LGTM! Clean ResponsiveTabs integration.The conditional
rightContentrendering for the auth tab and the tab configuration are well-structured. The refactor successfully consolidates tab management.Minor: simplify rightContentRef ternary (optional)
Line 127 could be simplified slightly:
- rightContentRef={rightContent ? rightContentRef : null} + rightContentRef={rightContentRef}ResponsiveTabs should handle undefined/null refs gracefully. However, if explicit null is required by the component contract, the current approach is fine.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.jspackages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.jspackages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.js
🧠 Learnings (3)
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.jspackages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.js
📚 Learning: 2025-12-02T07:24:50.311Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6263
File: packages/bruno-requests/src/auth/oauth2-helper.ts:249-249
Timestamp: 2025-12-02T07:24:50.311Z
Learning: In OAuth2 Basic Auth headers for Bruno, clientSecret is optional and can be omitted. When constructing the Authorization header in `packages/bruno-requests/src/auth/oauth2-helper.ts`, use `clientSecret || ''` instead of `clientSecret!` to properly handle cases where only clientId is provided, per community requests.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.jspackages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/WsseAuth/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/Auth/BasicAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (2)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/GrpcAuthMode/index.js (1)
GrpcAuthMode(10-78)packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
ResponsiveTabs(19-278)
⏰ 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: Unit Tests
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - macOS
🔇 Additional comments (13)
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js (1)
76-76: LGTM! Styling change aligns with PR objectives.The margin adjustment from
my-4tomb-4removes unnecessary top spacing and maintains consistent layout with other auth components being updated in this PR.packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.js (1)
64-64: LGTM! Spacing standardization applied.Removing the top margin aligns with the PR's goal of consistent auth component layout. No functional impact.
packages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.js (1)
55-55: LGTM! Spacing standardization applied.Removing the top margin aligns with the PR's goal of consistent auth component layout. No functional impact.
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.js (1)
50-50: LGTM! Spacing standardization applied.Removing the top margin aligns with the PR's goal of consistent auth component layout. No functional impact.
packages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.js (1)
55-55: LGTM! Spacing standardization applied.Removing the top margin aligns with the PR's goal of consistent auth component layout. No functional impact.
packages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.js (1)
41-41: LGTM! Spacing standardization applied.Removing the top margin aligns with the PR's goal of consistent auth component layout. No functional impact.
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js (2)
79-81: LGTM! Clean handling for 'none' auth mode.The explicit case for 'none' provides clear user feedback and aligns with the supported modes list.
104-104: LGTM! Consistent spacing approach.Using
gap-2for flex row spacing is more semantic thanmt-2and aligns with the PR's layout consistency improvements.Also applies to: 113-113
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (5)
1-1: LGTM! Appropriate React hooks for memoization.The additional hooks (useMemo, useCallback, useEffect, useRef) are all utilized correctly throughout the refactor.
21-33: LGTM! Properly memoized callback with stable dependencies.The
selectTabcallback is correctly memoized, and the ref setup forrightContentis appropriate.
35-53: LGTM! Well-structured tab panel memoization.The
useMemocorrectly includes all render dependencies, and the switch-based routing with a 404 fallback is clean and maintainable.
67-101: LGTM! Comprehensive tab configuration with safe null handling.The memoized tab array properly addresses the previous review concern by using
auth?.modewith optional chaining at line 93. The indicator logic clearly communicates tab states to users.
104-112: Verify: potential UI flash during tab initialization.The guard at lines 110-112 returns an error before the
useEffectat lines 104-108 can initializerequestPaneTabto 'body'. On first render, this will briefly flash "An error occurred!" before the effect runs.Consider distinguishing between initialization (missing
requestPaneTabonly) and actual errors:🔎 Suggested approach to eliminate the flash
// Initialize tab to 'body' if no tab is currently set useEffect(() => { if (activeTabUid && focusedTab?.uid && !requestPaneTab) { selectTab('body'); } }, [activeTabUid, focusedTab?.uid, requestPaneTab, selectTab]); - if (!activeTabUid || !focusedTab?.uid || !requestPaneTab) { - return <div className="pb-4 px-4">An error occurred!</div>; + // Missing core tab state is an error + if (!activeTabUid || !focusedTab?.uid) { + return <div className="pb-4 px-4">An error occurred!</div>; + } + + // Still initializing requestPaneTab - render null briefly + if (!requestPaneTab) { + return null; }This distinguishes between broken state (missing activeTabUid/focusedTab) and initialization-in-progress (missing requestPaneTab only).
|
|
||
| const selectTab = (tab) => { | ||
| const rightContentRef = useRef(null); | ||
|
|
There was a problem hiding this comment.
@abhishek-bruno i guess we can remove the empty lines 20, 22
| import HeightBoundContainer from 'ui/HeightBoundContainer'; | ||
| import StyledWrapper from './StyledWrapper'; | ||
| import { find, get } from 'lodash'; | ||
| import { find } from 'lodash'; |
There was a problem hiding this comment.
we can use 'import find from 'lodash/find'' in favor of bundlesize
…eTabs component - Replaced custom tab implementation with ResponsiveTabs for better structure and usability. - Utilized useMemo and useCallback for performance optimizations in GrpcRequestPane. - Removed unused imports and simplified tab management logic. - Updated StyledWrapper to remove legacy tab styles, improving maintainability.
…ation and response count indicators
…siveTabs key handling - Removed unnecessary useMemo for tab initialization in GrpcResponsePane. - Updated tab comparison logic in ResponsiveTabs to use key arrays for improved performance. - Adjusted test locator for response tab count to use role-based selection for better accessibility.
…AuthMode in GrpcRequestPane - Updated StyledWrapper in ApiKeyAuth, BasicAuth, BearerAuth, OAuth2, WsseAuth, and GrpcAuth components to remove unnecessary margin-top, ensuring a uniform appearance across authentication interfaces. - Adjusted margin in GrantTypeSelector and WSAuth components for better layout consistency.
…equestPane - Changed the import of 'find' from lodash to a direct import for better clarity. - Improved error handling by returning null during initialization when requestPaneTab is not set, ensuring smoother user experience.
20f2a28 to
1e66895
Compare
left a comment
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (1)
47-49: Consider a more descriptive fallback message."404 | Not found" suggests HTTP semantics. Since this is an internal tab fallback, something like "Unknown tab" or just returning
nullwould be clearer.♻️ Suggested change
default: { - return <div className="mt-4">404 | Not found</div>; + return <div className="mt-4">Unknown tab</div>; }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
🧠 Learnings (2)
📚 Learning: 2025-12-02T07:24:50.311Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6263
File: packages/bruno-requests/src/auth/oauth2-helper.ts:249-249
Timestamp: 2025-12-02T07:24:50.311Z
Learning: In OAuth2 Basic Auth headers for Bruno, clientSecret is optional and can be omitted. When constructing the Authorization header in `packages/bruno-requests/src/auth/oauth2-helper.ts`, use `clientSecret || ''` instead of `clientSecret!` to properly handle cases where only clientId is provided, per community requests.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/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: Playwright E2E Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - Windows
🔇 Additional comments (7)
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (7)
1-14: LGTM!Clean import structure. Direct
lodash/findimport is a good choice for tree-shaking.
20-31: LGTM!Proper use of
useCallbackwith correct dependencies. The tab selection logic is clean and efficient.
53-63: LGTM!Property extraction and streaming detection logic are clean and correct.
65-99: LGTM!Well-structured tab definitions with appropriate indicators. Dependencies are mostly primitive values, ensuring stable memoization.
101-106: LGTM!Clean initialization pattern. The effect correctly sets the default tab only when needed, with proper dependencies.
108-116: LGTM!Two-stage guard pattern is sensible—distinguishing true errors from initialization state. The brief
nullrender during init is acceptable for this use case.
118-142: LGTM!Clean integration with
ResponsiveTabs. ConditionalrightContentand ref passing are handled correctly. Good migration from the legacy tab implementation.
left a comment
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js (1)
47-72: Critical: useEffect dependency causes unnecessary re-runs.The
oAuthobject (line 14) is created fresh on every render viaget(), so the effect runs every time the component renders instead of only when the OAuth config actually changes. This defeats the purpose of the dependency array.🔧 Proposed fix
Replace the object dependency with a primitive value that tracks the actual condition:
useEffect(() => { // initialize redux state with a default oauth2 grant type // authorization_code - default option !oAuth?.grantType && dispatch( updateAuth({ mode: 'oauth2', collectionUid: collection.uid, itemUid: item.uid, content: { grantType: 'authorization_code', accessTokenUrl: '', username: '', password: '', clientId: '', clientSecret: '', scope: '', credentialsPlacement: 'body', credentialsId: 'credentials', tokenPlacement: 'header', tokenHeaderPrefix: 'Bearer', tokenQueryKey: 'access_token' } }) ); - }, [oAuth]); + }, [oAuth?.grantType, dispatch, collection.uid, item.uid]);
🧹 Nitpick comments (5)
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js (2)
1-1: Consolidate React imports.React hooks are split across three separate import statements. Consolidate them into a single import for better organization.
♻️ Proposed consolidation
-import React, { useRef, forwardRef } from 'react'; +import React, { useRef, forwardRef, useEffect, useState } from 'react'; import get from 'lodash/get'; import Dropdown from 'components/Dropdown'; import { useDispatch } from 'react-redux'; import StyledWrapper from './StyledWrapper'; import { IconCaretDown, IconKey } from '@tabler/icons'; import { humanizeGrantType } from 'utils/collections'; -import { useEffect } from 'react'; -import { useState } from 'react';Also applies to: 8-9
20-26: Memoize Icon component and onGrantTypeChange handler.The PR objectives mention using
useMemoanduseCallbackfor performance optimizations in GrpcRequestPane. Consider applying the same pattern here—the Icon component andonGrantTypeChangehandler are recreated on every render.♻️ Proposed optimization
+ const Icon = React.useMemo(() => { + return forwardRef((props, ref) => { + return ( + <div ref={ref} className="flex items-center justify-end grant-type-label select-none"> + {humanizeGrantType(oAuth?.grantType)} <IconCaretDown className="caret ml-1 mr-1" size={14} strokeWidth={2} /> + </div> + ); + }); + }, [oAuth?.grantType]); - const Icon = forwardRef((props, ref) => { - return ( - <div ref={ref} className="flex items-center justify-end grant-type-label select-none"> - {humanizeGrantType(oAuth?.grantType)} <IconCaretDown className="caret ml-1 mr-1" size={14} strokeWidth={2} /> - </div> - ); - }); - const onGrantTypeChange = (grantType) => { + const onGrantTypeChange = React.useCallback((grantType) => { let updatedValues = { ...valuesCache, ...oAuth, grantType }; setValuesCache(updatedValues); dispatch( updateAuth({ mode: 'oauth2', collectionUid: collection.uid, itemUid: item.uid, content: { ...updatedValues } }) ); - }; + }, [valuesCache, oAuth, dispatch, collection.uid, item.uid, updateAuth]);Also applies to: 28-45
packages/bruno-app/src/components/SearchInput/StyledWrapper.js (1)
14-16: Inconsistent theme property access.Line 15 uses
props.theme.textwhile line 7 usesprops.theme.colors.text.muted. This inconsistency should be resolved for maintainability.♻️ Proposed fix
&:hover { - color: ${(props) => props.theme.text}; + color: ${(props) => props.theme.colors.text.main}; }Also verify line 22 follows the same pattern if applicable.
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (1)
118-138: Consider reducing duplication in rightContent.Both the timeline and response branches render
<ResponseLayoutToggle />. This duplication could be refactored for maintainability.♻️ Proposed refactor
const rightContent = !isLoading ? ( <div ref={rightContentRef} className="flex items-center"> + <ResponseLayoutToggle /> {focusedTab?.responsePaneTab === 'timeline' ? ( <> - <ResponseLayoutToggle /> <ClearTimeline item={item} collection={collection} /> </> ) : item?.response ? ( <> - <ResponseLayoutToggle /> <ResponseClear item={item} collection={collection} /> <GrpcStatusCode status={response.statusCode} text={response.statusText} details={response.statusDescription} /> <ResponseTime duration={response.duration} /> </> ) : null} </div> ) : null;packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (1)
109-111: Inconsistent error handling wrapper.The error div is not wrapped in
StyledWrapper, unlike the main return and other early returns in the component. This inconsistency could affect styling.♻️ Proposed fix
if (!activeTabUid || !focusedTab?.uid) { - return <div className="pb-4 px-4">An error occurred!</div>; + return ( + <StyledWrapper className="flex flex-col h-full relative"> + <div className="pb-4 px-4">An error occurred!</div> + </StyledWrapper> + ); }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.jspackages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.jspackages/bruno-app/src/components/SearchInput/StyledWrapper.jspackages/bruno-app/src/components/SearchInput/index.jstests/utils/page/locators.ts
💤 Files with no reviewable changes (1)
- packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js
🚧 Files skipped from review as they are similar to previous changes (6)
- packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js
- packages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.js
- packages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.js
- packages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.js
- packages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.js
- packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.js
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/SearchInput/StyledWrapper.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.jspackages/bruno-app/src/components/SearchInput/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jstests/utils/page/locators.tspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/utils/page/locators.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 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/SearchInput/StyledWrapper.jspackages/bruno-app/src/components/SearchInput/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/SearchInput/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/SearchInput/StyledWrapper.jspackages/bruno-app/src/components/SearchInput/index.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/SearchInput/StyledWrapper.jspackages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.jspackages/bruno-app/src/components/SearchInput/index.jspackages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js
📚 Learning: 2025-12-02T07:24:50.311Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6263
File: packages/bruno-requests/src/auth/oauth2-helper.ts:249-249
Timestamp: 2025-12-02T07:24:50.311Z
Learning: In OAuth2 Basic Auth headers for Bruno, clientSecret is optional and can be omitted. When constructing the Authorization header in `packages/bruno-requests/src/auth/oauth2-helper.ts`, use `clientSecret || ''` instead of `clientSecret!` to properly handle cases where only clientId is provided, per community requests.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js
🧬 Code graph analysis (2)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (7)
packages/bruno-app/src/components/ResponsePane/index.js (5)
tabs(33-33)rightContentRef(37-37)response(39-39)allTabs(112-142)rightContent(220-272)packages/bruno-app/src/components/ResponsePane/ResponseClear/index.js (1)
ResponseClear(25-45)packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/GrpcStatusCode/index.js (1)
GrpcStatusCode(6-25)packages/bruno-app/src/components/ResponsePane/ResponseTime/index.js (1)
ResponseTime(5-21)packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/StyledWrapper.js (1)
StyledWrapper(4-111)packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/GrpcQueryResult/StyledWrapper.js (1)
StyledWrapper(3-79)packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)
ResponsiveTabs(19-278)
packages/bruno-app/src/components/SearchInput/index.js (1)
packages/bruno-app/src/components/SearchInput/StyledWrapper.js (1)
StyledWrapper(3-34)
⏰ 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: Unit Tests
- GitHub Check: CLI Tests
- GitHub Check: Playwright E2E Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - Linux
🔇 Additional comments (7)
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js (1)
76-76: LGTM! Spacing adjustment aligns with auth component consistency.The change from
my-4tomb-4correctly removes the top margin while preserving bottom spacing. This aligns the OAuth2 header with other auth components that have migrated away from top-margin utilities.tests/utils/page/locators.ts (1)
201-201: LGTM! Locator correctly reflects the new tab structure.The updated locator now correctly scopes the response count within the Response tab element, aligning with the ResponsiveTabs refactor.
packages/bruno-app/src/components/SearchInput/index.js (1)
3-3: LGTM! Refactoring aligns with coding guidelines.The refactor correctly uses StyledWrapper for styling while maintaining Tailwind classes for layout. The migration from inline color classes (
text-gray-500) to styled component hooks (.search-icon) follows the established pattern.Based on learnings, this correctly uses Styled Components for colors and Tailwind for layout.
Also applies to: 21-26, 54-54
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (1)
1-1: LGTM! ResponsiveTabs integration looks solid.The refactor successfully migrates to ResponsiveTabs with proper tab definitions, indicators, and right-content rendering. The tab structure aligns well with the test locator updates.
Also applies to: 17-17, 24-24, 41-71, 142-150
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js (3)
1-1: LGTM! Excellent use of performance hooks.The refactor effectively uses
useMemofortabPanelandallTabscomputations, anduseCallbackforselectTabwith appropriate dependencies. This optimizes re-renders and follows React best practices.Also applies to: 24-31, 33-51, 65-99
102-106: Initialization logic handles edge cases well.The
useEffectauto-sets the tab to 'body' when missing, and the early null return during initialization prevents rendering with incomplete state. This approach is clean and prevents errors.Also applies to: 114-116
118-132: LGTM! ResponsiveTabs integration is clean.The conditional
rightContentfor the auth tab is well-implemented, and the null check forrightContentRefon line 131 correctly handles the conditional rendering case.
…eItem for improved layout consistency
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
Style
Refactor
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.