Skip to content

feat(jollity-worker): draw the docked Register slider on the host's gesture node - #53

Draft
HadiKhai wants to merge 2 commits into
mainfrom
feat/jollity-worker-gesture-slider
Draft

HadiKhai wants to merge 2 commits into
mainfrom
feat/jollity-worker-gesture-slider

Conversation

@HadiKhai

@HadiKhai HadiKhai commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

What it does

On a host that draws the generic Gesture node, the docked Register slide is drawn by the Jollity worker from the host's general nodes, and the card no longer carries a SlideToConfirm node:

  • The 80 pill in #33363A, the white 56 thumb with its shadow, chevron and spinner, and the two lines (the label with a shimmer band over the date). The text fades as the thumb travels.
  • The press, the spring settle and the pop are passed to the host as the gesture's feel, so the host plays them at display rate.
  • A slide past 90% of its travel registers as the card's own Register, so the sign-up still has one way in.
  • Docked with nothing to announce, the slider stands alone in the room footer. The host docks it as it docks any card.

GESTURE_SINCE in src/renderer.ts lists the hosts that get it. It stays empty until a truapi release carries the node, so today every host keeps what it has now.

The build's GESTURE_MODE picks how the slider follows the finger:

  • host-driven (the default): the host moves the thumb, and the worker hears only the start and the end.
  • every-move: the host paces the moves, and the worker answers the newest one with a SetOffset for the keyed thumb. It sends a tree only when something else changes, and at the end of a drag.

The first commit adds newestOnly (src/newest-only.ts), the same commit as in #52. Whichever of the two lands second drops it on rebase.

How it looks

The docked Register slider in the room footer, iPhone on top and Android below, lined up at the first touch: the thumb follows the drag, the text fades as it travels, and it springs home on release. The ring is a local debug overlay drawn by the host at the finger's real position in the same frame. The Android half is an emulator drawing in software, so it records at about 46 frames a second and its drag reaches the app a little later. Recorded with a build of this PR's head that lists the two test hosts in GESTURE_SINCE.

docked-thumb-drag-and-spring-home-iphone-above-android.mp4

How it was tested

  • Docked on an iPhone simulator and an Android emulator, the slider draws the approved look: the pill, thumb, lines, shimmer, fade, press, spring and pop. On both, the thumb stays under the finger through the drag and springs home on release.
  • Unit tests cover the move decoding (hundredths of a logical pixel), completion and reset, both modes, the drawn values, the line placement, the loading state, the offset answers, and the host gate.
  • Locally, against a truapi build that carries the new nodes: eslint apps/jollity-worker reports no errors, typecheck is clean, and the worker's tests pass except the truapi wire schema pin in hostStack.test.ts, which moves only with a truapi release.

What it needs from trinity-user-agents

It needs what no truapi release carries yet:

  • the Gesture node with its event payload (positions in hundredths of a logical pixel);
  • the SetOffset update for keyed gestures;
  • the styling by value (Font, Fill, Shadow, Translate, Shimmer, FadeWithPan, Spin);
  • the gesture's feel.

The paired draft pull requests on paritytech/trinity-user-agents are in progress.

Checks that can't pass yet

On truapi 0.32.0, typecheck fails on the new exports and node shapes in src/gesture-slider.ts, and the tests that encode a gesture event fail. The rest of the worker's tests pass. The schema pin in hostStack.test.ts moves with the truapi bump. When that bump lands, GESTURE_SINCE gets the release that carries the node.

What's not done

  • No host is listed in GESTURE_SINCE yet.
  • The confetti after a slide is not part of this change.

src/index.ts is also changed by #51. Whichever of the two lands second rebases.

…holds

A host that paces a keyed pan sends at most one move a display frame, and
none while the last is unanswered. newestOnly answers the newest move once
the ones already delivered have been read, so a slow worker answers where
the finger is now instead of working through a backlog. The scratch card and
the worker slider both answer their moves through it.
@HadiKhai
HadiKhai force-pushed the feat/jollity-worker-gesture-slider branch from cc6c3ca to 5a3f330 Compare November 24, 2026 10:21
…esture node

On a host that draws the Gesture node (GESTURE_SINCE, empty until a truapi
release carries it), the docked Register is a slider the worker draws
itself: the 80 pill in #33363A, the white 56 thumb with its shadow, chevron
and spinner, the two lines with the shimmer band on the first and the text
fading with the thumb, and the press, spring settle and pop passed to the
host as the gesture's feel. A slide past 90% registers as the card's own
Register. Docked with nothing to announce, the slider stands alone in the
room footer; the host only docks the tree, as it docks any card.

The card vocabulary holds the slider as its own Slider node, which toWire
draws with the gesture slider, so the card no longer carries the
SlideToConfirm node it kept for a host-drawn slide, nor its gate. Every
other host, and every card in the feed, gets the I'll be there button.

GESTURE_MODE picks how it follows the finger: host-driven (the default),
where the host moves the thumb, or every-move, where the worker answers
paced moves with a SetOffset for the keyed thumb and sends a tree only when
something else changes and at the end of a drag.
@HadiKhai
HadiKhai force-pushed the feat/jollity-worker-gesture-slider branch from 5a3f330 to 6e4b119 Compare November 24, 2026 10:22

This branch has not been deployed

No deployments
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.

1 participant