Skip to content

refactor: enhance GrpcRequestPane and GrpcResponsePane with ResponsiveTabs component - #6649

Merged
bijin-bruno merged 8 commits into
usebruno:mainfrom
abhishek-bruno:feat/grpc-responsive-tabs
Jan 8, 2026
Merged

bijin-bruno merged 8 commits into
usebruno:mainfrom
abhishek-bruno:feat/grpc-responsive-tabs

Conversation

@abhishek-bruno

@abhishek-bruno abhishek-bruno commented Jan 4, 2026 •

Copy link
Copy Markdown
Member

Description

  • 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.

Contribution Checklist:

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

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • Style

    • Removed tab-related gRPC request styling, tightened vertical spacing across multiple auth panels, refined search input styling/icons, adjusted muted text color, and increased timeline item spacing.
  • Refactor

    • Replaced per-tab DOM with a unified responsive tab system for gRPC request and response panes; consolidated tab indicators and unified tab-driven state handling with right-side content support.
  • New Features

    • Added a simple "No Auth" view for gRPC auth mode.
  • Tests

    • Updated gRPC test locators.

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

@coderabbitai

coderabbitai Bot commented Jan 4, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Centralized 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

Cohort / File(s) Summary
Tab Styling Removal
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js
Deleted nested CSS targeting div.tabs > div.tab and content-indicator; StyledWrapper export unchanged.
gRPC Request Pane
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
Rewrote to use ResponsiveTabs; computes allTabs, memoized tab panels, init-to-'body' guard, rightContent via GrpcAuthMode, and unified tab rendering. Review tab-key initialization and rightContent ref wiring.
gRPC Response Pane
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
Migrated to ResponsiveTabs; added rightContentRef/rightContent, dynamic indicators (responses/metadata/trailers), and conditional controls per active tab/loading state. Check indicator counts and conditional control visibility.
GrpcAuth Behavior & Layout
packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js
Added authMode === 'none' rendering ("No Auth") and removed mt-2 spacing utilities; layout simplified to gap-2.
Auth Components Spacing
packages/bruno-app/src/components/RequestPane/Auth/*
packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.js, .../BasicAuth/index.js, .../BearerAuth/index.js, .../OAuth2/index.js, .../OAuth2/GrantTypeSelector/index.js, .../WsseAuth/index.js
Removed/adjusted top-margin utilities (mt-2→removed, my-4→mb-4) — presentational changes only.
Search Input Styled Wrapper
packages/bruno-app/src/components/SearchInput/StyledWrapper.js
New styled-component StyledWrapper with themed icon and input styles; exported default.
Search Input Usage
packages/bruno-app/src/components/SearchInput/index.js
Replaced outer <div> with StyledWrapper and switched icon class to .search-icon; behavior unchanged.
Proto Dropdown Text Color
packages/bruno-app/src/components/RequestPane/GrpcQueryUrl/ProtoFileDropdown/StyledWrapper.js
Changed muted message color to theme.colors.text.muted.
Timeline Item Spacing
packages/bruno-app/src/components/ResponsePane/Timeline/GrpcTimelineItem/index.js
Added mb-2 to item wrapper, increasing vertical spacing.
Test Locator Updates
tests/utils/page/locators.ts
Scoped gRPC tab count lookup under the "Response" tab element and now queries nested grpc-tab-response-count; adjust tests expecting top-level locator.

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
Loading
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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

Tabs rearranged, panes now glide,
Right-side auth takes up its side,
Margins trimmed and styles set free,
Tests now search where counts might be —
A tidy UI melody 🎵

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main refactoring effort: replacing custom tab implementations in GrpcRequestPane and GrpcResponsePane with the ResponsiveTabs component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2011347 and 8ddfe0b.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/RequestPane/GrpcQueryUrl/ProtoFileDropdown/StyledWrapper.js
  • packages/bruno-app/src/components/ResponsePane/Timeline/GrpcTimelineItem/index.js
✅ Files skipped from review due to trivial changes (1)
  • packages/bruno-app/src/components/RequestPane/GrpcQueryUrl/ProtoFileDropdown/StyledWrapper.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/ResponsePane/Timeline/GrpcTimelineItem/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/ResponsePane/Timeline/GrpcTimelineItem/index.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: CLI Tests
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: Unit Tests
🔇 Additional comments (1)
packages/bruno-app/src/components/ResponsePane/Timeline/GrpcTimelineItem/index.js (1)

248-248: LGTM! Spacing improvement aligns with PR objectives.

The addition of mb-2 increases vertical spacing between timeline items, consistent with the broader layout refinements across the PR.


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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (2)

30-37: Consider wrapping selectTab in useCallback for consistency.

GrpcRequestPane uses useCallback for its selectTab function while this file does not. Consider wrapping for consistency and to prevent unnecessary re-renders of ResponsiveTabs.

🔎 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 memoizing getTabPanel for consistency.

GrpcRequestPane uses useMemo for its tabPanel while 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

📥 Commits

Reviewing files that changed from the base of the PR and between d506c37 and b745f8a.

📒 Files selected for processing (3)
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/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() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/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.js
  • packages/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 selectTab callback is correctly memoized with appropriate dependencies. The find operation for focusedTab is 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.isArray before accessing length. The allTabs structure aligns with the pattern in GrpcRequestPane.


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 rightContentRef integration with ResponsiveTabs follows the component's API for responsive layout calculations.


136-158: LGTM on ResponsiveTabs integration and layout.

Clean migration to ResponsiveTabs with proper use of rightContent and rightContentRef props. The h-0 with flex-grow pattern is appropriate for the flex layout.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

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

64-98: Suggest consistent optional chaining on line 90.

The past review concern about potential null reference on auth.mode has been largely addressed with the use of auth?.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

📥 Commits

Reviewing files that changed from the base of the PR and between b745f8a and 5b3106d.

📒 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() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/RequestPane/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 find with 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 selectTab callback 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 tabPanel eliminates conditional logic duplication and maintains a single source of truth for tab content.

@abhishek-bruno
abhishek-bruno marked this pull request as draft January 4, 2026 07:19
@abhishek-bruno
abhishek-bruno marked this pull request as ready for review January 4, 2026 08:30

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js (1)

115-135: Consider memoizing rightContent for consistency.

The rightContent conditional rendering works correctly, but since it depends on multiple props (isLoading, focusedTab.responsePaneTab, item.response, response.*), wrapping it in useMemo would 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' to import { 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5b3106d and 27c7f6a.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/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() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/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.js
  • packages/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, and ResponsiveTabs are 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 .length properly guard against undefined values.


45-68: LGTM! Well-structured tab configuration.

The memoized allTabs array 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 focusedTab and requestPaneTab are safely derived with optional chaining, and selectTab is correctly memoized with appropriate dependencies.

Also applies to: 23-30


32-50: LGTM! Well-structured tab panel memoization.

The switch-based tabPanel memo correctly includes all dependencies and provides clean separation of panel logic from rendering.


64-98: LGTM! Comprehensive tab configuration with proper safeguards.

The allTabs memoization 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 getMessageIndicator helper keeps the logic clean and readable.


101-105: LGTM! Sensible default tab initialization.

The useEffect ensures 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 requestPaneTab is undefined, then the useEffect at 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 allTabs configuration and the memoized selectTab callback, ensuring optimal performance.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
packages/bruno-app/src/ui/ResponsiveTabs/index.js (1)

221-234: useMemo dependency on derived array negates memoization.

overflowTabs (line 218) is a new array created every render, so including it in the dependency array means overflowMenuItems recalculates on every render anyway.

Consider using overflowTabKeys instead 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 true explicitly but relies on implicit undefined for the false case.

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 memoizing allTabs.

The allTabs array is recreated on every render. While ResponsiveTabs now 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

📥 Commits

Reviewing files that changed from the base of the PR and between 27c7f6a and 97dada4.

📒 Files selected for processing (3)
  • packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
  • packages/bruno-app/src/ui/ResponsiveTabs/index.js
  • tests/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() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • tests/utils/page/locators.ts
  • packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
  • packages/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

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

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

    Fixture Example*: Here's an example of possible fixture and test pair

    .
    ├── fixtures
    │   └── collection
    │       ├── base.bru
    │       ├── bruno.json
    │       ├── collection.bru
    │       ├── ws-test-request-with-headers.bru
    │       ├── ws-test-request-with-subproto.bru
    │       └── ws-test-request.bru
    ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection
    ├── headers.spec.ts
    ├── persistence.spec.ts
    ├── variable-interpolation
    │   ├── fixtures
    │   │   └── collection
    │   │       ├── environments
    │   │       ├── bruno.json
    │   │       └── ws-interpolation-test.bru
    │   ├── init-user-data
    │   └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection
    └── subproto.spec.ts
    

Files:

  • tests/utils/page/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.js
  • packages/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 to useRef and integrating ResponsiveTabs aligns with the PR's goal of unifying tab implementations.


118-138: Right content integration looks correct. Conditional rendering based on responsePaneTab and isLoading state is properly structured, and the ref is correctly attached for layout calculations.


142-149: LGTM! Clean integration of ResponsiveTabs with 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 the grpc-tab-response-count testId within the Response tab rendered by ResponsiveTabs (which applies role="tab" to each tab element).

@abhishek-bruno
abhishek-bruno force-pushed the feat/grpc-responsive-tabs branch from 97dada4 to de7201c Compare January 5, 2026 06:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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: overflowMenuItems useMemo has an unstable dependency.

overflowTabs is derived inline without memoization (line 218), creating a new array reference on every render. This causes overflowMenuItems useMemo 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 memoizing allTabs.

The allTabs array is recreated on every render. Since this is passed to ResponsiveTabs, it could trigger unnecessary recalculations. Consider wrapping with useMemo:

🔎 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

📥 Commits

Reviewing files that changed from the base of the PR and between 97dada4 and de7201c.

📒 Files selected for processing (5)
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
  • packages/bruno-app/src/ui/ResponsiveTabs/index.js
  • tests/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() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/ui/ResponsiveTabs/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/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.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/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 rightContentRef is properly initialized for ResponsiveTabs integration.


118-138: LGTM!

The conditional rightContent rendering 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 find for tab lookup.


20-30: LGTM!

Good use of useCallback for selectTab with correct dependencies. The focusedTab derivation is straightforward.


32-50: LGTM!

Memoizing tabPanel is a good optimization. Dependencies are complete and the switch logic correctly maps tabs to their respective components.


64-98: LGTM!

The allTabs memoization is well-implemented with correct dependencies. Good to see auth?.mode used defensively (addresses the previous review concern about potential null reference).


111-127: LGTM!

Clean integration with ResponsiveTabs. The layout structure with HeightBoundContainer is appropriate for the tab content.

@abhishek-bruno
abhishek-bruno force-pushed the feat/grpc-responsive-tabs branch from de7201c to ae8a11a Compare January 7, 2026 06:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between de7201c and ae8a11a.

📒 Files selected for processing (4)
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
  • tests/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() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • tests/utils/page/locators.ts
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

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

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

    Fixture Example*: Here's an example of possible fixture and test pair

    .
    ├── fixtures
    │   └── collection
    │       ├── base.bru
    │       ├── bruno.json
    │       ├── collection.bru
    │       ├── ws-test-request-with-headers.bru
    │       ├── ws-test-request-with-subproto.bru
    │       └── ws-test-request.bru
    ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection
    ├── headers.spec.ts
    ├── persistence.spec.ts
    ├── variable-interpolation
    │   ├── fixtures
    │   │   └── collection
    │   │       ├── environments
    │   │       ├── bruno.json
    │   │       └── ws-interpolation-test.bru
    │   ├── init-user-data
    │   └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection
    └── subproto.spec.ts
    

Files:

  • tests/utils/page/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.js
  • packages/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 useRef for rightContentRef is appropriate for the DOM reference needed by ResponsiveTabs.


41-71: LGTM!

Good defensive checks with Array.isArray before 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-0 and flex-grow ensures proper height distribution in the flex container.


129-133: Remove unused details prop from GrpcStatusCode.

The GrpcStatusCode component only accepts status and text props. The details prop 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 focusedTab and requestPaneTab improves readability.


23-30: LGTM!

Proper use of useCallback with correct dependencies. This prevents unnecessary re-renders of ResponsiveTabs.


32-50: LGTM!

Good use of useMemo for 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?.mode optional chaining properly handles the potential null reference (previously flagged). The helper function getMessageIndicator keeps the logic clean.


111-127: LGTM!

Clean ResponsiveTabs integration. The layout with HeightBoundContainer properly constrains the tab panel height.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
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 after return are 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 find from the full lodash package 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 rightContent rendering 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

📥 Commits

Reviewing files that changed from the base of the PR and between ae8a11a and 342edc7.

📒 Files selected for processing (8)
  • packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/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/GrantTypeSelector/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js
  • 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() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.js
  • packages/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.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.js
  • packages/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.js
  • packages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.js
  • packages/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.js
  • packages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.js
  • packages/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-4 to mb-4 removes 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-2 for flex row spacing is more semantic than mt-2 and 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 selectTab callback is correctly memoized, and the ref setup for rightContent is appropriate.


35-53: LGTM! Well-structured tab panel memoization.

The useMemo correctly 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?.mode with 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 useEffect at lines 104-108 can initialize requestPaneTab to 'body'. On first render, this will briefly flash "An error occurred!" before the effect runs.

Consider distinguishing between initialization (missing requestPaneTab only) 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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@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';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.
…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.
@abhishek-bruno
abhishek-bruno force-pushed the feat/grpc-responsive-tabs branch from 20f2a28 to 1e66895 Compare January 8, 2026 08:40

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/bruno-app/src/components/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 null would 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

📥 Commits

Reviewing files that changed from the base of the PR and between 342edc7 and 20f2a28.

📒 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() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/RequestPane/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/find import is a good choice for tree-shaking.


20-31: LGTM!

Proper use of useCallback with 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 null render during init is acceptable for this use case.


118-142: LGTM!

Clean integration with ResponsiveTabs. Conditional rightContent and ref passing are handled correctly. Good migration from the legacy tab implementation.

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js (1)

47-72: Critical: useEffect dependency causes unnecessary re-runs.

The oAuth object (line 14) is created fresh on every render via get(), 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 useMemo and useCallback for performance optimizations in GrpcRequestPane. Consider applying the same pattern here—the Icon component and onGrantTypeChange handler 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.text while line 7 uses props.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

📥 Commits

Reviewing files that changed from the base of the PR and between 20f2a28 and 2011347.

📒 Files selected for processing (13)
  • packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/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/GrantTypeSelector/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/OAuth2/index.js
  • packages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/GrpcAuth/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
  • packages/bruno-app/src/components/SearchInput/StyledWrapper.js
  • packages/bruno-app/src/components/SearchInput/index.js
  • tests/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() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/SearchInput/StyledWrapper.js
  • packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
  • packages/bruno-app/src/components/SearchInput/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • tests/utils/page/locators.ts
  • packages/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

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

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

    Fixture Example*: Here's an example of possible fixture and test pair

    .
    ├── fixtures
    │   └── collection
    │       ├── base.bru
    │       ├── bruno.json
    │       ├── collection.bru
    │       ├── ws-test-request-with-headers.bru
    │       ├── ws-test-request-with-subproto.bru
    │       └── ws-test-request.bru
    ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection
    ├── headers.spec.ts
    ├── persistence.spec.ts
    ├── variable-interpolation
    │   ├── fixtures
    │   │   └── collection
    │   │       ├── environments
    │   │       ├── bruno.json
    │   │       └── ws-interpolation-test.bru
    │   ├── init-user-data
    │   └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection
    └── subproto.spec.ts
    

Files:

  • tests/utils/page/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.js
  • packages/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.js
  • packages/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.js
  • packages/bruno-app/src/components/ResponsePane/GrpcResponsePane/index.js
  • packages/bruno-app/src/components/SearchInput/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/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.js
  • packages/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-4 to mb-4 correctly 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 useMemo for tabPanel and allTabs computations, and useCallback for selectTab with 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 useEffect auto-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 rightContent for the auth tab is well-implemented, and the null check for rightContentRef on line 131 correctly handles the conditional rendering case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants