@devries-cameron20 / t3code-1 / commits / 911091ba7e
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

chore(mobile): e2e poses for current devices, Duo and landscape fixes

Poses now cover iPhone SE, iPhone 18 Pro, iPhone Duo folded and unfolded, iPad Pro 13" in both orientations, Pixel 10 Pro, Pixel 10 Pro Fold folded, unfolded and unfolded landscape, and Pixel Tablet in both orientations. Landscape poses rotate once the app is up (a rotation during launch is lost) and check that the screen really is wider than tall. Taps fall back to the element's centre when agent-device refuses a covered ref, and a gateway whose workers briefly reconnect is retried. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 26, 2026 at 03:02 UTC 911091ba7efc9e97128ec1f6243f3935df2d1474
3 files changed +55 -34
scripts/mobile-e2e/device.ts
+1 -2
@@ -65,7 +65,7 @@ export class AgentDeviceError extends Error {}
65
66 // A shared pool's workers drop off the gateway and stall under load for seconds at a time.
67 const TRANSIENT =
68 - /Remote daemon is unavailable|not connected to the gateway|still finishing a previous command|Invalid daemon response|Daemon request timed out/i;
68 + /Remote daemon is unavailable|not connected to the gateway|still finishing a previous command|Invalid daemon response|Daemon request timed out|no worker connected/i;
69
70 export class Device {
71 readonly pose: Pose;
@@ -172,7 +172,6 @@ export class Device {
172 { timeoutMs: 180_000 },
173 );
174 await this.acceptOpenPrompt();
175 - if (this.pose.landscape) await this.agent(["orientation", "landscape-left"]);
175 }
176
177 async openUrl(url: string) {
scripts/mobile-e2e/journey.ts
+22 -4
@@ -71,9 +71,19 @@ export async function runJourney(
71 steps: StepResult[],
72 ): Promise<void> {
73 const phone = device.pose.form === "phone";
74 - const tap = (node: SnapshotNode | undefined, label: string) => {
75 - if (!node?.ref) throw new Error(`no ${label} to tap`);
76 - return device.agent(["press", `@${node.ref}`]);
74 + const tap = async (node: SnapshotNode | undefined, label: string) => {
75 + if (!node?.ref || !node.rect) throw new Error(`no ${label} to tap`);
76 + // agent-device refuses refs it considers covered, such as on the unfolded Duo's inner
77 + // display; the element's centre still takes the tap.
78 + await device
79 + .agent(["press", `@${node.ref}`])
80 + .catch(() =>
81 + device.agent([
82 + "press",
83 + String(Math.round(node.rect!.x + node.rect!.width / 2)),
84 + String(Math.round(node.rect!.y + node.rect!.height / 2)),
85 + ]),
86 + );
87 };
88
89 /** Screenshot and check the settled screen, and record it as a step. */
@@ -126,10 +136,18 @@ export async function runJourney(
136 .catch(() => null);
137 }
138 if (!threads) throw new Error("the app did not show the fixture threads after pairing");
129 - await delay(1_000);
139 + // Rotated only once the app is up: a rotation during launch is lost.
140 + if (device.pose.landscape) await device.agent(["orientation", "landscape-left"]);
141 + await delay(device.pose.landscape ? 2_000 : 1_000);
142 threads = await device.snapshot();
143 const tabs = tabBarRect(threads);
144 + const wide = threads.viewport.width > threads.viewport.height;
145 await capture("threads", threads, [
146 + check(
147 + device.pose.landscape ? "in landscape" : "in portrait",
148 + wide === Boolean(device.pose.landscape),
149 + `${Math.round(threads.viewport.width)}×${Math.round(threads.viewport.height)}`,
150 + ),
151 check("thread list visible", threadRow(threads) !== undefined, "fixture threads"),
152 ...(phone ? [check("tab bar visible", inside(tabs, threads), describeRect(tabs))] : []),
153 ]);
scripts/mobile-e2e/poses.ts
+32 -28
@@ -5,7 +5,7 @@ export interface Pose {
5 readonly device: string;
6 readonly form: "phone" | "tablet";
7 readonly appearance: "light" | "dark";
8 - /** Phones are portrait-only; tablets also run rotated. */
8 + /** Phones are portrait-locked; tablets and an unfolded Fold can start rotated. */
9 readonly landscape?: boolean;
10 readonly fold?: "closed" | "open";
11 readonly textSize?: "accessibility-large";
@@ -22,79 +22,83 @@ export const POSES: ReadonlyArray<Pose> = [
22 appearance: "light",
23 }),
24 pose({
25 - id: "iphone-13-mini-dark",
25 + id: "iphone-18-pro-dark",
26 platform: "ios",
27 - device: "iPhone 13 mini",
27 + device: "iPhone 18 Pro",
28 form: "phone",
29 appearance: "dark",
30 }),
31 pose({
32 - id: "iphone-17-pro",
32 + id: "iphone-duo-folded",
33 platform: "ios",
34 - device: "iPhone 17 Pro",
34 + device: "iPhone Duo",
35 form: "phone",
36 appearance: "light",
37 + fold: "closed",
38 }),
39 pose({
39 - id: "iphone-17-pro-max-large-text",
40 + id: "iphone-duo-unfolded",
41 platform: "ios",
41 - device: "iPhone 17 Pro Max",
42 - form: "phone",
42 + device: "iPhone Duo",
43 + form: "tablet",
44 appearance: "dark",
44 - textSize: "accessibility-large",
45 + fold: "open",
46 }),
47 pose({
47 - id: "ipad-mini",
48 + id: "ipad-13-portrait",
49 platform: "ios",
49 - device: "iPad mini (A17 Pro)",
50 + device: "iPad Pro 13-inch (M5)",
51 form: "tablet",
52 appearance: "light",
53 }),
54 pose({
54 - id: "ipad-pro-13-landscape",
55 + id: "ipad-13-landscape-large-text",
56 platform: "ios",
57 device: "iPad Pro 13-inch (M5)",
58 form: "tablet",
59 appearance: "dark",
60 landscape: true,
61 + textSize: "accessibility-large",
62 }),
63 pose({
62 - id: "pixel-9",
64 + id: "pixel-10-pro-large-text",
65 platform: "android",
64 - device: "Pixel 9",
66 + device: "Pixel 10 Pro",
67 form: "phone",
68 appearance: "light",
69 + textSize: "accessibility-large",
70 }),
71 pose({
69 - id: "small-phone-dark",
72 + id: "pixel-fold-folded-dark",
73 platform: "android",
71 - device: "Small Phone",
74 + device: "Pixel 10 Pro Fold",
75 form: "phone",
76 appearance: "dark",
77 + fold: "closed",
78 }),
79 pose({
76 - id: "pixel-9-large-text",
80 + id: "pixel-fold-unfolded",
81 platform: "android",
78 - device: "Pixel 9",
79 - form: "phone",
82 + device: "Pixel 10 Pro Fold",
83 + form: "tablet",
84 appearance: "light",
81 - textSize: "accessibility-large",
85 + fold: "open",
86 }),
87 pose({
84 - id: "pixel-fold-closed",
88 + id: "pixel-fold-unfolded-landscape",
89 platform: "android",
86 - device: "Pixel 9 Pro Fold",
87 - form: "phone",
88 - appearance: "light",
89 - fold: "closed",
90 + device: "Pixel 10 Pro Fold",
91 + form: "tablet",
92 + appearance: "dark",
93 + fold: "open",
94 + landscape: true,
95 }),
96 pose({
92 - id: "pixel-fold-open",
97 + id: "pixel-tablet-portrait",
98 platform: "android",
94 - device: "Pixel 9 Pro Fold",
99 + device: "Pixel Tablet",
100 form: "tablet",
101 appearance: "dark",
97 - fold: "open",
102 }),
103 pose({
104 id: "pixel-tablet-landscape",