Skip to content

fix: wrap receive tab swipes around - #1593

Merged
ovitrif merged 6 commits into
masterfrom
fix/receive-tabs-wraparound
Oct 19, 2026
Merged

ovitrif merged 6 commits into
masterfrom
fix/receive-tabs-wraparound

Conversation

@ovitrif

@ovitrif ovitrif commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

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 passes wrapAround to swipeToChangeTab, so a swipe left on USDT selects the first tab instead of doing nothing.
  • swipeToChangeTab gains the wrapAround option, off by default, and a sibling swipePastEdges modifier that only observes the pointer, so the pager keeps handling its own drag and a tap on the QR still copies. swipePastEdges ignores movement within the touch slop and follows the layout direction, so in RTL a swipe toward the start is to the left.
  • Sheet dismissal: a sideways swipe released above the sheet does not close Receive on this branch, on fix: swipe between receive tabs from the usdt qr #1582, or on a v3.0.0 build, with the swipes in the Preview. The only sideways swipe that closed it was one that starts at the screen edge, which is Android's system back gesture and closes the sheet on every tab.

Out of Scope

  • System back gesture: a swipe that starts at the screen edge closes Receive on every tab, as back does on any sheet; this PR leaves it unchanged.
  • RTL on the USDT page and Activity: swipeToChangeTab reads 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).
  • Hardware and Auto tab layouts: the wrap uses the visible tab list, so it covers them, but they were not driven on a device.

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.

Tap on the USDT QR copies Tap on the Savings QR copies
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

  • new 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 ways
  • updated usdt-receive-swipe-tabs.xml — a swipe left on USDT selects Savings instead of staying on USDT

Manual Tests

  • On a physical phone with gesture navigation → Receive → USDT → swipe left across the QR with the thumb and release above the sheet → Receive stays open and Savings is selected — real touch input not in Capabilities

Automated Checks

N/A

@ovitrif ovitrif self-assigned this Oct 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T19:11:16.064546Z 9f96dd4 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ovitrif
ovitrif requested review from a team, coreyphillips and pwltr and removed request for a team October 19, 2026 19:07
@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Receive tabs now wrap from the first tab to the last and back.

  • Receive tab swipes wrap from one end to the other.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread app/src/main/java/to/bitkit/ui/shared/modifiers/SwipeToChangeTabModifier.kt Outdated
Comment thread journeys/receive/receive-tabs-wraparound.xml Outdated
Comment thread app/src/main/java/to/bitkit/ui/shared/modifiers/SwipeToChangeTabModifier.kt Outdated
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 036f1fe (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@ovitrif

ovitrif commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed a64980a, answering the review threads:

  • swipePastEdges now ignores a finger that stays within the touch slop, so a tap with jitter on the first or last tab no longer wraps.
  • It maps the swipe through the layout direction, so in RTL the edge swipe goes the same way as the pager.
  • swipeToChangeTab drops its unused threshold parameters and moves the tab target into a helper, which clears the detekt complexity findings.
  • receive-tabs-wraparound.xml now requires no open Spending channel, since a usable channel adds the Auto tab, and wraps Savings and Spending both ways with USDT off.

swipeToChangeTab's RTL mapping predates this PR and is tracked in #1597.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/isAtEnd are sampled at the down event, so a swipe that starts between tabs never wraps.
  • Tap on QR stops copying: the modifier only observes (Initial/Final passes, 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.

Comment thread app/src/main/java/to/bitkit/ui/shared/modifiers/SwipeToChangeTabModifier.kt Outdated

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 through rememberUpdatedState, 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
jvsena42 previously approved these changes Oct 19, 2026

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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…, copied 0xc52CAc01…D9e0.
    • With USDT off, Savings → Spending: QR and copied lnbcrt1p4dvltcdqq….
  • Swipes copied nothing; only taps did.

CI at a64980a: green.

…o fix/receive-tabs-wraparound

# Conflicts:
#	journeys/README.md
Base automatically changed from fix/usdt-receive-swipe-tabs to master October 19, 2026 21:13
@ovitrif
ovitrif dismissed jvsena42’s stale review October 19, 2026 21:13

The base branch was changed.

@ovitrif
ovitrif requested a review from jvsena42 October 19, 2026 21:15

@pwltr pwltr left a comment

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.

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.

@ovitrif
ovitrif enabled auto-merge October 19, 2026 21:35
@ovitrif
ovitrif merged commit 42b1de3 into master Oct 19, 2026
21 checks passed
@ovitrif
ovitrif deleted the fix/receive-tabs-wraparound branch October 19, 2026 21:47
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.

bug: receive tabs don't wrap on swipe, and swiping past usdt dismisses receive

5 participants