Quick switch: a new request retargets the switch in flight instead of waiting
Peek taps, chords and programmatic activations during a mobile quick switch start the next switch at once from what is on screen. Swap styles continue from each card's current rect, pose, opacity and bar reveal; the tape takes a fresh picture of the frame above the incoming chat and continues its loop. The incoming chat keeps its speed and brakes once. The arriving peek takes pointers while it moves; leaving cards do not. The capture kit's film step gains a taps option for rapid-tap reviews. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -133,6 +133,8 @@ node tool/capture/capture.mjs --build build/probe-app --out /tmp/review/film \
|
||||
|
||||
In a JSON script, `{ "film": "Pipelines", "name": "tab-switch", "ms": 900,
|
||||
"frames": 6 }` sets the name, the duration and how many frames go on the sheet.
|
||||
`"taps": [{ "after": 180, "target": "280,960" }]` adds taps while the film runs,
|
||||
each `after` ms from the first and located when due (rapid-switch reviews).
|
||||
|
||||
Find targets: run `labels=now` after any step and read `NN-now.json`.
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ try {
|
||||
case 'film': {
|
||||
const what = String(value).startsWith('press:') ? String(value) : describe(parseTarget(value));
|
||||
const name = step.name ?? `film-${what.replace(/\W+/g, '-').replace(/^-|-$/g, '')}`;
|
||||
const frames = await page.film(value, Number(step.ms ?? opts['film-ms']));
|
||||
const frames = await page.film(value, Number(step.ms ?? opts['film-ms']), step.taps ?? []);
|
||||
const dir = join(out, name.replace(/[^\w.-]+/g, '_'));
|
||||
await mkdir(dir, { recursive: true });
|
||||
for (const [i, f] of frames.entries()) {
|
||||
|
||||
@@ -224,7 +224,7 @@ export function flutterPage(browser, log, { touch = false, semantics = true, use
|
||||
pinch: async (target, scale) => pinch(send, await locate(target), scale),
|
||||
evaluate,
|
||||
/** Screencasts [ms] after clicking [target]; frames are `{ data, ms }` relative to the click. */
|
||||
async film(target, ms) {
|
||||
async film(target, ms, taps = []) {
|
||||
// Contact sheets use a scratch tab. Restore this target's compositor
|
||||
// viewport before another screencast, otherwise Chrome can crop frames.
|
||||
await send('Page.bringToFront');
|
||||
@@ -243,7 +243,13 @@ export function flutterPage(browser, log, { touch = false, semantics = true, use
|
||||
const clickAt = Date.now() / 1000;
|
||||
if (chord) await this.press(chord);
|
||||
else await tap(point);
|
||||
await delay(ms);
|
||||
// Further taps while the first transition runs, each `after` ms from
|
||||
// the first and located when due (rapid-switch reviews).
|
||||
for (const next of taps) {
|
||||
await delay(Math.max(0, clickAt * 1000 + Number(next.after) - Date.now()));
|
||||
await tap(await locate(next.target));
|
||||
}
|
||||
await delay(Math.max(0, clickAt * 1000 + ms - Date.now()));
|
||||
await send('Page.stopScreencast');
|
||||
await delay(100);
|
||||
off();
|
||||
|
||||
Reference in New Issue
Block a user