Run and interpret visual QA pipeline for EPUB XHTML files. Use when user asks about layout, screenshots, visual issues, or rendering problems in REBRANDED_OUTPUT.
Run the comprehensive visual QA pipeline to detect layout, typography, and rendering issues across all 44 chapter XHTML files in REBRANDED_OUTPUT/. Generate screenshots, analyze computed styles, and produce actionable reports.
python3 scripts/find_44_targets.py \
--opf REBRANDED_OUTPUT/content.opf \
--out docs/REBRANDED_VISUAL_AUDIT.json
What it does:
content.opf spine to extract exactly 44 chapter files in reading orderExpected output:
docs/REBRANDED_VISUAL_AUDIT.json with 44 entriespython3 scripts/visual_review.py \
--root REBRANDED_OUTPUT \
--targets docs/REBRANDED_VISUAL_AUDIT.json \
--screenshots-dir docs/screenshots \
--gallery docs/gallery/index.html
What it does:
768x1024 and 1080x1440Expected output:
docs/screenshots/{basename}/title_768x1024.png (and 1080x1440 variant)docs/screenshots/{basename}/worksheets_768x1024_p1.png (if applicable)docs/screenshots/{basename}/complex_768x1024_p1.png (if applicable)computed_style_samples, issues, screenshots arraysdocs/REBRANDED_VISUAL_AUDIT.md with 44-row summary tableAfter visual review completes:
Read the markdown summary:
cat docs/REBRANDED_VISUAL_AUDIT.md
Check for failures:
Inspect JSON for details:
jq '.files[] | select(.issues | length > 0)' docs/REBRANDED_VISUAL_AUDIT.json
View screenshots in gallery:
docs/gallery/index.html in browserSummarize findings for user:
User: "Can you check if the chapter layouts look good on tablets?"
Agent response:
Visual QA Complete: 44 chapters analyzed
- PASS: 41 chapters
- FAIL: 3 chapters (issues detected)
Common issues found:
1. Chapter IX: Heading hierarchy skip (h1 → h3 without h2) - Line 47
2. Chapter XV: Image overflow on 768px viewport - Line 203
3. Multiple chapters: Missing alt text on decorative images
Recommended fixes:
- Insert missing h2 in Chapter IX
- Add max-width: 100% to image styles
- Add alt="" role="presentation" to decorative images
View full report: docs/REBRANDED_VISUAL_AUDIT.md
Gallery: docs/gallery/index.html
Pair with:
css-diagnostics - After visual audit, analyze CSS coverage for unused rulespdf-parity-checker - Verify XHTML rendering matches POD PDFsepub-publication-validator - Run EPUBCheck after fixing visual issuesdocs/screenshots/ to regenerate