You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the Predict section to the new "Pay with" bottom sheet, completing the dedicated-flow section coverage alongside the existing Perps and Crypto sections.
When a user opens "Pay with" during a predictDepositAndOrder transaction, they now see a dedicated Predict section showing their Predict account balance with an Add button that routes to the existing add-funds flow. Tapping the balance row commits "use Predict balance" and dismisses the sheet — mirroring the UX the Perps section already provides for perpsDepositAndOrder.
The Pay With bottom-sheet entry points inside the Predict order flow (the PredictPayWithRow and the "Change payment method" CTA on PredictBuyWithAnyToken) now route to the new bottom sheet instead of the legacy PayWithModal when the bottom-sheet feature is enabled. The synthetic "Predict balance" row that the legacy modal injects via usePredictBalanceTokenFilter is suppressed in that mode so the Predict section in the bottom sheet remains the single source of truth.
The Crypto section's checkmark behavior is extended so that when Predict balance is the implicit default (PredictController.selectedPaymentToken === null on a predictDepositAndOrder flow), the preferred-token row no longer renders a misleading checkmark, and the user-selected-token row is hidden — same "fiat wins / dedicated section wins" semantics that already exist for Perps and fiat payment methods. When the user explicitly picks a crypto token via "Other assets", both pieces of state are updated coherently so the picker reflects the explicit selection.
The bottom-sheet route is registered inside the Predict native stack so navigation dispatches from the order screen reach the route reliably, matching the same fix-pattern that was applied to the Perps native stack.
Feature: my feature nameScenario: user [verb for user action]Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Selected Performance tags: None (no tests recommended)
Risk Level: medium
AI Confidence: 88%
click to see 🤖 AI reasoning details
E2E Test Selection:
The PR introduces a new payment method flow for Predict (Polymarket) using the PayWithBottomSheet component, feature-flagged via isPayWithBottomSheetEnabled(). Key changes:
SmokePredictions (primary): Direct changes to Predict payment flows - usePredictBalanceTokenFilter now bypasses balance filtering when the bottom sheet is enabled, PredictBuyWithAnyToken and PredictPayWithRow navigate to the new CONFIRMATION_PAY_WITH_BOTTOM_SHEET route, and a new usePayWithPredictSection hook creates a Predict section in the PayWith bottom sheet. The Predict routes stack now includes the PayWithBottomSheet screen.
SmokeWalletPlatform (required by SmokePredictions tag description): Predictions is a section inside the Trending tab, so changes to Predictions views affect Trending.
SmokeConfirmations (required by SmokePredictions tag description + direct impact): The usePayWithCryptoSection and usePayWithSections hooks are confirmation-layer hooks that now include Predict-specific logic. The PayWithBottomSheet is a confirmation modal. Opening/closing positions are on-chain transactions that go through confirmations.
SmokePerps (indirect impact): The usePayWithCryptoSection hook is shared between Perps and Predict flows. The changes add Predict-parallel logic alongside existing Perps logic in this shared hook. The PayWithBottomSheet component is also used in Perps routes. Any regression in the shared hook could affect Perps payment flows.
The changes are feature-flagged (isPayWithBottomSheetEnabled()), reducing risk of breaking existing flows, but the shared hooks warrant testing of both Predict and Perps flows.
Performance Test Selection:
The changes are primarily feature additions to the Predict payment flow (new PayWithBottomSheet navigation, new usePayWithPredictSection hook, token filter logic). These are UI flow changes gated behind a feature flag and do not introduce new rendering-heavy components, list rendering changes, or modifications to core data loading/state management that would impact measurable performance metrics. No performance test tags are warranted.
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
no-changelogno-changelog Indicates no external facing user changes, therefore no changelog documentation neededsize-Lteam-confirmationsPush issues to confirmations team
1 participant
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.
Description
Adds the Predict section to the new "Pay with" bottom sheet, completing the dedicated-flow section coverage alongside the existing Perps and Crypto sections.
When a user opens "Pay with" during a
predictDepositAndOrdertransaction, they now see a dedicated Predict section showing their Predict account balance with an Add button that routes to the existing add-funds flow. Tapping the balance row commits "use Predict balance" and dismisses the sheet — mirroring the UX the Perps section already provides forperpsDepositAndOrder.The Pay With bottom-sheet entry points inside the Predict order flow (the
PredictPayWithRowand the "Change payment method" CTA onPredictBuyWithAnyToken) now route to the new bottom sheet instead of the legacyPayWithModalwhen the bottom-sheet feature is enabled. The synthetic "Predict balance" row that the legacy modal injects viausePredictBalanceTokenFilteris suppressed in that mode so the Predict section in the bottom sheet remains the single source of truth.The Crypto section's checkmark behavior is extended so that when Predict balance is the implicit default (
PredictController.selectedPaymentToken === nullon apredictDepositAndOrderflow), the preferred-token row no longer renders a misleading checkmark, and the user-selected-token row is hidden — same "fiat wins / dedicated section wins" semantics that already exist for Perps and fiat payment methods. When the user explicitly picks a crypto token via "Other assets", both pieces of state are updated coherently so the picker reflects the explicit selection.The bottom-sheet route is registered inside the Predict native stack so navigation dispatches from the order screen reach the route reliably, matching the same fix-pattern that was applied to the Perps native stack.
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1363
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist