refactor(wallet): give TokenCardStack's expand and arrival params a shape - #1378
Merged
Conversation
…hape TokenCardStack took fourteen parameters, six of which described two states the caller could spell incorrectly. Three of the four expand parameters mean nothing unless `expandingMint` names a card, and `arrivalHeld` means nothing without `arrivingMint`, so a caller could describe a deck mid-expand with no card expanding and the stack would quietly do nothing with the rest. Both groups become @immutable holders in core-ui: TokenCardExpansion (mint, heroTarget, progress, pullOffset) and TokenCardArrival (mint, held). Null is now the only way to say "no card is expanding", and the parameter list is down to ten. progress and pullOffset stay lambdas — the deck reads them in its placement and draw phases so a scrub repositions cards without recomposing them, and that is worth more than the tidier signature a plain Float would give. The arrival Animatable is keyed on the mint rather than the holder, so a caller that rebuilds the holder on every recomposition does not restart the rise. The four dimension parameters stay flat; they are independent, each has a sensible default, and only one call site overrides any of them.
bmc08gt
force-pushed
the
refactor/token-card-stack-params
branch
from
August 31, 2026 17:42
86438e4 to
e0c8fef
Compare
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.
Stacked on #1369 — review that first; this targets its branch.
TokenCardStacktook fourteen parameters, six of which described two states the caller could spell incorrectly. Three of the four expand parameters mean nothing unlessexpandingMintnames a card, andarrivalHeldmeans nothing withoutarrivingMint, so a caller could describe a deck mid-expand with no card expanding and the stack would quietly ignore the rest.Both groups become
@Immutableholders incore-ui:TokenCardExpansion(mint, heroTarget, progress, pullOffset)TokenCardArrival(mint, held)Null is now the only way to say "no card is expanding", and the parameter list is down to ten.
progressandpullOffsetstay lambdas. The deck reads them in its placement and draw phases, so a scrub repositions the cards without recomposing them — worth more than the tidier signature a plainFloatwould give. The arrivalAnimatableis keyed on the mint rather than the holder, so a caller that rebuilds the holder on every recomposition does not restart the rise.The four dimension parameters (
cardHeight,fannedReveal,collapsedReveal,pinInset) stay flat: they are independent, each has a sensible default, and only one call site overrides any of them.No behaviour change. The wallet is the only production call site;
TokenCardStackPlacementTestpasses neither group and needed no edit.