fix: refactor default tab selection logic for correct tab persistance#6473
Merged
bijin-bruno merged 1 commit intousebruno:mainfrom Dec 22, 2025
Merged
Conversation
Contributor
WalkthroughAutomatic tab selection was removed from the HttpRequestPane component and replaced with utility-based default tab logic. The getDefaultRequestPaneTab function now returns 'body' as the default tab when no enabled params exist and body mode is set, otherwise defaults to 'params'. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
bijin-bruno
approved these changes
Dec 22, 2025
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
JIRA
The HttpRequestPane component had a useEffect that auto-selected the 'body' tab on mount for requests with a body and no params. The initialAutoSelectDone ref was component-instance specific, so when switching requests caused the component to remount, the ref reset and the auto-select ran again, overwriting the user's selection.
Fix: Moved the default tab logic to getDefaultRequestPaneTab() in utils/collections/index.js. This function is called only once when a tab is first created (via addTab). After that, the selected tab is stored in Redux and persists across component remounts.
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.