Ariver
2026-07-07 ae7fcc35862edb366ed7775d3dc7e93e53e59290
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
set -euo pipefail
 
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
APP_DIR="$ROOT_DIR/Apptag"
 
python3 - "$APP_DIR" <<'PY'
import sys
from pathlib import Path
 
app_dir = Path(sys.argv[1])
content = (app_dir / "ContentView.swift").read_text(encoding="utf-8")
library = (app_dir / "AppLibraryController.swift").read_text(encoding="utf-8")
 
required_library_tokens = [
    "private static var cachedSnapshot: AppLibrarySnapshot?",
    "static func lastSnapshot() -> AppLibrarySnapshot?",
    "private static func updateLastSnapshot(_ snapshot: AppLibrarySnapshot)",
    "updateLastSnapshot(snapshot)",
]
for token in required_library_tokens:
    if token not in library:
        raise SystemExit(f"AppLibraryController missing startup snapshot token: {token}")
 
required_content_tokens = [
    "@State private var loadingSpinnerVisible = false",
    "@State private var loadingSpinnerToken = 0",
    "private let loadingSpinnerDelay: TimeInterval = 0.25",
    "hydrateFromLastAppLibrarySnapshotIfNeeded()",
    "AppLibraryController.lastSnapshot()",
    "scheduleLoadingSpinnerIfNeeded()",
    "hideLoadingSpinner()",
    "if loadingSpinnerVisible",
]
for token in required_content_tokens:
    if token not in content:
        raise SystemExit(f"ContentView missing startup loading token: {token}")
 
if "if allApps.isEmpty {\n                Spacer()\n                ProgressView().scaleEffect(0.8)" in content:
    raise SystemExit("AppGrid empty state still shows ProgressView immediately")
 
if "if allApps.isEmpty {\n                    Spacer(); ProgressView().scaleEffect(0.8); Spacer()" in content:
    raise SystemExit("edit AppGrid empty state still shows ProgressView immediately")
 
print("PASS AppGrid startup loading QA: last snapshot reuse and delayed spinner are present")
PY