Skip to content

feat: open url from trending when max tabs are already open#24555

Merged
bergarces merged 9 commits intomainfrom
cursor/tab-limit-site-opening-e954
Jan 16, 2026
Merged

feat: open url from trending when max tabs are already open#24555
bergarces merged 9 commits intomainfrom
cursor/tab-limit-site-opening-e954

Conversation

@bergarces
Copy link
Copy Markdown
Contributor

@bergarces bergarces commented Jan 15, 2026

Description

When trying to open a url from trending, if the maximum number of tabs are open, it currently shows a modal.

This change replaces the active tab url with the selected url.

Changelog

CHANGELOG entry: Added replaces active tab if max tabs are open and request comes from trending

Related issues

Fixes: #24386

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2026-01-15.at.13.55.57.mp4

After

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2026-01-15.at.13.54.22.mp4

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Implements conditional tab replacement when opening links from Explore/Trending at max tab capacity.

  • Updates Browser/index.js newTab(url, linkType, { replaceActiveIfMax }) to replace the active tab instead of opening a new one when tabs.length >= MAX_BROWSER_TABS and replaceActiveIfMax is true; otherwise navigates to Routes.MODAL.MAX_BROWSER_TABS_MODAL
  • Passes replaceActiveIfMax based on route.params?.fromTrending in the timestamp/deeplink handler
  • Maintains existing behavior for normal opens and token discovery, and updates currentUrl/tabs view state accordingly
  • Adds tests in Browser.rendering.test.tsx to verify modal behavior and the new active-tab replacement path

Written by Cursor Bugbot for commit b7bd473. This will update automatically on new commits. Configure here.

cursoragent and others added 4 commits January 9, 2026 22:38
Update logic for handling new tabs when max tabs are reached. Add tests for this scenario.

Co-authored-by: adrien.guguin <adrien.guguin@consensys.net>
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@bergarces bergarces changed the title Cursor/tab limit site opening e954 feat: open url from trending when max tabs are already open Jan 15, 2026
salimtb
salimtb previously approved these changes Jan 15, 2026
sahar-fehri
sahar-fehri previously approved these changes Jan 15, 2026
@bergarces bergarces added this pull request to the merge queue Jan 15, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform
  • Risk Level: medium
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

The changes modify the Browser component's tab management behavior, specifically how new tabs are opened when the maximum tab limit is reached. The key change adds a replaceActiveIfMax option to the newTab function, which when true (triggered by fromTrending parameter), opens URLs in the active tab instead of showing the max tabs modal.

The changes are:

  1. Browser/index.js: Modified newTab callback to handle the case when max tabs are reached and the request comes from Trending/Explore - it now replaces the active tab's URL instead of showing the modal.
  2. Browser.rendering.test.tsx: Added unit test coverage for the new behavior and a minor comment fix.

The fromTrending parameter is used by the Trending feature (TrendingView, SitesSearchFooter, SiteRowItemWrapper) to navigate to browser URLs. The E2E test e2e/specs/trending/trending-browser.spec.ts is tagged with SmokeWalletPlatform and tests the trending-to-browser navigation flow.

This is a medium-risk change because:

  • It modifies core browser tab management logic
  • The change is well-contained with good unit test coverage
  • The functionality is specific to the Trending/Explore feature flow
  • No critical infrastructure or security-related code is affected

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@bergarces bergarces enabled auto-merge January 16, 2026 09:31
@bergarces bergarces added this pull request to the merge queue Jan 16, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 16, 2026
@bergarces bergarces added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 6d9c992 Jan 16, 2026
85 checks passed
@bergarces bergarces deleted the cursor/tab-limit-site-opening-e954 branch January 16, 2026 10:28
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.63.0 Issue or pull request that will be included in release 7.63.0 size-M team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: UX improvement - if max number of tabs reached, cannot open top sites

5 participants