#!/usr/bin/env bash
set -euo pipefail
# Run with the seeded Showcase thread open and the keyboard hidden.
# iPhone 18 Pro, iOS 27.2, portrait 402x874, light appearance.
session="$1"
out="$2"
mkdir -p "$out"
ad() { agent-device "$@" --session "$session"; }
ad record start "$out/interaction.mp4"
ad press 'label="Ask anything"'
ad keyboard status
ad press 'label="This turn is a replay. It costs nothing, so send it again as often as you need."'
ad keyboard status
ad press 'label="Ask anything"'
ad keyboard status
# AX exposes whole table rows; the plain result cell is at (190,282).
ad press 190 282
ad keyboard status
ad screenshot "$out/after-table-tap-1.png" --normalize-status-bar
sleep 0.5
ad screenshot "$out/after-table-tap-2.png" --normalize-status-bar
ad press 'label="Ask anything"'
ad press 47 248
ad keyboard status
ad press 'label="Ask anything"'
ad press 47 350
ad keyboard status
ad press 'label="This turn is a replay. It costs nothing, so send it again as often as you need."'
ad keyboard status
ad record stop
