Repository navigation
fix: slide between usdt receive pages - #1132
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Moves the USDT receive pages (address, network, amount, fees) onto one .id(page) view with push and pop slide transitions, and routes every page change through show(_:), which renders a direction flip before the page change so the outgoing page leaves on the correct side. Reviewed ed1ce78, full tier, reasoned from the code: iOS does not build on this reviewer's Linux host, so CI's Run Tests and build-local are the build gate, and both were still pending when this was posted.
What I checked, and 5 candidates I ruled out
Read in full: UsdtReceiveView.swift, the caller in Receive/ReceiveQr.swift, UsdtNetworkPicker.swift, UsdtReceiveAmountView.swift
Direction table, traced through show(_:) with Page: Comparable (synthesized from declaration order, fine on the iOS 17 target): Edit and Network from the QR push; network row to Amount (networks < amount) pushes; Amount to Fees pushes; Back from Fees/Amount/Networks pops; Continue on Fees, Continue on Amount with no network, and a network row returning to the QR all pop. goBack() keeps the old branch logic as is, including clearing network only while deposit == nil.
Ruled out
- Direction flip never applies the page:
onChange(of: isGoingBack)fires on every flip becauseshowonly takes that branch whenisBack != isGoingBack, and it clearspageAfterDirectionChangebefore settingpage, so no stale pending page survives. showto the current page leaves the flag toggled: no call site passes the current page; each caller sits on a page different from its target.- State lost by the new
.id(page): the oldswitchalready tore down each page's subtree on change, soshowDetailsinUsdtReceiveAddressContentanddraftAmounthandling behave as before (draftAmountlives on the parent). - Outgoing page renders the new title or content: a removed view is not re-evaluated, so the leaving page keeps its own header and body for the 0.3 s slide.
- Lifetimes of the refresh and
depositNetworkstasks: moved to the outerZStackunchanged, still attached for the whole timeUsdtReceiveViewis shown and not restarted per page.
CI at review time: SwiftFormat, validate and detect-changes green; Run Tests, Run Integration Tests and build-local pending.
Merge confidence: 4/5, no findings, but the change was not built here and the build and unit test jobs had not finished; the slide itself is covered only by the updated journey step, not by an automated test.
…ansitions # Conflicts: # Bitkit/Views/Wallets/UsdtReceiveView.swift
|
Pushed 14ca4e2: merged After the merge the QR image no longer sat in a |
jvsena42
left a comment
There was a problem hiding this comment.
Code scan at 14ca4e2: one LOW inline (the outgoing Amount page shows the reset value during the Back slide), reproduced on the simulator. No HIGH or MEDIUM.
Checked and clean:
- Back and cancel don't lose a shown address or invoice. Edit → Back on a deposit QR keeps the deposit, since iOS doesn't clear
depositon Edit. Fees Back and Continue, Network Back, picking the same network, a failed Continue and the asyncprepareDepositfollow the same branch logic as master. - The Android leads from synonymdev/bitkit-android#1588 (the Fees body vanishing, the outgoing page drawing live state) don't apply: SwiftUI doesn't re-render a view being removed, apart from the case inline.
Not performance-relevant; no strings changed.
The journeys/README.md row in bitkit-android that says the slide step "waits on bitkit-ios#1018" goes stale once this merges.
Device gate (partial): 14ca4e2 — not run yet; pending usdt-receive-amount-and-units.xml (new step 4) and a tap on the outgoing Fees Continue during the slide. Device results will follow in a separate review.
|
Pushed 51e6253: the Amount page keeps the typed amount while it slides out on Back, as @jvsena42 found in #1132 (comment). Back no longer resets the draft amount; picking a network sets it instead, and Edit already did. Rechecked on an iOS 26.5 simulator. The bitkit-android |
jvsena42
left a comment
There was a problem hiding this comment.
Re-reviewed 51e6253. It fixes my LOW on UsdtReceiveView.swift:131, and I have no new findings. draftAmount is committed only on the Amount page's Continue, and every entry to that page (Edit, the network row) resets it, so a Back-cancelled draft can't reach a later invoice.
Device gate (partial): 51e6253, not run yet. Pending: usdt-receive-amount-and-units.xml step 4 with Slow Animations on, to confirm the outgoing page keeps the typed digits during the slide.
jvsena42
left a comment
There was a problem hiding this comment.
Approving. The device gate passed at 51e6253 on the iPhone 17 simulator, with USDT enabled.
usdt-receive-amount-and-units.xml steps 3–5: Receive opens on USDT with Network: Arbitrum One. Edit slides the Amount page in. I entered 5 and tapped Back while recording the screen at 30 fps. In every frame of the slide-out, the outgoing Amount page still shows "$ 5" (₿ 6 210) and never the reset digits, and the QR page underneath slides in to the left. After Back, the QR is the plain one with no amount, as step 5 expects.
The other steps aren't touched by 51e6253. I didn't re-run them.
Closes #1018
Twin: synonymdev/bitkit-android#1588
Description
UsdtReceiveViewswitched pages through local state with no animation while the Bitcoin tabs push routes on the sheet'sNavigationStack.usdt-receive-amount-and-units.xml.Out of Scope
ReceiveQr: the blank page while swiping from Spending to USDT (bug: usdt receive page is empty while swiping to it #1029) and the abrupt switch when swiping out of USDT (bug: receive tabs crossfade instead of sliding out of usdt #1038). Their cause is theColor.clearUSDT page in the receive tab pager and the swap to a separateUsdtReceiveViewonce USDT is selected, not the page switch insideUsdtReceiveView. Fixing them means moving the USDT address page and its state into the pager.UsdtReceiveView: page state stays local; moving USDT receive onto the sheet'sNavigationStackis not part of this fix.Design
Figma: USDT receive. Motion follows the existing receive sheet transitions; the frames do not specify it.
Preview
Savings Edit for reference, then USDT Edit and Back, Network and Back; after also Network, Ethereum (to Amount), Back and Back (regtest, iOS 26.5 simulator, 2x):
usdt-receive-before.mp4
usdt-receive-after.mp4
QA Notes
Journeys
usdt-receive-amount-and-units.xml— USDT Edit slides the Amount screen in from the right and Back slides it out to the right over the QRManual Tests
N/A
Automated Checks
unit-tests.ymlselection) — passed exceptSendConfirmationLifecycleTests.testCustomFeeWalletSwitchSurvivesFeeScreenNavigation, which fails the same way onmasteron this Xcode 27 / iOS 26.5 simulator and passes in CI; in CI at 14ca4e2 its siblingtestPendingWalletSwitchResumesAfterTagsfailed once and passed on rerunUsdtReceiveView.swift— passedVerified at ed1ce78 on an iOS 26.5 simulator (regtest, USDT enabled with placeholder RPC and bundler URLs, so the fee page was not reached): every page change in the Preview slides in the expected direction, checked frame by frame, including Back right after a forward move.
Rechecked at 14ca4e2, after merging
master: Edit, Back, Network and Back slide the same way, the QR slides in with its page, and a swipe across the USDT page still switches tabs. At 51e6253, Edit, 7, Back keeps $7 on the Amount page through the slide.Models used
claude-opus-5-5(reasoning:medium)claude-opus-5-5(reasoning:medium)claude-sonnet-5-5(reasoning:high)