Skip to content

Conversation

@michalconsensys
Copy link
Contributor

@michalconsensys michalconsensys commented Nov 12, 2025

Description

This PR fixes an issue in the Perps Market Tabs component where the TabsList wasn't properly re-rendering when the number of visible tabs changed.

Changelog

CHANGELOG entry: Fixed an issue where perps market tabs would not update correctly when the number of visible tabs changed

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1982

Manual testing steps

Feature: Perps Market Tabs Rendering

  Scenario: user switches between market states that affect tab visibility
    Given user is on the perps market details view with active position
    
    When user closes their position or opens new positions
    Then the tabs should correctly update to reflect the current state (position tab should appear/disappear)
    And the active tab selection should remain consistent

Screenshots/Recordings

Before

No visible change

After

No visible change

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

Ensure TabsList remounts when the number of visible tabs changes by incorporating tabsToRender.length into the component key.

  • Perps UI:
    • Tabs re-rendering: Update tabsKey in PerpsMarketTabs.tsx to tabs-${tabs.length}-${tabsToRender.length} so TabsList remounts when the visible tab count changes.

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

@github-actions
Copy link
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.

@sonarqubecloud
Copy link

@michalconsensys michalconsensys marked this pull request as ready for review November 12, 2025 09:01
@michalconsensys michalconsensys requested a review from a team as a code owner November 12, 2025 09:01
@abretonc7s abretonc7s changed the title fix(perps): rerender tabs when the amount of tabs changes fix(perps): rerender tabs when the amount of tabs changes cp-7.59.0 Nov 12, 2025
@abretonc7s abretonc7s added this pull request to the merge queue Nov 12, 2025
Merged via the queue into main with commit 567ba8d Nov 12, 2025
104 checks passed
@abretonc7s abretonc7s deleted the fix/perps/tabs branch November 12, 2025 14:19
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-XS team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants