Repository navigation
Conversation
Rigidity
marked this pull request as ready for review
November 15, 2026 03:02
Rigidity
force-pushed
the
rigidity/offer-asset-pickers
branch
from
November 15, 2026 04:29
51dabd6 to
6f16ff4
Compare
Adding a token or NFT now opens a picker straight away, so empty rows are never left behind. The token picker lists balances and accepts a pasted asset ID when requesting; the NFT picker stays open so several NFTs can be added at once. The token in a row is a compact chip that reopens the picker, and offered NFTs show as read-only summaries.
The token chip now comes first in a token row, and Max is an icon inside the amount field. Offered options are added from a multi-select picker and shown as read-only rows with their terms, sharing the picker shell with NFTs; requested option IDs are checked as they're typed.
Clearing the offer re-renders the page with an empty fee before it navigates away, and the number input reports that prop change as a new value. Writing it back recreated the offer, so the offers page sent you straight back. Prop-driven changes only echo the stored fee, so ignore them.
New offers start with "Split coins first" on, unless it's turned off in Settings > Transactions, and with the default fee as the split fee.
Requested tokens come from every CAT on Dexie, nearly a thousand, which were all drawn at once. Show 50 at a time, with XCH and the tokens you hold first, and put exact ticker matches ahead of partial ones.
- Only turn on one offer per NFT from the collection toast while an offer is still being made; after it was cleared, a partial state crashed the New Offer page - Store a pasted option ID without surrounding whitespace - Share NftSummary between the NFT picker and the offered NFT row - Use getNfts' total to tell whether there are more NFTs - Test the split fee on Cancel, the network fee coming back, changing a row's token, and checking requested option IDs
- Fill in the default fee only when the fee input first appears empty. Coming back to an offer with a stored fee and pressing Cancel let the later fill recreate the offer - Only accept a pasted option ID the wallet still holds - Give TokenIcon a size instead of overriding its image's classes - Test Done after creating an offer
getOptions already searches names and tickers and finds a pasted option ID among the options the wallet holds, so use it instead of filtering a list of up to 1000 on the client. Test that the NFT and option pickers search by what was typed and that Show more loads more NFTs.
A search typed while the first list was loading could finish first, and the older list then replaced the IDs whose thumbnails were loaded.
Rigidity
force-pushed
the
rigidity/offer-asset-pickers
branch
from
November 15, 2026 05:12
5f98e74 to
4692418
Compare
This branch has not been deployed
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.
Follows #1007 in the create offer stack. Three changes: the pickers used to add assets are replaced, a bug where the offer's split settings were forgotten is fixed, and there's a new setting for splitting coins by default.
Split settings are kept
"One offer per NFT", "Split coins first" and the split fee were local state on the create offer page, so they reset whenever you left the page and came back, unlike the assets. They're now part of
OfferState, alongside the assets.The network fee input also wasn't given its stored value. When you came back to the page, it showed the default fee while the offer still held the fee you had entered. It now shows the stored fee. The fee handlers ignore changes that come from the value prop rather than from typing. Clearing the offer (Cancel, or Done after creating it) re-renders the page with an empty fee before it navigates away. Without this, the input reported that as a new value and recreated the offer, so the Offers page sent you straight back.
NftGroupCardused to passsplitNftOffersthrough router state. It now sets it in the offer state, and the unusedsetSplitNftOffersprop is removed fromNftGroupCardandNftCardList.Split coins by default
A new Split Coins for Offers setting in Settings → Transactions, next to Default Offer Expiry, sets whether new offers start with "Split coins first" on. It defaults to on, and like the other offer defaults it's stored in local storage (
default-offer-split). It can still be changed for each offer.New offers also start with the default fee as the split fee. Before, the split fee box filled in the default fee when it first appeared. Now the offer state starts with it, so the split fee is already set before that box has rendered.
Asset pickers
Before, adding an asset created an empty row with a half-width dropdown. Its popover matched the trigger's width, so names and asset IDs were cut off. NFTs came 8 per page with arrow buttons.
TokenPicker). A row is only created once a token is picked, and its amount input takes focus.NftPicker,OptionPicker), both built on a sharedMultiAssetPicker. Each has search (by name or a pasted ID) and "Show more". The picker stays open so several can be added at once, and picking one again removes it. Options are searched withgetOptions'find_value, which only returns options the wallet still holds. Expired options are left out.NftSelectorandOptionSelectorare removed, since nothing uses them any more.TokenSelectorstays becauseMintOptionuses it.Testing
pnpm prettier:check,pnpm lint,tsc --noEmitandpnpm test:unit(220 tests, after rebasing onto main) pass.Review
Three review rounds, each run with separate correctness, tests and simplification reviewers, plus a final correctness check.
nullstore.splitOfferNfts()insrc/state.tsnow only updates an offer that still exists.FeeAmountInput's one-time default fill hadn't run at mount, so it ran when Cancel cleared the fee. The input now fills in the default fee only when it first appears empty. This is a shared component with 17 callers. The other callers mount empty (WalletConnect mounts with a suggested fee), so their first fill is unchanged. Clearing a field later no longer snaps back to the default.Smaller fixes along the way:
getNfts'totalfor "Show more".NftSummarybetween the picker and the offered NFT row.TokenIcona size prop.Decisions to confirm
NftRecordhas no owned flag, so fixing it needs a backend change.New strings are wrapped with Lingui; the next release needs
pnpm extract.