Skip to content

feat(queue): make a delayed unit leap into its new slot (fixes #441) - #3216

Open
woahwhattheheck wants to merge 1 commit into
FreezingMoon:masterfrom
woahwhattheheck:fix/441-delay-queue-leap
Open

feat(queue): make a delayed unit leap into its new slot (fixes #441)#3216
woahwhattheheck wants to merge 1 commit into
FreezingMoon:masterfrom
woahwhattheheck:fix/441-delay-queue-leap

Conversation

@woahwhattheheck

@woahwhattheheck woahwhattheheck commented Sep 6, 2026

Copy link
Copy Markdown

Fixes #441

What it looked like before

When a unit delays, its vignette went through CreatureVignette.animateUpdate(), which is a single flat keyframe:

const keyframes = [{ transform: `translateX(${x}px) translateY(0px) scale(${scale})` }];

So the avatar slides sideways along the row into its new slot at the same time every other vignette is sliding the other way. It reads as the whole queue shuffling, rather than as that one unit taking itself to the back — which is what you actually did.

What this changes

reuseOldDomElements() already carries the old DOM element across a re-render, so it now carries the old queue position too, as previousQueuePosition. animateUpdate() uses that to tell a backwards move from an ordinary shuffle forwards, and animates the backwards case as an arc: up to a midpoint at half the duration, then down into the new slot.

Delaying is the only thing that sends a unit backwards through the current turn's queue — everything else moves it forwards as units ahead of it act or die — so that check is specific to the delay without needing a new signal threaded through from the game.

Everything else is untouched: forward shuffles, insertions, deletions, the kill animation and the next-turn queue all animate exactly as before. Leap height is a single constant (CONST.delayLeapHeightPx, 60px) if you want it higher or lower.

Testing

Two cases added to the existing src/__tests__/ui/queue.ts, using the Element.prototype.animate mock that's already set up there: delaying a unit produces exactly one arc animation, and a queue that merely shuffles forward produces none.

It's an animation, so the real check is watching it — delay a unit and the avatar should hop into place rather than slide. If the arc is too tall or too fast for your taste that's the one constant.

Not posting a wallet address here; happy to sort that separately if this lands.

Delaying slid the avatar flatly along the queue to its new position, which
reads as the whole row shuffling rather than as that one unit taking itself
to the back.

Carry each vignette's previous queue position across a re-render so an update
can tell a backwards move from an ordinary shuffle forwards. Delaying is the
only thing that sends a unit backwards through the current turn's queue, so
that is the delay landing, and it now animates as an arc into the new slot.

Other movement is untouched: units shuffling forward, insertions, deletions
and the next-turn queue all animate exactly as before.

fixes FreezingMoon#441
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

@woahwhattheheck is attempting to deploy a commit to the FreezingMoon Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

queue avatar to jump back when delayed [bounty: 14 XTR]

1 participant