Skip to content

chore(runway): cherry-pick chore: fix apr issue with znon-zero values cp-7.61.6#24261

Merged
joaoloureirop merged 1 commit into
release/7.61.6from
runway-cherry-pick-7.61.6-1767699136
Jan 6, 2026
Merged

chore(runway): cherry-pick chore: fix apr issue with znon-zero values cp-7.61.6#24261
joaoloureirop merged 1 commit into
release/7.61.6from
runway-cherry-pick-7.61.6-1767699136

Conversation

@runway-github
Copy link
Copy Markdown
Contributor

@runway-github runway-github Bot commented Jan 6, 2026

Description

Updated APR fallback logic from nullish coalescing (??) to check if
aprOverride is a valid non-zero value, preventing "0%" from overriding
a legitimate earnToken.experience.apr.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

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

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

Adjusts APR display logic in getStakingNavbar for Tron staking.

  • Use aprOverride only when its parsed numeric value is > 0; otherwise fall back to earnToken.experience.apr with one-decimal formatting and %
  • Introduces parsedOverride helper to parse the override before deciding the source

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

541e3ad

… cp-7.61.6 (#24248)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Updated APR fallback logic from nullish coalescing (`??`) to check if
`aprOverride` is a valid non-zero value, preventing "0%" from overriding
a legitimate `earnToken.experience.apr`.

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
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**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Ensures correct APR display in staking navbar by avoiding zero-value
overrides.
> 
> - In `Navbar/index.js` `getStakingNavbar`, added `parsedOverride` and
set `apr` to `aprOverride` only when `parseFloat(aprOverride) > 0`;
otherwise use formatted `earnToken.experience.apr`
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
a7a813d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 6, 2026

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.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Jan 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 6, 2026

🔍 Smart E2E Test Selection

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

The change is a minor enhancement to the Navbar component's getStakingNavbar function. Specifically:

  1. What Changed:

    • Added an optional aprOverride parameter to the getStakingNavbar function
    • Modified the APR display logic to use the override value if provided (for Tron staking)
    • Changed the APR formatting to avoid double percentage signs when using override
    • This is wrapped in a BEGIN:ONLY_INCLUDE_IF(tron) conditional compilation block
  2. Impact Analysis:

    • The change is limited to the display of APR (Annual Percentage Rate) in the staking navbar
    • The parameter is optional and defaults to null, so existing callers remain unaffected
    • No current code in the codebase passes this parameter yet (grep search showed no usage)
    • The function is used by various staking/earn views for navigation headers
  3. Risk Assessment:

    • Low Risk: This is a purely UI display change with backward compatibility
    • Optional parameter with safe default handling
    • No logic changes to core functionality
    • Limited to conditional Tron-specific code block
    • Formatting fix prevents double percentage signs
  4. Test Coverage Needed:

    • SmokeStake: Should be run to verify staking UI and navigation headers still work correctly
    • This is the most relevant tag as it covers staking features where this function is used

The change is isolated, backward-compatible, and only affects the visual display of APR values in staking-related screens. While it's a low-risk change, testing the staking flows will ensure the navbar displays correctly.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jan 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
77.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@zone-live zone-live added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jan 6, 2026
@joaoloureirop joaoloureirop merged commit 6a7a89d into release/7.61.6 Jan 6, 2026
163 of 166 checks passed
@joaoloureirop joaoloureirop deleted the runway-cherry-pick-7.61.6-1767699136 branch January 6, 2026 15:51
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 6, 2026
@metamaskbot metamaskbot added the release-7.61.6 Issue or pull request that will be included in release 7.61.6 label Jan 6, 2026
@metamaskbot
Copy link
Copy Markdown
Collaborator

No release label on PR. Adding release label release-7.61.6 on PR, as PR was cherry-picked in branch 7.61.6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.61.6 Issue or pull request that will be included in release 7.61.6 size-XS skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants