#!/usr/bin/env bash
# Parameterized transcript of the capture commands used on both sides.
# Start paired Android dev client, open Settings screen QA, scroll thread to top.
# Pixel 9, API 36, portrait 1080x2424, light system/app theme, default font scale.
# WebView image accessibility bounds were inaccurate, so inspected coordinates were used.
set -euo pipefail
session="$1"; out="$2"; side="$3"; surface="$4"
# surface inline: first image centered at (310,900).
# surface fullscreen: tap 'Open Settings screen QA' first; image center (310,680).
y=900
if [ "$surface" = fullscreen ]; then
  agent-device press 'label="Open Settings screen QA"' --session "$session" --settle
  y=680
fi
agent-device record start "$out/$side-$surface.mp4" --session "$session"
agent-device press 310 "$y" --session "$session" --settle
agent-device screenshot "$out/$side-$surface-a.png" --session "$session"
sleep 0.5
agent-device screenshot "$out/$side-$surface.png" --session "$session"
cmp "$out/$side-$surface-a.png" "$out/$side-$surface.png"
# Same final Back action: head closes image viewer; base navigates out of the page.
agent-device back --session "$session" --settle
agent-device record stop --session "$session"
# Supplement on head: reopen render and start another recording, tap (310,680),
# gesture pinch 2 540 1200, pinch 0.5 540 1200, swipe left, Back, stop recording.
