Uh oh!
There was an error while loading. Please reload this page.
chore(tokens): drop the unreachable sell branch from the swap success title - #1301
Merged
Merged
Conversation
… title Tearing out the v1 UI removed the Sell button from the token screen, which was the only place a SwapPurpose.Sell could be constructed. The v2 action row offers Give, Convert, and Withdraw, so nothing can reach the success title as a sell any more. The title's `else` arm existed to name the reserve for that case. Make the two reachable purposes explicit and let the fallback go unnamed rather than claim a destination it can no longer have; the suffix was already optional. title_cashReserves had no other reference, so it goes with it. SwapPurpose.Sell itself stays: it is unreachable but still referenced by SwapViewModel, AppRoute, and the sell receipt screen, so removing the type is a larger change than this one. canSell stays too — Convert reads it.
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Stacked on #1290 — base it there, not
code/cash. Merge that first.#1290 guts
TokenInfoScreen.kt(-404 lines), taking the v1ButtonOptionsSell button with it. That was the only place aSwapPurpose.Sellwas ever constructed; the v2 action row offers Give, Convert, and Withdraw. So the swap-processing success title can no longer be reached as a sell.That title's
elsearm existed to name the reserve for exactly that case:Now it catches only a sell that can't happen and a null purpose. This makes the two reachable purposes explicit and lets the fallback go unnamed rather than claim a destination it can't have —
Fiat.formattedalready takes a nullablesuffix, so no signature change.title_cashReserveshad no other reference and goes with it.Deliberately left alone
SwapPurpose.SellandBalanceDecreasestay.Sellis unreachable but still referenced bySwapViewModel(5 sites),AppRoute.kt:226, and the still-routedTokenSellReceiptScreen, plus two tests. Deleting the type is a much wider change than this one — worth its own PR.BalanceDecreaseis also implemented byConvert.canSellstays — it's a computed property the Convert flow reads atTokenInfoViewModel.kt:336to gate the "no balance yet" bottom bar.action_sellstays — still used byTokenSellReceiptScreen.kt:74.Conflict note
feat/usdc-to-dollars-conversion-graphic(commit602ac8960) touches this samewhento suppress the "of " suffix for non-Flexible Buy and reserve-bound Convert. Both changes converge on a nullable suffix, so resolution is mechanical — keep that branch'sBuy/Convertarms and this branch's dropped sell fallback.