From 658284d0b7f493d405aead3c0d4d5e1cb45686e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 19 Nov 2026 14:43:13 +0100 Subject: [PATCH 1/2] docs(gestures): make swipe/gesture/longpress discoverable and honest in MCP metadata An MCP client that defers tool schemas finds tools by keyword search over name, description, and searchHint. Three gesture entries misled that search: - swipe carried searchHint "drag gesture", but a swipe is a quick coordinate fling with no hold, so drag-to-reorder via swipe fails. The hint is now "flick slide carousel page" and the description states the contact starts moving immediately with no pause. - gesture carried "multi-touch zoom", hiding that gesture drag exists and holds its source down first (DEFAULT_DRAG_SOURCE_HOLD_MS = 800). The hint gains "reorder move row" and the MCP description now says a drag holds the source for 800 ms by default before carrying it over. - longpress hint was just "long press"; it now also carries home screen icon widget app task words. - help gestures had no line for drag-to-reorder; it now shows "gesture drag @e12 @e40" plus the hold-first semantics. Text and metadata only; no behavior change, no change to the always-loaded 'loop' tier (always-loaded tools/list stays at 22400 of 22528 bytes). Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- packages/command-surface/src/interaction/index.ts | 10 +++++----- packages/command-surface/src/interaction/metadata.ts | 5 +++-- src/commands/schema/cli-help-gestures.ts | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/command-surface/src/interaction/index.ts b/packages/command-surface/src/interaction/index.ts index d6d31713f5..2c27f76e4b 100644 --- a/packages/command-surface/src/interaction/index.ts +++ b/packages/command-surface/src/interaction/index.ts @@ -528,7 +528,7 @@ const longPressCommandFacet = defineCommandFacet({ effect: 'destructive', text: { summary: 'Hold a UI target to open a context menu', - searchHint: 'long press', + searchHint: 'long press home screen icon widget app', cliDetail: 'Duration is positional, for example longpress @e12 800 or longpress 300 500 800.', }, metadata: metadata('longpress'), @@ -559,9 +559,9 @@ const swipeCommandFacet = defineCommandFacet({ effect: 'write', text: { summary: 'Fling between coordinates', - searchHint: 'drag gesture', + searchHint: 'flick slide carousel page', cliDetail: - 'The first read after a swipe waits for two captures to agree. --no-post-gesture-stabilization skips that wait for a caller whose own polling verifies the screen.', + 'A swipe never pauses on the start point, so it does not engage a hold-to-reorder handle -- use gesture drag @src @dst for a held move. The first read after a swipe waits for two captures to agree. --no-post-gesture-stabilization skips that wait for a caller whose own polling verifies the screen.', }, metadata: metadata('swipe'), run: (client, input) => client.interactions.swipe(input as SwipeOptions), @@ -661,9 +661,9 @@ const gestureCommandFacet = defineCommandFacet({ effect: 'destructive', text: { summary: 'Run pan, fling, swipe, pinch, rotate, transform, tap, or drag gestures', - searchHint: 'multi-touch zoom', + searchHint: 'multi-touch zoom reorder move row', cliDetail: - 'Argument shapes: pan [durationMs], fling [distance], swipe , pinch [x] [y], rotate [x] [y], transform [durationMs], tap [... ] [--hold-ms ] [--count ] [--pause-ms ], or drag [sourceHoldMs] [moveMs] [destinationHoldMs]. For command plans, output only command lines. Android transform verification should use all app-observable effects, for example wait text "pan changed yes", wait text "pinch changed yes", and wait text "rotate changed yes", not exact transform values. gesture swipe accepts --no-post-gesture-stabilization to skip the stabilization wait before the next read, for a caller whose own polling verifies the screen.', + 'Argument shapes: pan [durationMs], fling [distance], swipe , pinch [x] [y], rotate [x] [y], transform [durationMs], tap [... ] [--hold-ms ] [--count ] [--pause-ms ], or drag [sourceHoldMs] [moveMs] [destinationHoldMs]; drag holds the source down first (800 ms by default) before moving, which is what engages a reorder handle. For command plans, output only command lines. Android transform verification should use all app-observable effects, for example wait text "pan changed yes", wait text "pinch changed yes", and wait text "rotate changed yes", not exact transform values. gesture swipe accepts --no-post-gesture-stabilization to skip the stabilization wait before the next read, for a caller whose own polling verifies the screen.', }, metadata: metadata('gesture'), run: (client, input) => diff --git a/packages/command-surface/src/interaction/metadata.ts b/packages/command-surface/src/interaction/metadata.ts index f6c4471845..b9a869e3eb 100644 --- a/packages/command-surface/src/interaction/metadata.ts +++ b/packages/command-surface/src/interaction/metadata.ts @@ -73,7 +73,8 @@ const interactionCommandDescriptions = { 'Hold a UI target by snapshot ref, selector, or coordinates to open a context menu or perform another hold gesture. The durationMs input overrides the default hold duration.', hover: 'Move the pointer over a UI target by snapshot ref, selector, or coordinates without pressing, to reveal hover-gated UI such as row toolbars or menus. Web only; touch platforms have no hover state. The settle option returns the UI diff revealed by the hover.', - swipe: 'Quick coordinate fling with optional repeat pattern.', + swipe: + 'Quick coordinate fling with optional repeat pattern; the contact starts moving immediately, with no pause on the start point.', focus: 'Move input focus to explicit screen coordinates without entering text. This command changes focus only and does not enter or replace text.', type: 'Append text to the currently focused input. This requires an active input and preserves its existing text.', @@ -83,7 +84,7 @@ const interactionCommandDescriptions = { is: 'Check whether a selector satisfies a UI predicate such as visible, hidden, exists, absent, editable, selected, focused, or text. `absent` passes only when one readable, complete, settled, unscoped, full-depth accessibility capture has zero matches. This command checks the current condition without polling.', find: 'Find by text/label/value/role/id and run action; the action defaults to click. The role locator matches snapshot kind vocabulary (button, text, text-field, switch, ...); pre-reconciliation leaf spellings (statictext, edittext, textview) stay accepted on the nodes that carried them during a deprecation window. The focus and type actions aim at a text field: the match or the field holding it, even beside other fields, or else the one enabled on-screen field inside the match. Several enabled on-screen fields inside the match refuse with AMBIGUOUS_MATCH and the field candidates, and a disabled target refuses with reason target_disabled. Web text boxes are not recognized as text fields.', gesture: - 'Perform a structured pan, fling, swipe, pinch, rotate, transform, tap, or drag gesture. Each gesture kind has its own inputs. A tap touches 2 to 5 points at once; count and pauseMs control repetition.', + 'Perform a structured pan, fling, swipe, pinch, rotate, transform, tap, or drag gesture. Each gesture kind has its own inputs. A tap touches 2 to 5 points at once; count and pauseMs control repetition. A drag takes a source and a destination ref or selector and holds the source down for 800 ms by default before carrying it over, which is how a list item changes position or a drop target is hit.', } as const; type InteractionCommandName = keyof typeof interactionCommandDescriptions; diff --git a/src/commands/schema/cli-help-gestures.ts b/src/commands/schema/cli-help-gestures.ts index e6806a88a0..584f4ac516 100644 --- a/src/commands/schema/cli-help-gestures.ts +++ b/src/commands/schema/cli-help-gestures.ts @@ -35,6 +35,7 @@ Platform quirks: tvOS coordinate pan and fling preserve only the dominant direction as a remote swipe; authored endpoints and duration are not preserved. Gesture planning prefers the active-app frame; a backend without a gesture viewport resolver falls back to the visible snapshot union, which can be less accurate near edges. Rare iOS accessibility gap: a row shown disabled/hittable:false where press reports success but no UI change, or a collapsed composite control with no child refs -- run snapshot -i --json, compute the target center from rects, press x y, then diff snapshot -i. Coordinates are fallback-only; document why you used them. + Drag-to-reorder and drop targets: agent-device gesture drag @e12 @e40 moves one element onto another. It holds the source down first (800 ms by default; override with the positional sourceHoldMs), then moves (500 ms default) and releases at the destination. Swipe and fling never pause on the start point, so they do not engage a reorder handle. Endpoints are @refs or selectors, resolved before dispatch. On mobile, after scroll, swipe, or gesture swipe, the next read waits for two captures to agree; web and desktop targets do not wait. A caller whose own polling verifies the screen adds --no-post-gesture-stabilization to skip that wait; a directional scroll then also skips its movement check. macOS: From d61e2f072264a606cec6acc87c3d5301f3080a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 19 Nov 2026 15:16:14 +0100 Subject: [PATCH 2/2] docs(gestures): tighten hints and the drag help line Co-Authored-By: Claude Opus 5.5 --- packages/command-surface/src/interaction/index.ts | 4 ++-- src/commands/schema/cli-help-gestures.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/command-surface/src/interaction/index.ts b/packages/command-surface/src/interaction/index.ts index 2c27f76e4b..b7ef5c7f9f 100644 --- a/packages/command-surface/src/interaction/index.ts +++ b/packages/command-surface/src/interaction/index.ts @@ -528,7 +528,7 @@ const longPressCommandFacet = defineCommandFacet({ effect: 'destructive', text: { summary: 'Hold a UI target to open a context menu', - searchHint: 'long press home screen icon widget app', + searchHint: 'long press', cliDetail: 'Duration is positional, for example longpress @e12 800 or longpress 300 500 800.', }, metadata: metadata('longpress'), @@ -661,7 +661,7 @@ const gestureCommandFacet = defineCommandFacet({ effect: 'destructive', text: { summary: 'Run pan, fling, swipe, pinch, rotate, transform, tap, or drag gestures', - searchHint: 'multi-touch zoom reorder move row', + searchHint: 'reorder zoom multi-touch', cliDetail: 'Argument shapes: pan [durationMs], fling [distance], swipe , pinch [x] [y], rotate [x] [y], transform [durationMs], tap [... ] [--hold-ms ] [--count ] [--pause-ms ], or drag [sourceHoldMs] [moveMs] [destinationHoldMs]; drag holds the source down first (800 ms by default) before moving, which is what engages a reorder handle. For command plans, output only command lines. Android transform verification should use all app-observable effects, for example wait text "pan changed yes", wait text "pinch changed yes", and wait text "rotate changed yes", not exact transform values. gesture swipe accepts --no-post-gesture-stabilization to skip the stabilization wait before the next read, for a caller whose own polling verifies the screen.', }, diff --git a/src/commands/schema/cli-help-gestures.ts b/src/commands/schema/cli-help-gestures.ts index 584f4ac516..aec512c492 100644 --- a/src/commands/schema/cli-help-gestures.ts +++ b/src/commands/schema/cli-help-gestures.ts @@ -35,7 +35,7 @@ Platform quirks: tvOS coordinate pan and fling preserve only the dominant direction as a remote swipe; authored endpoints and duration are not preserved. Gesture planning prefers the active-app frame; a backend without a gesture viewport resolver falls back to the visible snapshot union, which can be less accurate near edges. Rare iOS accessibility gap: a row shown disabled/hittable:false where press reports success but no UI change, or a collapsed composite control with no child refs -- run snapshot -i --json, compute the target center from rects, press x y, then diff snapshot -i. Coordinates are fallback-only; document why you used them. - Drag-to-reorder and drop targets: agent-device gesture drag @e12 @e40 moves one element onto another. It holds the source down first (800 ms by default; override with the positional sourceHoldMs), then moves (500 ms default) and releases at the destination. Swipe and fling never pause on the start point, so they do not engage a reorder handle. Endpoints are @refs or selectors, resolved before dispatch. + Drag to reorder or drop: gesture drag @e12 @e40 holds the source (800 ms by default; positional sourceHoldMs overrides it), moves, and releases on the destination. swipe and fling never hold, so they do not start a reorder. On mobile, after scroll, swipe, or gesture swipe, the next read waits for two captures to agree; web and desktop targets do not wait. A caller whose own polling verifies the screen adds --no-post-gesture-stabilization to skip that wait; a directional scroll then also skips its movement check. macOS: