#!/usr/bin/env bash
# Replay from the model picker, Pixel 9 at 1080x2424, light theme.
# Setup: start each commit's isolated server/Metro, run proof-seed.ts with its home and port,
# install through mobile:install, pair, open Model filter proof and its model picker.
set -euo pipefail
side="$1"
session="$2"
out="$3"
press() { agent-device press "$@" --session "$session"; }
agent-device record start "$out/$side.mp4" --hide-touches --session "$session"
press 846 137
if [[ "$side" == before ]]; then
  press 581 368 # Provider
  press 581 536 # Favorites
else
  press 581 368 # Favorites only
fi
agent-device snapshot -i --session "$session"
press 846 137
if [[ "$side" == before ]]; then
  press 581 368 # Provider
  press 581 662 # Codex
else
  press 581 494 # Provider
  press 581 536 # Codex
fi
agent-device snapshot -i --session "$session"
agent-device screenshot "$out/$side-list.png" --session "$session"
if [[ "$side" == after ]]; then
  press 846 137
  press 581 368 # Disable Favorites only
  agent-device snapshot -i --session "$session"
  agent-device screenshot "$out/after-disabled.png" --session "$session"
fi
agent-device record stop --session "$session"
