Repository Public
1#!/usr/bin/env bash2# Author: Simon-Pierre Boucher — contact@spboucher.ai3# File: Scripts/screenshots.sh4# Description: Takes the reference screenshots of SP Chat 2.0 (light + dark) from the Debug build running against the DEVELOPMENT backend, into docs/img/v2/.5#6# Usage: Scripts/screenshots.sh [name…] (no name: every screenshot; the Mac must show the app: real windows are captured)7# CONV conversation of the development database with a web-search answer (sources, follow-ups); default: the most recent one that has citations8# No model is called: every screen shows data already stored on the development backend.9set -euo pipefail10cd "$(dirname "$0")/.."11OUT="docs/img/v2"; mkdir -p "$OUT"12eval "$(Scripts/dev-session.sh)"13if [[ -z "${CONV:-}" ]]; then14 CONV="$(curl -fsS -H "Cookie: $SPCHAT_SESSION_COOKIE" "$SPCHAT_SERVER/api/conversations?limit=40" | /usr/bin/python3 -c '15import json, sys, urllib.request, os16cookie, server = os.environ["SPCHAT_SESSION_COOKIE"], os.environ["SPCHAT_SERVER"]17for c in json.load(sys.stdin)["conversations"]:18 r = urllib.request.Request(f"{server}/api/conversations/{c[\"id\"]}?all=1", headers={"Cookie": cookie})19 d = json.load(urllib.request.urlopen(r))20 if any(p.get("type") == "citation" for m in d["messages"] for p in m["parts"]) and len(d["messages"]) <= 4: print(c["id"]); break')"21fi22[[ -n "$CONV" ]] || { echo "ERROR: no conversation with sources on the development backend (send one with the web toggle first)" >&2; exit 1; }23export SPCHAT_SERVER SPCHAT_SESSION_COOKIE24shot() { # shot <name> <delay> <app arguments…>25 local name="$1" delay="$2"; shift 226 if [[ ${#WANTED[@]} -gt 0 ]] && ! printf '%s\n' "${WANTED[@]}" | grep -qx "$name"; then return; fi27 for mode in light dark; do28 Scripts/run-dev.sh --shot "$OUT/$name-$mode.png" "$delay" -SPChatAppearance "$mode" -SPChatWindow 1280x860 "$@" >/dev/null29 echo "$OUT/$name-$mode.png"30 done31}32WANTED=("$@")33shot chat-sources 8 -SPChatOpen "$CONV"34shot composer-commands 8 -SPChatOpen "$CONV" -SPChatDraft "/"35shot composer-mention 8 -SPChatOpen "$CONV" -SPChatDraft "Compare avec @claude" -SPChatWeb36# the two shots above typed a draft, which the app saved on the server like any draft: it is cleared again37curl -fsS -X PUT -H "Cookie: $SPCHAT_SESSION_COOKIE" -H "Origin: $SPCHAT_SERVER" -H "Content-Type: application/json" -d "{\"scope\":\"$CONV\",\"text\":\"\",\"attachmentIds\":[]}" "$SPCHAT_SERVER/api/drafts" >/dev/null38shot composer-new 739shot model-picker 9 -SPChatOpen "$CONV" -SPChatShowModelPicker40shot command-center 8 -SPChatOpen "$CONV" -SPChatPalette41shot explorer 8 -SPChatSection models42shot explorer-detail 10 -SPChatExplorerModel "or:google/gemini-4-neon"43shot arena 9 -SPChatArena latest44shot lens 9 -SPChatOpen "$CONV" -SPChatPanel lens -SPChatLens last45shot timeline 9 -SPChatOpen "$CONV" -SPChatPanel timeline46shot context 9 -SPChatOpen "$CONV" -SPChatPanel inspector47shot branches 9 -SPChatOpen "${BRANCH_CONV:-$CONV}" -SPChatPanel branches48shot usage 8 -SPChatSection usage49shot constellation 9 -SPChatSection constellation50shot providers 9 -SPChatSettings providers51pkill -f "$PWD/build/DerivedData/Build/Products/Debug/SP Chat.app/Contents/MacOS" 2>/dev/null || true52