Skip to content

chore: add commas to PnL#27815

Merged
juanmigdr merged 3 commits into
mainfrom
chore/add-commas-to-pnl
Mar 24, 2026
Merged

chore: add commas to PnL#27815
juanmigdr merged 3 commits into
mainfrom
chore/add-commas-to-pnl

Conversation

@juanmigdr
Copy link
Copy Markdown
Member

@juanmigdr juanmigdr commented Mar 23, 2026

Description

Add commas to PnL

Changelog

CHANGELOG entry: add commas to PnL

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2966

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

After

image

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

Low Risk
Low risk UI-only change to how the price difference (PnL) value is formatted and signed in AssetOverview.

Overview
Improves the AssetOverview price-diff (PnL) label formatting by switching from addCurrencySymbol(diff, ...) to formatPriceWithSubscriptNotation(Math.abs(diff), ...), which adds thousands separators and consistent small-value formatting.

Also fixes sign rendering so negative diffs show a leading - (positive keeps +, zero shows no sign) while keeping the percentage calculation display unchanged.

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

@juanmigdr juanmigdr requested a review from a team as a code owner March 23, 2026 15:45
@github-actions github-actions Bot added size-XS risk-low Low testing needed · Low bug introduction risk labels Mar 23, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/components/UI/AssetOverview/Price/Price.tsx Outdated
@juanmigdr juanmigdr enabled auto-merge March 24, 2026 08:33
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The change is a small, isolated UI fix in app/components/UI/AssetOverview/Price/Price.tsx:

  1. What changed:

    • Added explicit - sign for negative price differences (previously only + was shown for positive)
    • Uses formatPriceWithSubscriptNotation for non-zero diffs to better display very small numbers
    • Minor spacing/formatting adjustments
  2. Scope: This component is used only in TokenDetails/components/AssetOverviewContent.tsx (the token detail/asset overview screen). It's a purely cosmetic display fix.

  3. No E2E test coverage found: Searching through the entire test suite found no E2E tests that specifically test the price diff display in the asset overview. No test files reference AssetOverview, TokenOverview, AssetDetails, or priceDiff in the E2E test directories.

  4. No shared component impact: The change doesn't affect navigation, modals, confirmations, controllers, or any shared infrastructure that could break other tests.

  5. Risk: Low - isolated UI rendering fix with no side effects on state management, navigation, or other components.

Since no E2E tags cover this specific UI component's price display functionality, and the change is a low-risk cosmetic fix, no E2E tags need to be run.

Performance Test Selection:
The change is a minor UI rendering fix for price difference display formatting. It doesn't affect list rendering performance, data loading, state management, or any critical user flows that would impact measurable performance metrics. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@juanmigdr juanmigdr added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit a092b62 Mar 24, 2026
62 checks passed
@juanmigdr juanmigdr deleted the chore/add-commas-to-pnl branch March 24, 2026 10:16
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 24, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-low Low testing needed · Low bug introduction risk size-XS team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants