Skip to content

Earn Screen: Refactor and Performance Improvements - #32860

Open
TomasBoda wants to merge 1 commit into
developfrom
refactor/native/earn-screen
Open

TomasBoda wants to merge 1 commit into
developfrom
refactor/native/earn-screen

Conversation

@TomasBoda

@TomasBoda TomasBoda commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Refactor the Earn Screen for:

  • better code readability
  • better performance

Screenshots

Before After
652831180-5faca989-a8d2-41b4-af67-565768cf957f.mp4
Screen.Recording.iPhone.16.Pro.Max.09-29-2026.at.09.40.34.mp4

Related Issue

Resolve #32529

🌐 Preview deployments

🌐 Suite Web preview: https://dev.suite.sldev.cz/suite-web/refactor/native/earn-screen/web/

🔍 Currents Test Results

🔍 Suite web test results: View in Currents

🔍 Suite desktop test results: View in Currents

🔍 Suite native android test results: View in Currents

🔒 Quarantined E2E Tests

Trezor Suite (desktop) — 4 test(s)
Test Type
Create additional share > Successfully added additional share 🙋 manual
Onboarding - create wallet > Success (Shamir backup) 🙋 manual
Onboarding - create wallet > Success (Shamir backup) offline 🙋 manual
Onboarding - create wallet > Success (Shamir backup) 🙋 manual

Updated: 2026-09-29T10:23:38.876Z • 4 test(s) total

Trezor Suite (web) — 0 test(s)

No quarantined tests ✅

Updated: 2026-09-29T10:25:11.260Z • 0 test(s) total

@TomasBoda TomasBoda self-assigned this Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

⚡️ Performance report (alpha)

Note

Alpha release: The limits are still being calibrated, and each measurement is
usually a single run on a shared CI runner, so expect noise between runs. Treat a
number as a hint to look closer, not as a verdict.

desktop / group 6

⚪️ Following e2e flows within limits:

Each metric reads measured/limit (% of limit).

Scenario TBT Long tasks Longest task React commits Interaction
account-switch [T3W1] 230/700 ms
(33 %)
2/5
(40 %)
265/700 ms
(38 %)
29/80
(36 %)
587 ms
multi-account-discovery [T3W1] 791/7000 ms
(11 %)
32/100
(32 %)
243/800 ms
(30 %)
300/400
(75 %)
6319 ms
wallet-discovery [T3W1] 741/2000 ms
(37 %)
20/45
(44 %)
199/400 ms
(50 %)
243/410
(59 %)
6739 ms

desktop / group 2

⚪️ Following e2e flows within limits:

Each metric reads measured/limit (% of limit).

Scenario TBT Long tasks Longest task React commits Interaction
account-switch [T3W1] 256/700 ms
(37 %)
1/5
(20 %)
306/700 ms
(44 %)
31/80
(39 %)
629 ms
multi-account-discovery [T3W1] 1452/7000 ms
(21 %)
41/100
(41 %)
330/800 ms
(41 %)
261/400
(65 %)
7272 ms
wallet-discovery [T3W1] 877/2000 ms
(44 %)
21/45
(47 %)
222/400 ms
(56 %)
258/410
(63 %)
7673 ms

desktop / group 3

⚪️ Following e2e flows within limits:

Each metric reads measured/limit (% of limit).

Scenario TBT Long tasks Longest task React commits Interaction
account-switch [T3W1] 239/700 ms
(34 %)
2/5
(40 %)
284/700 ms
(41 %)
34/80
(43 %)
722 ms
multi-account-discovery [T3W1] 892/7000 ms
(13 %)
27/100
(27 %)
219/800 ms
(27 %)
287/400
(72 %)
6478 ms
wallet-discovery [T3W1] 888/2000 ms
(44 %)
22/45
(49 %)
206/400 ms
(52 %)
174/410
(42 %)
5601 ms

desktop / group 4

⚪️ Following e2e flows within limits:

Each metric reads measured/limit (% of limit).

Scenario TBT Long tasks Longest task React commits Interaction
account-switch [T3W1] 135/700 ms
(19 %)
1/5
(20 %)
185/700 ms
(26 %)
28/80
(35 %)
400 ms
multi-account-discovery [T3W1] 1839/7000 ms
(26 %)
42/100
(42 %)
310/800 ms
(39 %)
300/400
(75 %)
8771 ms
wallet-discovery [T3W1] 189/2000 ms
(9 %)
8/45
(18 %)
121/400 ms
(30 %)
130/410
(32 %)
3112 ms

desktop / group 5

⚪️ Following e2e flows within limits:

Each metric reads measured/limit (% of limit).

Scenario TBT Long tasks Longest task React commits Interaction
account-switch [T3W1] 156/700 ms
(22 %)
1/5
(20 %)
206/700 ms
(29 %)
32/80
(40 %)
526 ms
multi-account-discovery [T3W1] 2485/7000 ms
(36 %)
47/100
(47 %)
296/800 ms
(37 %)
263/400
(66 %)
8617 ms
wallet-discovery [T3W1] 335/2000 ms
(17 %)
14/45
(31 %)
163/400 ms
(41 %)
219/410
(53 %)
5560 ms

desktop / group 7

⚪️ Following e2e flows within limits:

Each metric reads measured/limit (% of limit).

Scenario TBT Long tasks Longest task React commits Interaction
account-switch [T3W1] 224/700 ms
(32 %)
2/5
(40 %)
272/700 ms
(39 %)
35/80
(44 %)
593 ms
multi-account-discovery [T3W1] 1817/7000 ms
(26 %)
43/100
(43 %)
293/800 ms
(37 %)
245/400
(61 %)
7206 ms
wallet-discovery [T3W1] 837/2000 ms
(42 %)
19/45
(42 %)
211/400 ms
(53 %)
276/410
(67 %)
8000 ms

desktop / group 1

⚪️ Following e2e flows within limits:

Each metric reads measured/limit (% of limit).

Scenario TBT Long tasks Longest task React commits Interaction
account-switch [T3W1] 147/700 ms
(21 %)
1/5
(20 %)
197/700 ms
(28 %)
29/80
(36 %)
440 ms
multi-account-discovery [T3W1] 1814/7000 ms
(26 %)
49/100
(49 %)
287/800 ms
(36 %)
254/400
(64 %)
7992 ms
wallet-discovery [T3W1] 272/2000 ms
(14 %)
9/45
(20 %)
159/400 ms
(40 %)
231/410
(56 %)
5658 ms

@TomasBoda
TomasBoda force-pushed the refactor/native/earn-screen branch 3 times, most recently from 5a77a94 to be71f5c Compare September 24, 2026 18:02
@trezor-bot

trezor-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

✅ Previously successful run of [Test] suite-native Android E2E workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@TomasBoda
TomasBoda force-pushed the refactor/native/earn-screen branch 8 times, most recently from b5bbd3b to 9a1eb81 Compare September 25, 2026 09:55
@TomasBoda TomasBoda changed the title Earn Screen Refactor Earn Screen: Refactor and Performance Improvements Sep 25, 2026
@TomasBoda
TomasBoda marked this pull request as ready for review September 25, 2026 11:11
@TomasBoda
TomasBoda force-pushed the refactor/native/earn-screen branch from 1ca992d to b90dea7 Compare September 25, 2026 12:42
Comment on lines +5 to +10
export const useStakingPositions = () => {
const positions = useSelector(selectStakingListItems);
const symbols = useSelector(selectStakingListSymbols);

return { positions, symbols };
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These hooks shouldn't exist please. Let's just use the selectors where they are needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines +7 to +15
export const useStakingPromoList = () => {
const areTestnetsEnabled = useSelector(selectAreTestnetsEnabled);

const stakingSymbols = (areTestnetsEnabled ? STAKING_SYMBOLS : PROD_STAKING_SYMBOLS).map(
asNetworkSymbol,
);

return { stakingSymbols };
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be a selector.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines +15 to +24
export const useYieldPositions = ({ yieldOpportunities }: UseYieldPositionsProps) => {
const positions = useSelector((state: EarnListRootState) =>
selectYieldListItems(state, yieldOpportunities),
);
const vaultIcons = useSelector((state: EarnListRootState) =>
selectYieldListVaultIcons(state, yieldOpportunities),
);

return { positions, vaultIcons };
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These hooks shouldn't exist please. Let's just use the selectors where they are needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread suite-native/module-earn/src/components/yield/YieldPositionsCard.tsx Outdated
Comment thread suite-native/module-earn/src/earnScreenSelectors.ts Outdated
Comment thread suite-native/module-earn/src/utils/yield/stablecoinYieldClaimSummaryUtils.ts Outdated
Comment thread suite-native/module-earn/src/components/earn/EarnScreenHeader.tsx Outdated
Comment thread suite-native/module-earn/src/components/staking/StakingPromoList.tsx Outdated
Comment thread suite-native/module-earn/src/components/yield/YieldClaimRewardsSummaryCard.tsx Outdated
Comment thread suite-native/module-earn/src/hooks/earn/useEarnBalance.tsx Outdated
Comment thread suite-native/module-earn/src/hooks/yield/useYieldPromoNavigation.ts Outdated
@TomasBoda
TomasBoda force-pushed the refactor/native/earn-screen branch 7 times, most recently from a9405f0 to 7c8e6e0 Compare September 29, 2026 07:44
@TomasBoda
TomasBoda requested review from izmy and juriczech September 29, 2026 07:59
Comment thread suite-native/module-earn/src/components/yield/YieldPositionsCard.tsx Outdated
Comment thread suite-native/module-earn/src/components/yield/YieldPositionsCard.tsx Outdated
Comment thread suite-native/module-earn/src/components/yield/YieldClaimRewardsSummaryCard.tsx Outdated
@TomasBoda
TomasBoda force-pushed the refactor/native/earn-screen branch 3 times, most recently from 982a93f to d62b2f4 Compare September 29, 2026 09:42
@TomasBoda
TomasBoda force-pushed the refactor/native/earn-screen branch from 0ccfba6 to ba8079d Compare September 29, 2026 10:10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Earn screen re-rendering

3 participants