Skip to content

fix: send source & fee progress ui/ux - #1195

Open
ovitrif wants to merge 13 commits into
masterfrom
fix/trezor-send-ui
Open

fix: send source & fee progress ui/ux#1195
ovitrif wants to merge 13 commits into
masterfrom
fix/trezor-send-ui

Conversation

@ovitrif

@ovitrif ovitrif commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR polishes the Trezor send UI from #1187, where switching to hardware left a rough loading chip: the track vanished, the label disappeared behind a spinner, and a Material ripple flashed while the device warmed up.

This PR:

  1. Rebuilds that funding-source chip so switching to Trezor keeps the filled track, animates the label width as the name appears, and swaps only the transfer icon for a small tinted spinner. Savings and Spending switches stay instant, with no loader flash.
  2. Replaces the fee-rate icon with a matching spinner and keeps the previous fee text until the next estimate lands.
  3. Keeps swipe-to-confirm's gradient track visible after switching to Trezor.
  4. Refactors onchain fee UI logic to group fee rate, sats, estimates, and loading into one state.
  5. Pops Speed immediately after a rate is chosen, matching iOS's tap-to-select flow, while blocking conflicting hardware send actions until the new maximum and fee are ready.
  6. Keeps the Trezor source chip filled while Amount Continue prepares the hardware fee.

Preview

hwwSendUiFix.mp4

QA Notes

Manual Tests

  • 1. Send Amount or Confirm → switch to Trezor: the chip keeps its filled track, the label stays visible and animates to the Trezor name, and a small tinted spinner replaces only the transfer icon until the device fee is ready.
  • 2a. Send Confirm → switch Trezor → Spending: no source loader flash.
    • 2b. Send Confirm → switch Trezor → Savings: no source loader flash.
  • 3. Send Confirm → switch Spending → Savings: swipe-to-confirm does not dim or flash.
  • 4. regression: after Trezor is selected and loading ends: swipe-to-confirm keeps its gradient track and can still be swiped.
  • 5. Trezor Send Amount → Continue: the Trezor chip stays filled with no blue outline until Confirm.
  • 6. Trezor Send Confirm → Speed → pick another rate: Speed closes immediately like iOS, Confirm keeps the previous fee with a spinner, and speed, source, and swipe actions remain blocked until the new fee lands.
  • 7a. regression: Savings Send Confirm → Speed: Fast, Normal, and Slow still show estimates like master, and the current rate stays selected.
    • 7b. regression: Savings Send Confirm → Speed → pick Fast, Normal, or Slow: returns to Confirm and the fee/speed row updates.
    • 7c. regression: Savings Send Confirm → Speed → Custom → set a valid rate → Continue: Confirm shows the custom fee.
    • 7d. regression: Savings Send Fee Custom → rate below min or above max: toast blocks continue, same as master.
    • 7e. regression: Savings Send Confirm → Speed → back without changing: Confirm fee and speed stay the same.
  • 8. regression: unified Send Confirm → Speed → Instant: still switches to Spending like master.

Automated Checks

  • Unit tests added or extended in AppViewModelSendFlowTest.kt: cover hardware-only source loading, keeping a valid amount while Savings refreshes, retaining the previous on-chain fee while estimates refresh, returning from Speed before hardware max finishes, resetting selected UTXOs from the previous rate, and confirming that a missing hardware fee does not block navigation to signing.
  • Instrumented tests added or updated in SendAmountContentTest.kt: use the funding-source loading flag to disable source and continue, and ignore source-chip taps while Amount Continue is loading.
  • Unit tests updated in SendFeeViewModelTest.kt: fee-sheet init still disables unaffordable rates and validates custom min/max against the unified on-chain fee estimates.
  • CI: standard compile, unit test, and detekt checks run by the PR bot.

@ovitrif ovitrif changed the title fix: polish send source and fee ui fix: send source & fee loading ui/ux Aug 28, 2026
@ovitrif ovitrif changed the title fix: send source & fee loading ui/ux fix: send source & fee progress ui/ux Aug 28, 2026
@ovitrif
ovitrif marked this pull request as ready for review August 28, 2026 21:40
@ovitrif ovitrif self-assigned this Aug 28, 2026
@ovitrif
ovitrif requested a review from piotr-iohk August 28, 2026 21:41
Base automatically changed from feat/trezor-send to master August 28, 2026 21:41
@ovitrif ovitrif added this to the 2.5.0 milestone Aug 28, 2026
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Greptile Summary

The PR refines send-flow loading presentation and consolidates on-chain fee data into a single UI state while making fee selection return to confirmation immediately.

  • Keeps funding-source labels and swipe tracks visible during Trezor preparation.
  • Adds tinted inline progress indicators for source and fee refreshes.
  • Refactors on-chain estimates, selected fee, and loading status into OnchainFeeUi.
  • Updates send-flow and fee-selection tests for the new state model.

Confidence Score: 4/5

The hardware send path should not be merged until failed fee estimates stop turning swipe-to-confirm into a silent no-op.

The refactor filters unsuccessful hardware fee estimates to null, while the confirmation path treats null as an unconditional return without navigation, retry, or user-visible error.

Files Needing Attention: app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt

Important Files Changed

Filename Overview
app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt Consolidates send fee state and adjusts asynchronous source/speed refreshes, but failed hardware estimates can now silently block confirmation.
app/src/main/java/to/bitkit/ui/screens/wallets/send/SendConfirmScreen.kt Reworks source and fee loading presentation around the unified fee state.
app/src/main/java/to/bitkit/ui/components/NumberPadActionButton.kt Replaces the Material button wrapper with a stable custom row that preserves its label and track while loading.
app/src/main/java/to/bitkit/ui/components/SwipeToConfirm.kt Moves disabled alpha to inner content so the gradient track remains fully visible.
app/src/main/java/to/bitkit/ui/screens/wallets/send/SendFeeViewModel.kt Reads selected rate and estimates from the new unified on-chain fee state.
app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt Adds coverage for source loading, retained fee display, immediate navigation, and UTXO reset behavior.

Sequence Diagram

sequenceDiagram
    participant User
    participant FeeSheet
    participant AppVM as AppViewModel
    participant Wallet as Fee estimator
    participant Confirm
    User->>FeeSheet: Select transaction speed
    FeeSheet->>AppVM: setTransactionSpeed(speed)
    AppVM->>AppVM: Set speed and loading state
    AppVM-->>Confirm: Pop back immediately
    AppVM->>Wallet: Refresh max spendable and fee estimates
    Wallet-->>AppVM: Updated estimates
    AppVM->>AppVM: Replace OnchainFeeUi
    AppVM-->>Confirm: Render selected fee
Loading

Reviews (1): Last reviewed commit: "test: cover amount continue and speed re..." | Re-trigger Greptile

Comment thread app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt
Comment thread app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt
Comment thread app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt
Comment thread app/src/main/java/to/bitkit/ui/components/NumberPadActionButton.kt
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.

2 participants