Split view: drag the divider to resize the list pane, remembered per destination
A 12 px grab area over the divider line resizes the list live (mouse, touch, arrow keys; double tap resets to the default policy). The shell bar over the list follows. Widths persist per destination in SharedPreferences and clamp to the window without overwriting the saved value. Capture kit gains hover= and drag= steps.
This commit is contained in:
@@ -47,6 +47,8 @@ In JSON, a step can also set `wait` (ms), `timeout`, `name`, `ms` and `frames`.
|
||||
| `type=text` | type into the focused field (or the first visible one) |
|
||||
| `press=Enter` | press a key: Enter, Escape, Tab, Backspace, ArrowUp or ArrowDown |
|
||||
| `scroll=600` | scroll with the mouse wheel at the centre (JSON `at` sets a target, `dx` a horizontal delta, `repeat` and `gap` a run of ticks) |
|
||||
| `hover=<target>` | move the mouse onto the target without pressing (hover states) |
|
||||
| `drag=<target>>dx,dy` | press on the target, move by dx,dy in `steps` (12) moves `gap` (16) ms apart, release (JSON `dx`, `dy`, `steps`, `gap`; `hold: true` keeps the button down to capture mid-drag) |
|
||||
| `size=WxH` | resize without reloading |
|
||||
| `labels=name` | write the visible semantics labels, keys and rects to JSON |
|
||||
| `film=<target>` | screencast a click for `--film-ms` (900) and write the frames plus a contact sheet |
|
||||
|
||||
@@ -22,7 +22,8 @@ options: --script <steps.json> --size WxH (880x1000) --platform material|cuperti
|
||||
--params <query, e.g. chats=2&rich=1, added to every open>
|
||||
steps: open=<route>[@WxH] wait=<ms> shot=<name> click=<target> waitfor=<target>
|
||||
type=<text> press=<Enter|Escape|Tab|...> scroll=<dy> size=WxH
|
||||
film=<target> labels=<name> eval=<js> expect=<js>
|
||||
film=<target> labels=<name> eval=<js> expect=<js> hover=<target>
|
||||
drag=<target>><dx>,<dy> (JSON: drag, dx, dy, steps, gap, hold)
|
||||
target: <label> | label:<label> | key:<semantics identifier> | x,y`;
|
||||
|
||||
const opts = { wait: '1000', 'film-ms': '900' };
|
||||
@@ -118,6 +119,24 @@ try {
|
||||
await delay(step.wait ?? settle);
|
||||
break;
|
||||
}
|
||||
case 'hover': {
|
||||
const at = await page.hover(value, step.timeout);
|
||||
log(` mouse at ${Math.round(at.x)},${Math.round(at.y)}`);
|
||||
await delay(step.wait ?? settle);
|
||||
break;
|
||||
}
|
||||
case 'drag': {
|
||||
// CLI form: drag=<target>><dx>,<dy>; JSON may set dx/dy instead.
|
||||
const [target, by] = String(value).split('>');
|
||||
const [bx, by2] = (by ?? '').split(',').map(Number);
|
||||
const moved = await page.drag(target, {
|
||||
dx: Number(step.dx ?? bx ?? 0) || 0, dy: Number(step.dy ?? by2 ?? 0) || 0,
|
||||
steps: Number(step.steps ?? 12), gap: Number(step.gap ?? 16), hold: Boolean(step.hold),
|
||||
});
|
||||
log(` dragged ${Math.round(moved.from.x)},${Math.round(moved.from.y)} -> ${Math.round(moved.to.x)},${Math.round(moved.to.y)}`);
|
||||
await delay(step.wait ?? settle);
|
||||
break;
|
||||
}
|
||||
case 'eval': {
|
||||
const result = await page.evaluate(String(value));
|
||||
log(` = ${JSON.stringify(result)}`);
|
||||
|
||||
@@ -143,6 +143,29 @@ export function flutterPage(browser, log) {
|
||||
}
|
||||
return at;
|
||||
},
|
||||
/** Moves the mouse onto [target] without pressing (hover states, cursors). */
|
||||
async hover(target, timeout) {
|
||||
const at = await locate(target, timeout);
|
||||
await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: at.x, y: at.y });
|
||||
return at;
|
||||
},
|
||||
/**
|
||||
* Presses the mouse on [target], moves it by dx/dy in [steps] moves [gap] ms
|
||||
* apart, and releases it unless [hold] (to capture mid-drag; the next
|
||||
* mouse step or the end of the run releases it).
|
||||
*/
|
||||
async drag(target, { dx = 0, dy = 0, steps = 12, gap = 16, hold = false } = {}) {
|
||||
const at = await locate(target);
|
||||
const mouse = (type, x, y, extra = {}) => send('Input.dispatchMouseEvent', { type, x, y, button: 'left', ...extra });
|
||||
await mouse('mouseMoved', at.x, at.y, { button: 'none' });
|
||||
await mouse('mousePressed', at.x, at.y, { buttons: 1, clickCount: 1 });
|
||||
for (let i = 1; i <= steps; i++) {
|
||||
await delay(gap);
|
||||
await mouse('mouseMoved', at.x + (dx * i) / steps, at.y + (dy * i) / steps, { buttons: 1 });
|
||||
}
|
||||
if (!hold) await mouse('mouseReleased', at.x + dx, at.y + dy, { buttons: 0, clickCount: 1 });
|
||||
return { from: at, to: { x: at.x + dx, y: at.y + dy } };
|
||||
},
|
||||
evaluate,
|
||||
/** Screencasts [ms] after clicking [target]; frames are `{ data, ms }` relative to the click. */
|
||||
async film(target, ms) {
|
||||
|
||||
Reference in New Issue
Block a user