Fix fee selection errors in connect popup send flow - #30818
Open
marekrjpolak wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts fee-level defaulting and UI gating in the Connect popup “select fee” send flow to handle edge cases where the usual normal fee level is missing, and to support “custom-only” fee offerings.
Changes:
- Compute safer form defaults for fee selection in the Connect popup
SelectFeeModal(including defaulting away from missingnormal). - Update
CollapsibleFeesto allow switching between custom/standard fees whennormalis absent, using an available standard level when present. - Remove the
useWatchdefaultValue: 'normal'override so form defaults aren’t unintentionally beaten by the collapsible component.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/suite/src/components/wallet/Fees/CollapsibleFees/CollapsibleFees.tsx | Removes useWatch default override and adjusts custom/standard switching logic for missing normal. |
| packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/SelectFeeModal.tsx | Adds computed defaultValues for the popup fee form and passes them consistently into useForm + useFees. |
Suppressed comments (2)
packages/suite/src/components/wallet/Fees/CollapsibleFees/CollapsibleFees.tsx:110
- JSX comment formatting: start with an uppercase letter and end with a period.
{/* allow switching to non-custom fee only when there is some */}
{isCustomFee && !!defaultFeeLevel && (
packages/suite/src/components/wallet/Fees/CollapsibleFees/CollapsibleFees.tsx:121
- JSX comment formatting: start with an uppercase letter and end with a period.
{/* in order to have sensible default for custom fee, selected fee level must exist (see useFees hook) */}
{!isCustomFee && !!selectedFeeLevel && (
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
marekrjpolak
marked this pull request as ready for review
August 4, 2026 16:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
3rd party send flow (
composeTransactioncall without account/fees) had some corner cases in fee selection. I've tried to resolve them without changing much of the Suite-only logic:normalfee level was missing, nothing was selectedSelectFeeModal(bothuseFormanduseFees)defaultValue: 'normal'fromCollapsibleFeesas it had beaten the form defaults somehownormalfee level was missing, it wasn't possible to set custom feesCollapsibleFeeseven whennormallevel isn't thereuseFeeshookcustomfee level was present, nothing was shown at allcustomlevel as a default in this case🤖 LLM Test Recommendations
Summary: Both changed files affect fee selection and display: CollapsibleFees in send/swap/stake forms and SelectFeeModal in device confirmation prompts. The highest-risk regressions are incorrect custom fee behavior, miscalculated totals, or broken fee rendering on the device. A small set of tests covering custom fees and device fee assertions across send, swap, stake, and sell flows provides strong confidence without running the full suite.
Changed files (2)
packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/SelectFeeModal.tsxpackages/suite/src/components/wallet/Fees/CollapsibleFees/CollapsibleFees.tsxRecommended tests (12)
🔴 High priority (8)
suite/e2e/tests/staking/eth/initial-stake.test.ts— Exercises the ETH staking form's fee handling (CollapsibleFees) and asserts the device confirmation prompt shows the correct staking amount and fee, directly covering both changed components in a staking flow.suite/e2e/tests/staking/sol/initial-stake.test.ts— Validates SOL staking fee/rent display on the staking form and the device prompt, including model-specific fee screens, so it directly tests fee rendering in CollapsibleFees and SelectFeeModal.suite/e2e/tests/trading/sell-inputs.test.ts— Explicitly tests custom fee selection, fraction buttons, max amount accounting for custom fees, and fee validation for both BTC and SOL sell forms, hitting CollapsibleFees behavior and downstream fee display.suite/e2e/tests/trading/swap-fees-bitcoin.test.ts— Sets a custom BTC fee rate in the swap form, asserts the device prompt total equals fee plus send amount and shows the custom fee rate, directly testing both CollapsibleFees and SelectFeeModal.suite/e2e/tests/trading/swap-fees-ethereum.test.ts— Configures custom Ethereum gas limit, max fee per gas, and priority fee in the swap form and verifies all gas/fee values on the device prompt, covering both fee components end-to-end.suite/e2e/tests/wallet/send-doge.test.ts— Verifies the device confirmation prompt shows the correct send amount, total, and fee for a Dogecoin transaction, so a regression in SelectFeeModal fee rendering would be caught.suite/e2e/tests/wallet/send-eth.test.ts— Fills custom Ethereum gas parameters in the send form and asserts detailed fee breakdown (gas limit, max fee, priority fee, total) on both the UI device prompt and the hardware emulator, directly touching both changed files.suite/e2e/tests/wallet/send-sol.test.ts— Uses Send Max and verifies max fee, total sent, and device prompt fee/amount for a Solana transaction, making it a strong end-to-end check of CollapsibleFees calculations and SelectFeeModal display.🟡 Medium priority (4)
suite/e2e/tests/staking/ada/stake.test.ts— Covers the Cardano staking flow where deposit and fee amounts are displayed and confirmed on the device, sharing fee infrastructure with the changed components.suite/e2e/tests/trading/sell-bitcoin.test.ts— Validates sell form fee calculation and device prompt fee/amount for a BTC sell, providing additional coverage of fee rendering beyond the custom-fee-focused sell-inputs test.suite/e2e/tests/trading/sell-ethereum.test.ts— Tests custom Ethereum fee parameters in the sell flow and verifies the device prompt, complementing swap-fees-ethereum and send-eth for sell-specific fee handling.suite/e2e/tests/trading/swap-coins.test.ts— Executes a SOL-to-BTC swap and checks device prompt fee and total, helping ensure cross-chain swap fee display in SelectFeeModal remains correct.Updated: 2026-08-04T16:07:39.061Z
🌐 Preview deployments
🌐 Suite Web preview: https://dev.suite.sldev.cz/suite-web/fix/fee-level-modal/web/
🔍 Currents Test Results
🔍 Suite desktop test results: View in Currents
🔍 Suite web test results: View in Currents
🔒 Quarantined E2E Tests
Trezor Suite (web) — 3 test(s)
Updated: 2026-08-04T16:08:39.646Z • 3 test(s) total
Trezor Suite (desktop) — 3 test(s)
Updated: 2026-08-04T16:08:18.355Z • 3 test(s) total