Skip to content

fix(perps): use one-line ListItemSelect for price grouping options - #33953

Merged
brianacnguyen merged 2 commits into
mainfrom
refactor/perps-pricegroup
Jul 30, 2026
Merged

fix(perps): use one-line ListItemSelect for price grouping options#33953
brianacnguyen merged 2 commits into
mainfrom
refactor/perps-pricegroup

Conversation

@brianacnguyen

@brianacnguyen brianacnguyen commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description

Price grouping options in the Perps order book sheet used the default two-line ListItemSelect layout, which left empty vertical space under each value and made the list look sparse.

This PR switches those rows to the MMDS one-line variant so each option renders as a compact single-line row.

What changed:

  • Import ListItemVariant in PerpsOrderBookView
  • Set variant={ListItemVariant.OneLine} on price grouping ListItemSelect items

Changelog

CHANGELOG entry: null

Related issues

Fixes: N/A

Manual testing steps

Feature: Perps order book price grouping sheet density

  Scenario: user opens price grouping options
    Given the user has Perps enabled and opens an order book for a market
    And the order book depth/price grouping control is visible

    When the user opens the Select Price Grouping bottom sheet
    Then each grouping option (e.g. 1, 2, 5, 10, 100, 1000) renders as a compact one-line ListItemSelect
    And the currently selected grouping still shows the selected background and check icon
    And selecting a different option updates the grouping and closes or applies as before

Screenshots/Recordings

Before

Simulator Screenshot - iPhone 15 Pro Max - 2026-07-28 at 21 22 30

After

Simulator Screenshot - iPhone 15 Pro Max - 2026-07-28 at 21 24 55

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

**Notes for you**
- No ticket was found on the branch — add an issue id to `Fixes:` (or use `Refs:`) before Ready for review
- Attach before/after screens of the price grouping sheet (you already have a before)
- Open as a draft: `gh pr create --draft` if you want that next

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Cosmetic MMDS variant change on a single bottom sheet; no logic, API, or data-handling impact.
> 
> **Overview**
> The Perps order book **Select Price Grouping** bottom sheet now uses the MMDS **one-line** `ListItemSelect` layout instead of the default two-line variant, so grouping values (e.g. 1, 10, 100) render as compact single-line rows without extra empty space.
> 
> **What changed:** `ListItemVariant` is imported from `@metamask/design-system-react-native`, and each depth-band option sets `variant={ListItemVariant.OneLine}`. Selection behavior, check icon, and grouping logic are unchanged.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 27c40ac6264c18627f7dd857d487b9c3ebe37448. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Cursor <cursoragent@cursor.com>
@brianacnguyen brianacnguyen self-assigned this Jul 29, 2026
@brianacnguyen brianacnguyen added the team-design-system All issues relating to design system in Mobile label Jul 29, 2026
@brianacnguyen
brianacnguyen requested a review from a team as a code owner July 29, 2026 04:27
@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.

@metamask-ci

metamask-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR changes only one file: PerpsOrderBookView.tsx. The change is minimal:

  1. Imports ListItemVariant from the component library
  2. Adds variant={ListItemVariant.OneLine} prop to a ListItemSelect component in the grouping selector of the order book view

This is a low-risk UI variant change affecting the Perps Order Book view's list item display style.

SmokePerps is selected because the change directly affects a Perps view component (PerpsOrderBookView).

SmokeWalletPlatform is selected per the SmokePerps tag description: "Perps is also a section inside the Trending tab (SmokeWalletPlatform); changes to Perps views (headers, lists, full views) affect Trending."

SmokeConfirmations is selected per the SmokePerps tag description: "When selecting SmokePerps, also select SmokeConfirmations (Add Funds deposits are on-chain transactions)."

The change is isolated to the Perps Order Book view with no impact on shared navigation, modals, or other app areas.

Performance Test Selection:
The change is a minor UI variant prop addition (ListItemVariant.OneLine) to a ListItemSelect component in the Perps Order Book view. This is a display/styling change that does not affect performance-sensitive operations like data fetching, rendering loops, or app startup. No performance tags are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@brianacnguyen
brianacnguyen enabled auto-merge July 30, 2026 03:45
@brianacnguyen
brianacnguyen added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit 8a930cf Jul 30, 2026
115 checks passed
@brianacnguyen
brianacnguyen deleted the refactor/perps-pricegroup branch July 30, 2026 09:41
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 30, 2026
@metamask-ci metamask-ci Bot added the release-8.6.0 Issue or pull request that will be included in release 8.6.0 label Jul 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.6.0 Issue or pull request that will be included in release 8.6.0 size-XS team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants