TokenPicker uses SwipeDismissHandle primitive (polish wave C.1)#33
Closed
epicexcelsior wants to merge 2 commits into
Closed
TokenPicker uses SwipeDismissHandle primitive (polish wave C.1)#33epicexcelsior wants to merge 2 commits into
epicexcelsior wants to merge 2 commits into
Conversation
PR anonmesh#29 removed the H_PAD constant when moving PendingCosigns into WalletScreen's grid (parent now owns horizontal padding) but left one reference at line 57. Result: upstream/v3 fails tsc on a fresh clone. Drop the stale paddingHorizontal entry from the wrap View style array and consolidate the two duplicate @expo/vector-icons imports while in the file.
POLISH_PLAN Wave C.1 called for extracting an inline pan-to-dismiss gesture from TokenPicker into a reusable primitive. Audit found SwipeDismissHandle already exists in components/primitives/, exported from the index, but never used anywhere. TokenPicker carried the inline duplicate of the same logic (Gesture.Pan + activeOffsetY 8 + failOffsetY -10 + dismiss thresholds 120/800 + spring damping 18/220). Refactored TokenPicker to consume the existing primitive. Drops local panGesture/dismiss/Gesture imports/DISMISS_* constants. The handle component renders its own grab indicator + capture area, so the in-line decorative bar at the top of the sheet is also dropped. Architecture difference worth noting: SwipeDismissHandle captures pan on the handle area only (per its own docstring, this avoids the scroll-conflict issue of wrapping full screen content in a Pan gesture). Future modals with internal ScrollView (TxDetailModal, recovery export, etc.) can adopt the same pattern cleanly.
Collaborator
Author
14 tasks
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.
Summary
`POLISH_PLAN.md` Wave C.1 called for extracting an inline pan-to-dismiss gesture from `TokenPicker.tsx` into a reusable primitive at `components/primitives/SwipeToDismiss.tsx`. Audit found the primitive already exists as `components/primitives/SwipeDismissHandle.tsx` — exported from the index, but never used anywhere. `TokenPicker` carried an inline duplicate of the same logic.
This PR refactors `TokenPicker` to consume the existing primitive. No new file, no architecture change — just dedupe.
What changed
Architecture note worth surfacing
The pre-existing `SwipeDismissHandle` captures pan on the handle area only, not the whole sheet. Per its own docstring:
The previous `TokenPicker` implementation wrapped the entire sheet in `GestureDetector` — fine for that screen since it has no `ScrollView`, but the wrong template for the audit. Modals with internal scrollables (`TxDetailModal`, `ExportWalletModal`, recovery key reveal, receive QR) can adopt this same pattern cleanly post-merge.
Drive-by
Carries the same `fix(nodes): drop stale H_PAD reference` cherry-pick the other open wallet-lane PRs do — `tsc --noEmit` errors out on `upstream/v3` without it. No-ops on whichever PR merges first.
Validation
Test plan
Future work (not this PR)
Apply `SwipeDismissHandle` to: