Skip to content

fix: select overview tab when closing all tabs - #8026

Merged
sid-bruno merged 2 commits into
usebruno:mainfrom
naman-bruno:fix/workspace-tab
May 20, 2026
Merged

sid-bruno merged 2 commits into
usebruno:mainfrom
naman-bruno:fix/workspace-tab

Conversation

@naman-bruno

@naman-bruno naman-bruno commented May 18, 2026 •

Copy link
Copy Markdown
Collaborator

Description

JIRA

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

  • Bug Fixes

    • Improved tab activation when closing tabs or entire collections: the workspace Overview is now preferred, falling back to the last remaining tab if Overview isn’t present.
  • Tests

    • Added an end-to-end test that verifies closing tabs lands on the workspace Overview.
    • Updated shortcut tests with more robust selectors to stabilize UI interactions.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 44e3bf72-0402-45fa-bb87-438200921199

📥 Commits

Reviewing files that changed from the base of the PR and between 82a005a and b557df4.

📒 Files selected for processing (1)
  • tests/shortcuts/bound-actions.spec.ts

Walkthrough

This PR updates Redux tab-selection logic and a workspace focus helper to prefer the workspace Overview tab when the active tab is removed. It adds an E2E test verifying the behavior and updates multiple Playwright tests to scope collection locators via getByTestId('collections')....

Changes

Workspace Overview Tab Preference

Layer / File(s) Summary
Tab reducer close logic
packages/bruno-app/src/providers/ReduxStore/slices/tabs.js
closeTabs and closeAllCollectionTabs now prefer selecting workspaceOverview from remaining tabs when the active tab is removed; closeAllCollectionTabs sets activeTabUid to null when no tabs remain.
Workspace-aware focus utility
packages/bruno-app/src/providers/ReduxStore/slices/workspaces/getTabToFocusForCurrentWorkspace.js
getTabToFocusForCurrentWorkspace prefers the first workspaceOverview tab in inWorkspaceTabs, otherwise falls back to the last tab's uid.
E2E test: close-all lands on overview
tests/workspace/close-all-tabs-lands-on-overview.spec.ts
New Playwright/Electron test that closes two request tabs and asserts the active tab becomes the Overview tab (not Environments).
Test locator selector updates
tests/shortcuts/bound-actions.spec.ts
Multiple test steps updated to use page.getByTestId('collections').locator('.collection-name')... instead of global .collection-name locators across several shortcut tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • usebruno/bruno#7259: Both PRs modify workspace-aware tab-focus behavior—specifically the getTabToFocusForCurrentWorkspace/workspaceOverview selection.
  • usebruno/bruno#7087: Adjusts tab-closing/focus behavior to prefer the workspaceOverview special tab in the tabs reducer.
  • usebruno/bruno#7048: Modifies Redux tabs slice logic affecting which tab becomes active after closures; related focus/close flows.

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno

Poem

When tabs depart and UIDs are few,
Redux looks for Overview to step through,
Tests updated, selectors scoped tight,
Close the last tab — Overview's in sight. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 change: updating tab-selection behavior to prefer the workspace overview tab when closing all tabs, which aligns with the reducer logic changes and test validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/workspace/close-all-tabs-lands-on-overview.spec.ts`:
- Around line 35-37: Add a stabilizing hover before each forced close click:
call await locators.tabs.closeTab('ReqTwo').hover(); immediately before the
existing await locators.tabs.closeTab('ReqTwo').click({ force: true }); and
similarly call await locators.tabs.closeTab('ReqOne').hover(); immediately
before await locators.tabs.closeTab('ReqOne').click({ force: true }); so the
pattern used by locators.tabs.closeTab and other helpers (e.g.,
closeEnvironmentPanel) is followed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8928a41e-4c43-49f0-8d38-6168d0c2a359

📥 Commits

Reviewing files that changed from the base of the PR and between 10da27d and 82a005a.

📒 Files selected for processing (3)
  • packages/bruno-app/src/providers/ReduxStore/slices/tabs.js
  • packages/bruno-app/src/providers/ReduxStore/slices/workspaces/getTabToFocusForCurrentWorkspace.js
  • tests/workspace/close-all-tabs-lands-on-overview.spec.ts

sid-bruno
sid-bruno previously approved these changes May 19, 2026
@sid-bruno
sid-bruno merged commit 0236303 into usebruno:main May 20, 2026
21 of 25 checks passed
lyh543 pushed a commit to lyh543/bruno that referenced this pull request May 22, 2026
jattsson pushed a commit to jattsson/bruno that referenced this pull request May 26, 2026
sharan-bruno pushed a commit to sharan-bruno/bruno that referenced this pull request Jun 4, 2026
@bhavik168 bhavik168 mentioned this pull request Jun 12, 2026
2 tasks done
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.

2 participants