Skip to content

refactor(wallet): give TokenCardStack's expand and arrival params a shape - #1378

Merged
bmc08gt merged 1 commit into
code/cashfrom
refactor/token-card-stack-params
Aug 31, 2026
Merged

refactor(wallet): give TokenCardStack's expand and arrival params a shape#1378
bmc08gt merged 1 commit into
code/cashfrom
refactor/token-card-stack-params

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #1369 — review that first; this targets its branch.

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 ignore the rest.

Both groups become @Immutable holders in core-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.

progress and pullOffset stay 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 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 (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; TokenCardStackPlacementTest passes neither group and needed no edit.

@bmc08gt bmc08gt self-assigned this Aug 31, 2026
@github-actions github-actions Bot added the type: refactor Code restructuring, no behavior change label Aug 31, 2026
@bmc08gt
bmc08gt changed the base branch from feat/wallet-claim-reveal to code/cash August 31, 2026 17:41
…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
bmc08gt force-pushed the refactor/token-card-stack-params branch from 86438e4 to e0c8fef Compare August 31, 2026 17:42
@bmc08gt
bmc08gt merged commit 0501cfd into code/cash Aug 31, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the refactor/token-card-stack-params branch September 5, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant