Conversation
2118aa1 to
fba9de6
Compare
fba9de6 to
9ffed77
Compare
WalkthroughFixed a bug where request pane sub-tabs reverted to 'Body' after switching between requests. CollectionSettings now defaults to 'overview' when undefined; HttpRequestPane adds conditional guards to prevent auto-switching the Body tab when a focused tab already exists with a requestPaneTab, and tracks activeTabUid in dependencies. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/bruno-app/src/components/CollectionSettings/index.js (1)
21-21: Defaulting settings tab to'overview'is correct; consider??for clearer intentUsing
||here works because tab IDs are non-empty strings, but ifsettingsSelectedTabever became''this would silently fall back to'overview'. Using nullish coalescing makes the fallback strictly aboutnull/undefined:- const tab = collection.settingsSelectedTab || 'overview'; + const tab = collection.settingsSelectedTab ?? 'overview';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/bruno-app/src/components/CollectionSettings/index.js(1 hunks)packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/CollectionSettings/index.jspackages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (3)
packages/bruno-app/src/components/RequestTabPanel/index.js (2)
focusedTab(50-50)activeTabUid(49-49)packages/bruno-app/src/components/ResponsePane/index.js (3)
focusedTab(141-141)selectTab(46-53)activeTabUid(32-32)packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js (3)
focusedTab(118-118)selectTab(54-61)activeTabUid(27-27)
⏰ 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 - macOS
- GitHub Check: SSL Tests - Linux
- GitHub Check: Playwright E2E Tests
- GitHub Check: Unit Tests
- GitHub Check: CLI Tests
🔇 Additional comments (1)
packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js (1)
78-81: Auto-switch-to-Body effect is unreachable due to early guard condition using identical predicateThe early return at lines 78-81 checks
!focusedTab || !focusedTab.uid || !focusedTab.requestPaneTabbefore theuseEffectruns. Since the effect at lines 113-120 uses the same!focusedTab || !focusedTab.requestPaneTabcondition, any render that reaches the effect already has this condition false, making the selectTab('body') fallback dead code.To restore the intended behavior of auto-selecting Body only when
requestPaneTabis missing (while preserving error handling for missing focused tabs), remove!focusedTab.requestPaneTabfrom the early return:- if (!focusedTab || !focusedTab.uid || !focusedTab.requestPaneTab) { + if (!focusedTab || !focusedTab.uid) { return <div className="pb-4 px-4">An error occurred!</div>; } useEffect(() => { - if (!focusedTab || !focusedTab.requestPaneTab) { - if (activeParamsLength === 0 && body.mode !== 'none') { - selectTab('body'); - } - } - }, [activeTabUid]); + if (!focusedTab.requestPaneTab && activeParamsLength === 0 && body.mode !== 'none') { + selectTab('body'); + } + }, [activeTabUid]);
fixes: #6148
Description
This PR implements the logic for setting the focused tab
Contribution Checklist:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.