Skip to content

feat(revyl): run one-finger fling and pan as one timed drag - #5113

Merged
thymikee merged 2 commits into
callstack:mainfrom
KayaanT:revyl-fling-timed-drag
Nov 27, 2026
Merged

thymikee merged 2 commits into
callstack:mainfrom
KayaanT:revyl-fling-timed-drag

Conversation

@KayaanT

@KayaanT KayaanT commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Revyl sessions refused every swipe, gesture fling and gesture pan with
gesture fling is not supported on android (and ios), although the worker's /drag
action already takes duration_ms when its health reports
supports_explicit_drag_duration, and scroll --duration-ms already uses it.

The Revyl plugin now admits performGesturePlan and performDirectionalFlingPlan and sends
a single-pointer plan as one /drag from its first sample to its last over the plan's
durationMs, which is 100 ms for a fling. The planner already keeps every sample inside the
viewport. A worker without timed drags refuses with unsupported-provider-mode instead of
running the gesture at a speed it picks. Multi-touch, gesture drag and held pans stay
refused. The Revyl page and the capability matrix are updated.

Before / after

agent-device swipe 540 1600 540 600 on a Revyl Android session:

  • Base (as reported by a Revyl user): refused with gesture fling is not supported on android
    and the hint Revyl does not expose portable gesture execution.
  • Head: Flung, with backend: "revyl-device-proxy" and durationMs: 100 in --json.

Validation

  • pnpm check:affected --run passed with exactCommit: true (format, lint, typecheck,
    layering, fallow, build, vitest-related, unit, capabilities-matrix, docs-links, docs-prose).
  • Live Revyl Android emulator, on a system notification row: a 300 px horizontal
    gesture pan over 500 ms left the row in place. The same 300 px as gesture fling right
    (100 ms), and as an 80 ms pan, dismissed it.
  • Not run on an iOS simulator.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

Revyl workers that report supports_explicit_drag_duration take duration_ms on /drag. The plugin now admits performGesturePlan and performDirectionalFlingPlan and sends a single-pointer plan as one drag from its first sample to its last over the plan duration, so swipe and gesture fling keep their speed. Workers without timed drags refuse the gesture instead of running it at their own speed. Multi-touch and held drags stay refused.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 7 files

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Re-trigger cubic

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="website/docs/docs/revyl.md">

<violation number="1" location="website/docs/docs/revyl.md:96">
P3: The Revyl support list omits `gesture swipe`, even though it is normalized to a single-pointer fling and reaches the same admitted timed-drag path as the listed gestures. Add `gesture swipe` to the supported forms so the following “every other command” statement does not mislead users.</violation>

<violation number="2" location="website/docs/docs/revyl.md:96">
P2: This wording is incorrect for repeated swipes: `swipe --count` and `--pattern` send multiple drags, not one. Say that each swipe iteration sends one timed drag so users do not infer that repetition flags are unsupported or ignored.</violation>
</file>

<file name="website/docs/docs/capabilities.md">

<violation number="1" location="website/docs/docs/capabilities.md:117">
P2: This bare `Yes` overstates Revyl gesture support: timed `gesture pan` and `gesture fling` refuse on workers without explicit drag-duration support instead of dispatching. Add a Revyl-specific qualification to the generated capability matrix so the table exposes that prerequisite.</violation>
</file>

<file name="packages/provider-revyl/src/interactor.test.ts">

<violation number="1" location="packages/provider-revyl/src/interactor.test.ts:384">
P2: This test claims the fling is one drag but only inspects the last `/drag` request, so a regression that sends multiple drags would still pass. Assert that the fixture received exactly one `/drag` before checking its body.</violation>
</file>

<file name="packages/provider-revyl/src/interactor.ts">

<violation number="1" location="packages/provider-revyl/src/interactor.ts:340">
P2: This guard admits held single-pointer pans and collapses their hold into continuous movement over the total duration. Reject plans with contact-hold samples before dispatching `/drag`.</violation>
</file>

Comment thread website/docs/docs/capabilities.md Resolved
Comment thread website/docs/docs/revyl.md Resolved
Comment thread website/docs/docs/revyl.md Resolved
@thymikee

Copy link
Copy Markdown
Member

Thanks for the contribution. At 40bff98, Split View swipes on Revyl iOS now send the wrong gesture and report success, and the new device path still needs a recorded live run.

On a Revyl iOS session, gesture swipe split-view-left|split-view-right|split-view-exit becomes a preset fling that this path now admits. buildSplitViewPlan accepts it and returns a single-contact plan with a split-view-edge or split-view-divider contact origin. performGesture checks only topology and drag duration, so a timed-drag worker sends one straight /drag from the first sample to the last. The left and right presets lose the lift, hold and sideways path, all three lose the contact origin, and the command reports "Flung". Before this change these commands were refused before any touch, as the docs and help foldable still describe. A Revyl session is never a foldable Duo, so split-view-exit can drag from the screen center to the left edge of whatever app is open. Please run an endpoint drag only for a plan that two samples and an ordinary contact can express. Before dispatch, throw splitViewUnavailableError('Revyl does not support Split View') when isSplitViewContactOrigin(plan.contactOrigin) is true (both are in @agent-device/contracts/scroll-gesture), as WebDriver does, and also refuse samples.length > 2. Add a test that uses a buildGesturePlan Split View plan or the same shape, and asserts reason split_view_unavailable and no /drag request.

The changed device path has no recorded live run, and this is required before merge. The PR says Revyl iOS was not run, and the Android notes give no commands, output or SHA, with no live swipe in Validation. iOS differs here: it uses point coordinates and takes the gesture viewport from the snapshot, where a non-reported root viewport refuses with window-origin-unknown. So the support matrix says Yes for iOS without proof that these gestures work or that the worker reports timed drags. At the fixed head, please run swipe x1 y1 x2 y2, gesture fling <dir> and gesture pan with a duration on both Revyl iOS and Android. Record the commands, --json output (backend revyl-device-proxy, durationMs), source SHA, run id, and before and after snapshots that show the screen moved. On iOS, also run gesture swipe split-view-left and show split_view_unavailable with an unchanged screen.

These open threads still apply and do not block the merge: iOS support matrix, single drag assertion and swipe count wording. One lower-priority thread also still applies. This thread does not apply and can be resolved: a pan with a hold goes to target-authored-drag, which Revyl leaves unsupported, so it never reaches performGesture (the Split View presets above are a separate path).

Checks at this head pass or are skipped. A cancelled Body rules run passed on a later run.

Not verified here: no tests or live device runs were performed, and the Split View problem was traced by reading the code. Not verified here: the Revyl worker's /drag behavior (release momentum, edge touches, timed drags on iOS), the reported check:affected and Android live results, and Maestro replay swipes on Revyl, where the gesture viewport is still declared unavailable.

Before merge, the Revyl interactor must refuse Split View preset plans before dispatch, with a test, and live Revyl iOS and Android swipe, fling and pan runs must be recorded at the new head.

…ning them

A Revyl gesture is one straight timed /drag between a plan's endpoints. Split View presets
need a system edge contact and a path with a hold and a corner, so they now refuse with
split_view_unavailable before any drag, as the WebDriver providers do. Any other
single-contact plan with intermediate samples refuses rather than being flattened.

The capability matrix qualifies the Revyl gesture cell (one finger, on a worker that reports
drag duration), and the Revyl page lists gesture swipe, the Split View refusal, and one drag
per swipe repetition.
@KayaanT

KayaanT commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Both points are addressed in d3dd944.

Split View. performGesture now refuses a Split View contact origin with splitViewUnavailableError('Revyl does not support Split View') before any request, as WebDriver does. It also refuses any single-contact plan with more than two samples instead of flattening it to its endpoints. The new interactor test builds the plan with buildGesturePlan({ intent: 'fling', preset: 'split-view-left' }, viewport, 'ios'), then asserts reason split_view_unavailable and that no /drag was sent. Without the guard it fails with "Missing expected rejection". @agent-device/gestures is a new devDependency of the Revyl package, with a matching tsconfig reference, for that test only.

Live runs. Both runs used the same source tree (62182d1) on Revyl staging. The CLI was built from this branch and the plugin dist was built from this branch. Each gesture was followed by snapshot -i and a screenshot.

iOS simulator, Settings app, viewport 440×956 pt, run 1a126466-22b7-4ec1-ac2f-6605ea0b891c:

Command --json (trimmed) Top rows of snapshot -i after
before Apple Account, Optimizing Search and Siri, General, Accessibility
swipe 220 750 220 300 kind: fling, backend: revyl-device-proxy, durationMs: 100, 220,750 → 220,300 Appearance, Camera, Home Screen & App Library, Search
gesture fling down 220 300 400 kind: fling, backend: revyl-device-proxy, durationMs: 100, 220,300 → 220,700 Apple Account, Optimizing Search and Siri, General, Accessibility
gesture pan 220 750 0 -400 600 kind: pan, backend: revyl-device-proxy, durationMs: 600, 220,750 → 220,350 Appearance, Camera, Home Screen & App Library, Search
gesture swipe split-view-left success: false, code: UNSUPPORTED_OPERATION, reason: split_view_unavailable, dispatched: no unchanged: Appearance, Camera, Home Screen & App Library, Search (screenshot pixel-identical to the one before)

Android emulator, Settings app, 1080×2400 px, run 46df5b90-60e7-4893-8ff0-eb970db345cf:

Command --json (trimmed) snapshot -i after
before Network & internet at the top of the list
swipe 540 1900 540 700 kind: fling, backend: revyl-device-proxy, durationMs: 100, 540,1900 → 540,700 list scrolled to Accessibility and below
gesture fling down 540 700 1100 kind: fling, backend: revyl-device-proxy, durationMs: 100, 540,700 → 540,1800 back to Network & internet
gesture pan 540 1900 0 -1000 600 kind: pan, backend: revyl-device-proxy, durationMs: 600, 540,1900 → 540,900 scrolled to Connected devices / Apps

The iOS gestures took their frame from the snapshot. No window-origin-unknown appeared. Both sessions were disconnected afterwards.

On an earlier Android run of the first commit, the drag's duration was also the deciding factor on a dismissable system notification. A 300 px horizontal drag over 500 ms left the row in place. The same 300 px as gesture fling right (100 ms), or as an 80 ms pan, dismissed it.

Validation at 62182d1. pnpm check:affected --run ran the full set, because the lockfile changed. Every check passed up to affected-selector. Four tests in scripts/check-affected/execution.test.ts fail there, and they fail the same way on unchanged main (24f8181) on this Linux host, so they are environmental rather than caused by this change. The checks after it were run one by one, and all passed: gate-manifest, depgraph, tmpdir-leaks, coverage and wire-compat models, production-exports, bundle-owner-files, fixture-cache and fixture-fallback, command-docs, adr-citations, capabilities-matrix, doc-links, doc-prose, agent-guidance, xctest-selection, runner-error-codes, maestro-conformance and mutation:test. packaged-runner-swift needs macOS and was not run.

Screenshots (before and after each gesture)

iOS

before after swipe after fling down after 600 ms pan after split-view-left (refused)

Android

before after swipe after fling down after 600 ms pan

@thymikee

Copy link
Copy Markdown
Member

Thanks for the update. No code problems remain at d3dd944, and both blocking problems from the review of 40bff98 are fixed.

These threads no longer apply and can be resolved: the first because the Revyl capability cells are now qualified; the second because the test now asserts exactly one /drag; the third because the docs now describe one drag per --count repetition in the --pattern direction; the fourth because held pans never reach performGesture and plans with more than two samples are now refused; and the fifth because the docs now list the supported swipe presets and list the Split View presets as refused.

All checks at this commit pass or are skipped, so CI is green. Nothing else from this review needs to happen before merge.

Not verified here: no tests or device runs were done, so the fix and its test were judged by reading the code. The live evidence is author-reported, and the linked screenshots were not opened. It was not checked whether a Revyl drag from the left-edge or right-edge presets triggers an iOS system edge gesture, no live run covered these presets, and the docs promise only a drag. Maestro replay swipes on Revyl were not traced.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 27, 2026
@thymikee
thymikee merged commit 21f40e5 into callstack:main Nov 27, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants