Repository navigation
fix(room): make Remote Control stop others from moving you - #51
Conversation
Quest-Claim: 33852c086e31fe30
Turning off Remote Control now hides your window handle, so peers see your tile as locked, and ignores the moves peers ask of you. Dragging others no longer depends on your own setting. Each peer move carries an ID the moved peer echoes in `window.applied`, so a move that lands where the peer already is still settles instead of replaying later. Both fields are optional: older peers ignore them and are still settled by matching position. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…id-gesture lock Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Maintainer decision (via /quest-run): fix the remaining pinch-lock finding as the reviewer recommends, by re-saving the drag's starting spot at (Written by Claude Opus 5.5 with high) |
Re-grab only when the pinch targets a different tile, so a lock during a drag-then-pinch restores the tile's original spot instead of the drag preview. A drag on another tile is published before the pinch takes over, matching the touch-handoff path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Applied the decision in 1f07e63: the pinch start at (Written by Claude Opus 5.5) |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Resolve an import conflict with #49 in app/src/room/index.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pinch on lock - A lock that drops a still-pending move puts the tile back at the peer's published placement, or where it sat before our moves. - All peer moves go through the earliest-added local broadcast (the camera), so a z-order change can't split them across tracks and replay an older one. - Lifting a finger after a lock ended the pinch no longer starts a drag on another tile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed pinch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t it Space's drag, wheel, touch, pinch, and lock handling moves into room/gesture.ts, which Space feeds canvas-relative points. The suite covers the #51 cases: a drag turning into a pinch keeps its home, a lock ends the gesture and drops its pinch baseline, a rejected move restores the home under the peer's placement, and a re-grab with a move pending keeps the older home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes the
quest/m1/remote-control.mdquest.Problem
Settings → "Remote Control" ("Allow others to drag/resize your camera") was wired backwards. It only controlled whether you could send moves to others. Peers could always move your tile, and always saw it as draggable, because
window.handlewas always published.Separately, a move was settled only once the peer published the same x/y/s. So a move that undid one still in flight, landing where the peer already was, could stay queued and replay later, snapping the tile back once.
Approach
LocationFields.window.movable(fed bySettings.draggableinlocal.ts) replaces the misusedpeers.enabledand the unusedwindow.enabled.serveExtraspublisheswindow.handleonly while movable, so peers' existingBroadcast.locked()shows the tile as locked and they can't address moves to it. Each unlock issues a fresh handle, so a move asked before a lock can't land after it.index.tsfollows a peer's requests only while movable, through a per-peer, per-windowPeers.Inbox.Space.#publishPositionsends every move through one local broadcast, the earliest added (the camera), whatever your own setting. Picking by stacking order let a chat or drag move requests to the screen share's track, where an older one could arrive last and snap the tile back.id. The moved peer applies each ID once and echoes it inwindow.appliedwhile the request stands, even when its position doesn't change. The requester drops a request only once its ID is echoed. Requests without an ID (older senders) are applied on every publish, as before. Peers that publish noappliedlist (older receivers) are still settled by matching x/y/s, keeping the old skip for moves they already made.Public API and wire impact
No public package API.
hang/location.jsongains optional fields only, so mixed versions keep working:peers.positions[handle].id?: string: the move's confirmation ID.window.applied?: string[]: the IDs of requests applied and still standing. Its presence, even empty, tells requesters to wait for the echo instead of matching positions.window.handleis now omitted while Remote Control is off. Older peers already treat a missing handle as locked.Older peers strip the unknown fields (zod
objectstrips them; checked), and new peers fall back to position matching for them. Rolling back just removes the new fields.Decisions
Choices I made without asking, for review:
handlerather than adding alockedflag. It reuses the existing optional field, so older peers see the lock too.appliedis a flat list across requesters, so IDs are random (about 60 bits) rather than per-requester counters. Each peer's list is bounded by its current requesters times its local windows.aria-label). They had none, which I hit while driving the UI.Alternatives
Caused by
No single PR. The setting has gated sending moves since before history was cleaned up (
b06df4f), and moq-dev/hang.live#28 carried it over unchanged. The position-only settling came from moq-dev/hang.live#46, which knowingly left this replay case. It wasn't a mistake there; this PR adds the wire change it needed.Follow-ups
None.
Validation
quest gate just checkpasses: quest check, tsc, biome, and API, app (55), and media (2) tests.media.browser.tsdidn't flake.peers.test.ts(ID settling, superseded echoes, staying in place, legacy fallback,Inboxapply-once/echo/close) andmetadata.test.ts(serve→consume round trip;handle/appliedhidden when not movable;peers.positionsunaffected).just devwith two tabs in@rctestas different guests (Y, Z), driven byagent-browser. I logged each tab's publishedhang/location.jsonby hooking the live@moq/jsonsnapshot producer (no code change):{…, id}, Y applies the position and echoesapplied:[id], Z drops the request, Y clears the echo.handle/applied. In Z, Y's tile doesn't move under a drag and no request is sent.h145p42meje→ off →jnbe4raklda).space.ts:324) is covered byjust check(tsc, biome, tests) only: it's a touch-only path and wasn't driven in a browser.@rciter(Y, Z):7. Rejected pending move: Y's
Inbox.receivestubbed so it never applies. Z drags Y's tile and releases; Z publishes the request on its camera track. Y turns Remote Control off: Z drops the request and Y's tile returns to its pre-drag spot (Y never published a placement).8. One carrier: Z starts a (canvas-backed) screen share, then drags its camera (z 7) and Y (z 8) above the share. The request still goes out on the camera's
location.json(huxv3zodmoi); before, the lowest-z broadcast (the share) carried it.space.ts:444) is touch-only and covered byjust checkonly. Space has no unit harness (it needs WebGL, audio, and MoQ watch sources), so the new unit test coversPeers.dropreporting a pending move.Models
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with high)
Review
Rewritten by
quest reviewafter each round.Head: d096efc
Base: origin/main at d2b6c61
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.2-sol, high effort
Session:
01a21689-00f2-76e0-9054-851f8236fe02, round 3Score: 10/10,
Both earlier findings are fixed, and the follow-up introduces no new findings.Rounds: 7; first round 3 (medium 3); findings 7 (medium 7): fixed 6, refuted 1, open 0
Findings: none
The last round's findings, at 8502ae7:
app/src/room/space.ts:587:Restore every edited field when locking rejects a pending move;At app/src/room/space.ts:589, rollback overlays the advertised fields on the saved placement, so an omitted scale returns to its pre-move value.app/src/room/space.ts:445:Clear pinch state when a lock cancels the gesture;At app/src/room/space.ts:579, lock cleanup clears the active drag and resets both pinch baseline values, so the next gesture cannot reuse them.