-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore(runway): cherry-pick chore: adds localization method and other improvements #24204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(runway): cherry-pick chore: adds localization method and other improvements #24204
Conversation
…improvements (#23927) <!-- 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** - Improves Tron error handling by showing user friendly error messages instead of raw error codes. - Updates TRX staking input so Max skips the EVM modal. - Triggers Tron balances update after the staking operation. - Tron snap update to the latest version ## **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] > Refines Tron staking/unstaking UX (Max/preview), localizes errors, refreshes balances after actions, uses live Tron balances in Asset Overview, and bumps tron-wallet-snap. > > - **Tron staking/unstaking UX**: > - `EarnInputView`/`EarnWithdrawInputView`: Right action for TRX shows preview or sets `Max` without EVM modal; passes `tronAccountId` to navigation result handler. > - Hooks `useTronStake`/`useTronUnstake`: expose `tronAccountId`. > - `handleTronStakingNavigationResult`: refreshes balances via `MultichainBalancesController.updateBalance(accountId)` on success. > - **Error localization**: > - Add `getLocalizedErrorMessage` mapping (e.g., `InsufficientBalance` → `stake.tron.errors.insufficient_balance`). > - Update `locales/languages/en.json` with `stake.tron.errors.insufficient_balance`. > - **Asset Overview (TRON)**: > - Prefer live asset data via `selectAsset` for TRON (`balance`, `balanceFiat`) instead of navigation params. > - **Dependencies**: > - Bump `@metamask/tron-wallet-snap` to `^1.16.1`. > - **Tests**: > - Add/update tests for TRX Max behavior (no MaxInputModal), account ID exposure, balance refresh, and error localization. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 3871f24. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsAnalysis SummaryThe PR introduces new Tron staking/unstaking functionality into the existing Earn feature, along with related UI changes and analytics updates. Here's my detailed analysis: Changed Files Breakdown:1. New Tron Staking Hooks (NEW FILES):
2. UI Components Modified:
3. Supporting Changes:
Key Feature Changes:
Risk Assessment:Medium Risk because:
Test Tag Selection Rationale:1. SmokeStake ✅ PRIMARY TAG
2. SmokeAssets ✅ RECOMMENDED
3. SmokeRamps ✅ RECOMMENDED
4. SmokeAnalytics ✅ RECOMMENDED
Tags NOT Selected:
Confidence: 85%High confidence due to:
Lower than 100% because:
|
|
No release label on PR. Adding release label release-7.61.3 on PR, as PR was cherry-picked in branch 7.61.3. |
Description
instead of raw error codes.
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Improves TRON staking/unstaking UX with localized errors, immediate balance refresh, and live TRX balances in asset overview; also skips EVM max modal for TRX and adds supporting tests.
getLocalizedErrorMessage; mapsInsufficientBalanceto i18n key (en.json).MultichainBalancesController.updateBalance(accountId)and navigates to success sheet; logs on failure.tronAccountIdfromuseTronStake/useTronUnstaketohandleTronStakingNavigationResult.MaxInputModalfor TRX and treats right action as preview/done; updates tests to assert behavior.selectAssetto sourcebalance/balanceFiatinstead of navigation params when ontron:chain.useTronStake/useTronUnstake: exposetronAccountId; corresponding unit tests added.Written by Cursor Bugbot for commit e8b8812. This will update automatically on new commits. Configure here.
118250c