Skip to content

CodeAIR in a hand on the page: move arrows, rotation rings and a ranger card - #174

Open
david-firia wants to merge 6 commits into
mainfrom
codeair-handles
Open

david-firia wants to merge 6 commits into
mainfrom
codeair-handles

Conversation

@david-firia

@david-firia david-firia commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

CodeAIR in the student's hand on the page: a toggle in the simulator's bar shows slicer-style move arrows and rotation rings over the drone, so a grounded drone can be slid and turned for the FLY ground missions, and a second toggle puts a reflector card in front of it for the rangefinders.

Builds on #173 (the world's hold, release and ranger card, merged). It follows the bar-toggle pattern of #167 with its own classes, so it needs none of #167's code. Its move and card buttons share one CodeAIR group in the bar with #171's camera button (on a phone, the first line, beside BTN 0 and BTN 1), and the camera's picture leaves out the handles.

The handles (src/sim/view/handles.js). Arrows forward and back, left and right, and up; rings for roll, pitch and heading; all lined up with the drone's heading, in the room's axis colours. A drag on an arrow slides along it, on a ring turns about it, on the drone itself slides it across the floor. Each drag asks the world's hold() for the pose; the move button again releases it, and it falls and settles flat.

  • Every part a finger takes is 44 CSS pixels across at any camera distance: an unseen thick picker round each drawn part.
  • The rings grow to go round the drone when the camera is near, as a slicer's do, so they never hide it, up to 30% of the view's height.
  • Pointer events, so a touch drags as a mouse does (phones, Chromebook touchscreens). A drag's travel is read on the page: along an arrow as it shows, round a ring's middle when the ring faces the camera, along the ring where it was taken when it is seen edge on.
  • I wrote these rather than use three's TransformControls: its rotate mode adds a free trackball and a screen ring that would confuse a student, and its handle sizes cannot be held to 44 px.

The card. Upright, 12 cm ahead of the drone, facing it; the front ranger reads it (about 80 mm). The handles move to the card when it appears (a tap on the drone or the card picks which), in the drone's frame, so sliding it toward the front ranger is along one arrow.

Two fixes the handles showed. A drone let go tipped stayed tipped on the floor (its lean decayed with the time step squared); it now settles flat. The figure tilted pitch then roll, the world roll then pitch; it now matches, so a drone held both rolled and pitched is drawn as it reads.

Tests (tests/sim-ui.mjs, in the CodeAIR flight section): the move button shows the handles; the forward arrow, pressed 18 px to the side of its line, slides it forward; the up arrow lifts it; a touch on the heading ring turns it; the roll ring tips it; the card button puts a card the front ranger reads (and taken away, the room again); the card's arrow moves it; the move button again lets go and it settles flat. sim.mjs, i18n, pseudo, a11y and smoke pass locally. Locally sim-ui.mjs timed out twice in CodeBot's Run and Pause steps, well before this section, on a host at load 23 on 12 cores; CI passes.

Not yet: no keyboard way to move the drone (the arrow keys stay the camera's).

Screenshots (phone 390 px, Chromebook 1366 px, desktop 1440 px)

Phone: handles Phone: card Phone: with the camera view

Chromebook:

Desktop:

🤖 Generated with Claude Code

https://claude.ai/code/session_01SS5gJ2c2Qc8EBGyMEjiPVq

david-firia and others added 2 commits December 3, 2026 09:49
…er card

A move button in the simulator's bar shows arrows and rings over CodeAIR, as
a slicer draws them (view/handles.js): arrows forward and back, left and
right, and up, rings for roll, pitch and heading, lined up with the drone's
heading. A drag on an arrow slides along it, on a ring turns about it, on the
drone itself slides it across the floor; each asks the world's hold() for the
pose, and the button again releases it. Every part a finger takes is 44 CSS
pixels across at any camera distance, the rings grow to go round the drone
when the camera is near, and pointer events make a touch the same as a mouse.

A card button puts the ranger card upright 20 cm ahead of the drone, facing
it, for the rangefinders to read; the handles then move the card (a tap on the
drone or the card picks which).

The worker passes hold, release and card on to the world. Let go tipped, the
drone now settles flat on the floor: its lean decayed with the step squared
and so stayed. The figure tilts roll then pitch, as the world does, so a drone
held both rolled and pitched is drawn as it reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS5gJ2c2Qc8EBGyMEjiPVq
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit ac02aaa):

https://firialabs-open-editor--pr174-codeair-handles-esbi1aqj.web.app

(expires Thu, 10 Dec 2026 16:51:14 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 81259a1fec315ca1af3747d225d9c7424890be3e

david-firia and others added 2 commits December 3, 2026 10:07
The card stands near the view's edge with the camera close, and its forward
arrow can fall outside the canvas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS5gJ2c2Qc8EBGyMEjiPVq
In CI's narrower view the card stood beside the camera, its handles off the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS5gJ2c2Qc8EBGyMEjiPVq
@david-firia
david-firia changed the base branch from codeair-hold to main December 3, 2026 16:45
david-firia and others added 2 commits December 3, 2026 10:50
…he bar

The camera's picture leaves out the handles drawn over the scene.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS5gJ2c2Qc8EBGyMEjiPVq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS5gJ2c2Qc8EBGyMEjiPVq

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