round 4: app-shell quiz screen at <=700px — #step-body is the only scroller, #btn-next/#panel become the static bottom cluster; revert FR .opt override (keep 972f3a7); + capture/verify/pixdiff/offlan audit tooling and before/after evidence; closes QUIZ-APPSHELL-FIX.md
This commit is contained in:
1 parent
972f3a7caa
commit
7697639fb8
84 files changed
+10743
-4
No files matched your search
@@ -0,0 +1,40 @@
|
||||
"""Pixel-diff two screenshot dirs (matching filenames). Usage:
|
||||
python3 audit/appshell_pixdiff.py DIR_A DIR_B [label_a label_b]
|
||||
Prints per-file diff pixel counts + max channel delta; PIXDIFF-ZERO if every shared
|
||||
file matches bit-for-bit. Also flags size mismatches."""
|
||||
import os, sys
|
||||
from PIL import Image, ImageChops
|
||||
|
||||
A, B = sys.argv[1], sys.argv[2]
|
||||
la, lb = (sys.argv[3:5] or ['A', 'B'])
|
||||
fa = sorted(f for f in os.listdir(A) if f.endswith('.png'))
|
||||
fb = sorted(f for f in os.listdir(B) if f.endswith('.png'))
|
||||
missing = set(fa) - set(fb)
|
||||
if missing:
|
||||
print('FILES MISSING IN', lb, ':', sorted(missing))
|
||||
zero, n = True, 0
|
||||
for f in fa:
|
||||
if f not in fb:
|
||||
continue
|
||||
n += 1
|
||||
ia, ib = Image.open(os.path.join(A, f)), Image.open(os.path.join(B, f))
|
||||
if ia.size != ib.size:
|
||||
print(f'{f}: SIZE DIFF {ia.size} vs {ib.size}')
|
||||
zero = False
|
||||
continue
|
||||
d = ImageChops.difference(ia.convert('RGB'), ib.convert('RGB'))
|
||||
bbox = d.getbbox()
|
||||
if bbox is None:
|
||||
print(f'{f}: 0 px diff (identical)')
|
||||
else:
|
||||
hist = d.convert('L').histogram()
|
||||
ndiff = sum(hist[1:])
|
||||
mx = max(i for i, c in enumerate(hist) if c)
|
||||
pct = ndiff / (ia.size[0] * ia.size[1]) * 100
|
||||
print(f'{f}: {ndiff} px diff ({pct:.4f}%), bbox {bbox}, maxdelta {mx}')
|
||||
zero = False
|
||||
if n == 0:
|
||||
print('no shared files!')
|
||||
zero = False
|
||||
print('PIXTDIFF-ZERO' if zero else 'PIXTDIFF-NONZERO')
|
||||
sys.exit(0 if zero else 1)
|
||||
Reference in new issue
Block a user