Skip to content

feat: add JoggingJointSlider, jogging a joint toward a pressed point - #652

Merged
temmuz merged 2 commits into
revampfrom
feat/jogging-joint-slider
Nov 19, 2026
Merged

temmuz merged 2 commits into
revampfrom
feat/jogging-joint-slider

Conversation

@temmuz

@temmuz temmuz commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Adds JoggingJointSlider: one joint as a slider across its limits, held to jog the joint toward a point on its track. An app shows one per joint, as with JoggingJointValueControl.

  • JoggingJointSlider (from /core): the thumb at the joint's value, the limits below the track and a mark at zero, as in the Figma "Panel Robot Pad Joint Limits" frame. Hovering the track shows the goal under the pointer ("43.8° / 86.4°" and the stretch to it). Pressing there jogs the joint toward it until it gets there or the slider is let go. While held, the goal follows the pointer, and the joint turns around when the goal passes it. An arrow key held on the focused slider jogs toward that limit.
  • Props: label, name, value, min, max in NOVA's units (radians, or mm with linear), angleUnit (degrees by default), onJogStart(direction), onJogStop, disabled. Like JoggingGizmo and JoggingButtons, it moves nothing itself. One press can bring several starts and stops, always in turn: the joint stops at the goal, holds there while the pointer rests, and starts again when the goal moves on. On a turn-around, onJogStop and the onJogStart of the other way come in one event.
  • Limits: a revolute joint with one limit spans one turn from it, and without limits the turn it stands in; an arrow key never jogs against its way. A linear axis without both limits only shows its value.
  • Hold-to-jog: a hold ends on release, pointer cancel, lost capture, a move with the primary button up, blur, window blur, a hidden tab, disabled and unmount. Cmd and Ctrl+click are ignored, as macOS would swallow their release. A second pointer cannot take over. The hold is recorded before the app is called, so a failing onJogStart still gets its onJogStop. One joint at a time is up to the app; the README shows it with a ref.
  • New public exports from /core: JoggingJointSlider and JoggingJointSliderProps. Nothing existing changes.
  • Playground: a JoggingJointSlider section with joint 1 and a disabled joint 2, and a Playwright test that jogs joint 1 toward a pressed point, drags past it to turn it around, and checks it stops on release. The playground's stopJogging keeps the jogging connection when a newer press came in, so a turn-around works.
<JoggingJointSlider
  label="J1"
  name="Base"
  value={jointValues[0]}
  min={limits[0].lower_limit}
  max={limits[0].upper_limit}
  onJogStart={(direction) => startJointJogging(0, direction)}
  onJogStop={() => stopJogging()}
/>

One joint as a slider across its limits, with the thumb at the joint's
value, the limits below and a mark at zero; an app shows one per joint.
Hovering the track shows the goal under the pointer, and pressing there
jogs the joint toward it: it stops when it gets there or when the slider
is let go. While held, the goal follows the pointer, and the joint turns
around when the goal passes it. An arrow key held on the focused slider
jogs toward that limit.

It takes value, min and max in NOVA's units (radians, or mm with linear)
and onJogStart(direction) / onJogStop, and moves nothing itself. A hold
ends on release, pointer cancel, lost capture, no button pressed, blur,
window blur, a hidden tab, disabled and unmount; Cmd and Ctrl+click are
ignored, as macOS would swallow their release. Exported from /core.

The playground has a JoggingJointSlider section (joint 1, and joint 2
disabled), with a Playwright test that jogs joint 1 and checks it stops.
From the review of the PR:

- The positions of the thumb, the goal band and the zero mark go in
  style, not sx: sx added a CSS rule for each new joint value and never
  removed it. The drawing is its own component, JointSliderTrack.
- A turn-around brings onJogStop and the onJogStart of the other way in
  one event. The docs say so, the playground's stopJogging keeps the
  jogging connection when a newer press came in, and the Playwright test
  drags past the joint and expects it to turn around.
- A revolute joint without limits spans the turn it stands in, and with
  one limit one turn from it; an arrow key never jogs against its way. A
  linear axis without both limits only shows its value.
- The hold is recorded before the app is called, so a failing onJogStart
  still gets its onJogStop; the pointer is captured before the jog starts.
- After it stops at its goal, the joint holds there until the pointer
  moves away from that spot, so an overshoot does not jog it back.
- Keyboard focus shows the design system's outline; the halo is for the
  hovered or held thumb. Releasing the primary button ends a hold while
  another button stays pressed. The hover goal follows the pointer and
  is hidden while disabled. Limits in radians keep two decimals, halves
  round away from zero. The thumb is border-box, the limits are captions.
- The README's one-joint-at-a-time pattern guards with a ref.
- Tests for pointercancel, lost capture, blur, a hidden tab, a second
  pointer's release, ArrowUp/Down, key repeat, the live value, one start
  per direction, and a track that does not start at x = 0.
@temmuz
temmuz merged commit 91d9b49 into revamp Nov 19, 2026
3 checks passed
@temmuz
temmuz deleted the feat/jogging-joint-slider branch November 19, 2026 13:14
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