Repository navigation
fix: wrap receive tab swipes around - #1593
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. |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryReceive tabs now wrap from the first tab to the last and back.
No actionable issues were found. Review was based on code inspection; no device checks were run. Reviews (1) · Last reviewed commit: "test: add receive tabs wraparound journe..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f96dd4014
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
|
Pushed a64980a, answering the review threads:
|
talosmachina
left a comment
There was a problem hiding this comment.
1 finding (1 P1). Makes the Receive tabs wrap around on a sideways swipe past the first or last tab. Reviewed 9f94e09, full tier, reasoned from the code and CI (no device build on this side).
What I checked, and 3 candidates I ruled out
Read in full: SwipeToChangeTabModifier.kt, the tab and pager parts of ReceiveQrScreen.kt, the UsdtDepositReceiveScreen.kt change, both journeys
Call sites traced: swipeToChangeTab (AllActivityScreen.kt keeps wrapAround = false), selectReceiveTab
CI: lint, detekt, build-local green; e2e shards still running when this was written
Ruled out
- Wrap fires mid-list:
isAtStart/isAtEndare sampled at the down event, so a swipe that starts between tabs never wraps. - Tap on QR stops copying: the modifier only observes (
Initial/Finalpasses, nothing consumed), and a tap fails the distance and velocity gates. - Vertical drag wraps:
abs(dragX) > abs(dragY)gates it.
Merge confidence: 3/5, one P1 in right-to-left layouts.
jvsena42
left a comment
There was a problem hiding this comment.
Code scan: no findings.
Checked and clean:
- Content follows the tab. A wrap calls
selectReceiveTab(visibleTabs.last()/first()), and each page builds its QR, copy and share values from its own tab (invoicesByTab[tab]). So what's shown can't belong to a different tab. - Hidden tabs. The wrap target always comes from
visibleTabs: USDT is left out when it's off or a CJIT invoice is pending, Hardware when nothing is paired, Auto when there's no channel. The lambda goes throughrememberUpdatedState, so a tab-set change while Receive is open is respected. - Two tabs. There are always at least two, and the start/end checks are read when the finger goes down.
- USDT page. It wraps only on its address page.
receive/receive-tabs-wraparound.xml and the updated usdt-receive-swipe-tabs.xml match synonymdev/bitkit-ios#1027 apart from the swipe commands.
Device gate (partial): not run yet. Pending: both journeys. Perf: not relevant. The device result will follow.
jvsena42
left a comment
There was a problem hiding this comment.
Approving at a64980a. The code scan from my earlier review stands.
Device gate: a64980a — journeys: receive/receive-tabs-wraparound.xml and receive/usdt-receive-swipe-tabs.xml both pass on Pixel_9; perf: not relevant; Figma: n/a; l10n: no UI text changed.
The wallet had an open Spending channel, so Receive showed Savings, Auto, Spending and USDT (three tabs with USDT off) and opened on Auto. I started from Savings and adjusted the expected neighbours.
- Every wrap, single-direction swipe and diagonal drag landed on the expected tab without closing the sheet.
- After each wrap, the QR and the copied value belonged to the selected tab:
- Savings → USDT: QR
ethereum:0xFd08…/transfer?address=0xc52C…, copied0xc52CAc01…D9e0. - With USDT off, Savings → Spending: QR and copied
lnbcrt1p4dvltcdqq….
- Savings → USDT: QR
- Swipes copied nothing; only taps did.
CI at a64980a: green.
…o fix/receive-tabs-wraparound # Conflicts: # journeys/README.md
pwltr
left a comment
There was a problem hiding this comment.
Reviewed 036f1fe. No additional findings from my source review.
I ran both receive journeys on an Android emulator using the exact build: all 14 actions in receive/receive-tabs-wraparound.xml and all seven in receive/usdt-receive-swipe-tabs.xml passed. This covered repeated wrapping with USDT on and off, slow swipes, swipes released above the sheet, and copying only when tapping the QR.
Closes #1590
Twin: synonymdev/bitkit-ios#1027
This PR makes the Receive tabs wrap around: a swipe right on the first tab selects the last one, and a swipe left on the last tab selects the first one.
Expected behaviour, as specified: "we can swipe fw to next, bw to prev, and if on last + fw it 'rotates' back, if on first + bw it rotates vice-versa".
Description
ReceiveQrScreen: the tab pager now watches for a swipe past its first or last page and selects the tab at the other end, so Savings wraps to USDT (or Spending without USDT) and back. The pager still scrolls and snaps as before between the other tabs.UsdtDepositReceiveScreen: the USDT address page passeswrapAroundtoswipeToChangeTab, so a swipe left on USDT selects the first tab instead of doing nothing.swipeToChangeTabgains thewrapAroundoption, off by default, and a siblingswipePastEdgesmodifier that only observes the pointer, so the pager keeps handling its own drag and a tap on the QR still copies.swipePastEdgesignores movement within the touch slop and follows the layout direction, so in RTL a swipe toward the start is to the left.Out of Scope
swipeToChangeTabreads a swipe to the right as previous in every locale, before this PR too; tracked in bug: tab swipes go the wrong way in rtl locales #1597 (thread).Design
N/A — no UI changes.
Preview
Pixel 9 emulator (API 36), dev wallet with USDT enabled, tabs Savings, Spending and USDT, swipes with
adb shell input swipe.Before (#1582): a swipe left on USDT stays on USDT
base-usdt-left-above2x.mp4
After: a swipe right on Savings selects USDT
fix-a-savings-right2x.mp4
After: a swipe left on USDT selects Savings
fix-b-usdt-left2x.mp4
After: a swipe right on USDT selects Spending
fix-e-savings-right-again2x.mp4
After: a swipe left on Spending selects USDT
fix-g-spending-left2x.mp4
After: a swipe left on USDT released above the sheet selects Savings; Receive stays open
fix-h-usdt-left-above2x.mp4
After: a diagonal swipe on Savings released above the sheet; Receive stays open
fix-i-savings-left-above2x.mp4
v3.0.0: six sideways swipes on USDT released above the sheet; Receive stays open each time
v300-usdt-swipes-above2x.mp4
QA Notes
Journeys
receive-tabs-wraparound.xml— swipes wrap from Savings to USDT and back, a swipe released above the sheet keeps Receive open, a tap on the QR still copies, and with USDT off Savings and Spending wrap both waysusdt-receive-swipe-tabs.xml— a swipe left on USDT selects Savings instead of staying on USDTManual Tests
Automated Checks
N/A