Date: 2026-01-17 Status: Ready for Production Implementation
This guide provides step-by-step instructions for implementing the enhanced screenshot pipeline that systematically displays ALL openadapt-viewer functionality.
- ✅
SCREENSHOT_PIPELINE_AUDIT.md- Comprehensive gap analysis and enhancement plan - ✅
SCREENSHOT_IMPLEMENTATION_GUIDE.md- This file - ✅
scripts/generate_comprehensive_screenshots.py- Enhanced screenshot generation script
- ✅
/Users/abrichr/oa/src/openadapt-capture/turn-off-nightshift/episodes.json- Episode data for segmentation viewer
Goal: Install dependencies and verify tools work
cd /Users/abrichr/oa/src/openadapt-viewer
# Install playwright for screenshots
uv pip install ".[screenshots]"
# Install chromium browser
uv run playwright install chromium
# Verify installation
python scripts/generate_comprehensive_screenshots.py --check-deps
# Expected output:
# Dependency Status:
# playwright: ✓ AvailableGoal: Regenerate existing screenshots plus episode-aware ones
# Generate HTML viewers from captures
python scripts/generate_readme_screenshots.py \
--capture-dir ../openadapt-capture \
--output-dir docs/images \
--skip-screenshots
# This creates:
# - temp/turn-off-nightshift_viewer.html
# - temp/demo_new_viewer.html# Generate all capture viewer screenshots
python scripts/generate_comprehensive_screenshots.py \
--viewers capture \
--output-dir docs/images
# Expected output:
# CAPTURE VIEWER
# HTML: temp/turn-off-nightshift_viewer.html
# Scenarios: 3
# [full] Complete viewer interface with all panels
# Viewport: 1400x900
# Saved: turn-off-nightshift_full.png (159 KB)
# [controls] Playback controls and timeline focus
# ...
# [events] Event list and details panel
# ...Result: 6 screenshots (3 per capture)
Goal: Demonstrate episode browsing and selection
# Check that episodes.json was copied
ls -lh ../openadapt-capture/turn-off-nightshift/episodes.json
# Should show ~3KB file# Open in browser to test
open segmentation_viewer.html
# Test:
# 1. Load episode JSON file via file input
# 2. Verify episodes appear
# 3. Click an episode to see details
# 4. Try search functionality
# 5. Try recording filterpython scripts/generate_comprehensive_screenshots.py \
--viewers segmentation \
--output-dir docs/images
# Expected: 5 screenshots showing:
# - Overview with episode list
# - Selected episode with key frames
# - Search filtering episodes
# - Recording filter dropdown
# - Key frames galleryResult: 5 new segmentation viewer screenshots
Goal: Showcase synthetic WAA demo library
# Open in browser
open synthetic_demo_viewer.html
# Test:
# 1. Verify 82 demos load
# 2. Filter by domain (notepad, paint, etc.)
# 3. Select a demo to view steps
# 4. Check prompt panel shows API usage
# 5. Scroll to impact comparison sectionpython scripts/generate_comprehensive_screenshots.py \
--viewers synthetic \
--output-dir docs/images
# Expected: 5 screenshots showing:
# - Demo library overview
# - Domain filter applied
# - Selected demo with syntax highlighting
# - API prompt panel
# - Impact comparison (33% → 100%)Result: 5 new synthetic demo viewer screenshots
Goal: Visualize benchmark evaluation results
# Look for benchmark data
ls -lh benchmark_results/
# If empty, generate mock data:
cd ../openadapt-evals
uv run python -m openadapt_evals.benchmarks.cli test-collection --tasks 5
cd ../openadapt-viewer# Generate viewer from mock data
# (This command may need to be adapted based on actual benchmark structure)
python -c "
from openadapt_viewer.viewers.benchmark import generate_benchmark_html
generate_benchmark_html(
data_path='../openadapt-evals/benchmark_results/run_001',
output_path='benchmark_viewer_generated.html'
)
"python scripts/generate_comprehensive_screenshots.py \
--viewers benchmark \
--output-dir docs/images
# Expected: 4 screenshots showing:
# - Summary metrics
# - Task list with filters
# - Task detail replay
# - Domain breakdownResult: 4 new benchmark viewer screenshots
Goal: Comprehensive visual documentation
cp README.md README.md.backupThe README should be updated with sections for:
-
Capture Playback Viewer (expand existing)
- Add episode timeline screenshot
- Add episode context screenshot
-
Segmentation Viewer (NEW)
- Episode library overview
- Episode detail view
- Search in action
- Filter dropdown
- Integration with capture viewer
-
Synthetic Demo Viewer (expand existing)
- Add detailed screenshots
- Show domain filtering
- Show prompt usage
- Show impact comparison
-
Benchmark Viewer (NEW)
- Summary dashboard
- Task list
- Task replay
- Domain breakdown
See SCREENSHOT_PIPELINE_AUDIT.md § Phase 6 for complete markdown template.
# Install markdown viewer (if not already installed)
# pip install grip
# Or just open in GitHub-compatible viewer
open README.mdGoal: Automated regeneration on changes
Edit .github/workflows/screenshots.yml:
# Add after existing screenshot generation step
- name: Generate comprehensive screenshots
working-directory: openadapt-viewer
run: |
source ../.venv/bin/activate
# Generate all viewer screenshots
python scripts/generate_comprehensive_screenshots.py \
--viewers all \
--output-dir docs/images
echo "📸 All screenshots generated:"
ls -lh docs/images/*.png# Test GitHub Action locally with act
act push -j generate-screenshots
# Or just commit and push to trigger CIgit add -A
git commit -m "feat: comprehensive screenshot pipeline
- Add enhanced screenshot generation script
- Generate screenshots for all viewers (capture, segmentation, synthetic, benchmark)
- Update README with comprehensive visual documentation
- Add episode data integration for segmentation viewer
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>"
git pushBefore considering implementation complete, verify:
-
turn-off-nightshift_full.png(capture viewer) -
turn-off-nightshift_controls.png -
turn-off-nightshift_events.png -
demo_new_full.png -
demo_new_controls.png -
demo_new_events.png -
segmentation_overview.png(segmentation viewer) -
segmentation_episode_detail.png -
segmentation_search_active.png -
segmentation_recording_filter.png -
segmentation_key_frames.png -
synthetic_overview.png(synthetic demo viewer) -
synthetic_domain_filter.png -
synthetic_demo_detail.png -
synthetic_prompt_panel.png -
synthetic_impact_section.png -
benchmark_summary.png(benchmark viewer) -
benchmark_task_list.png -
benchmark_task_detail.png -
benchmark_domain_breakdown.png
Total expected: 20 screenshots (6 capture + 5 segmentation + 5 synthetic + 4 benchmark)
- All screenshots referenced in README exist
- Captions are descriptive and accurate
- Image paths are correct (docs/images/*.png)
- New viewer sections added (Segmentation, Benchmark)
- Existing sections enhanced (Synthetic Demo)
- SCREENSHOT_PIPELINE_AUDIT.md exists
- SCREENSHOT_IMPLEMENTATION_GUIDE.md exists (this file)
- scripts/generate_comprehensive_screenshots.py documented with --help
- CI workflow updated to generate all screenshots
- segmentation_viewer.html loads episode data
- Search works in segmentation viewer
- Filter dropdown works
- Episode selection shows details
- Synthetic demo viewer loads 82 demos
- Domain filters work
- Benchmark viewer shows task data (if available)
Problem: playwright not available
Solution:
uv pip install playwright
uv run playwright install chromiumProblem: Screenshots are blank/white
Solution: Increase wait times in script:
# In ScreenshotConfig
wait_after_load=2000, # Increase from 1000ms
wait_after_interact=1000, # Increase from 500msProblem: segmentation_viewer.html shows "No episodes loaded"
Solution: Verify episode JSON exists:
cat ../openadapt-capture/turn-off-nightshift/episodes.jsonShould contain:
{
"recording_id": "turn-off-nightshift",
"episodes": [
{ "episode_id": "episode_001", ... },
{ "episode_id": "episode_002", ... }
]
}If empty, copy test data:
cp test_episodes.json ../openadapt-capture/turn-off-nightshift/episodes.jsonProblem: Screenshots are too large (> 300 KB each)
Solution: Reduce viewport or enable compression:
# In ScreenshotConfig
viewport_width=1200, # Reduce from 1400
viewport_height=800, # Reduce from 900
# Or in page.screenshot() call:
page.screenshot(path=str(output_path), quality=80, type='jpeg')Problem: interact function fails with element not found
Solution: Add null checks:
interact=lambda page: (
page.click('.episode-item')
if page.query_selector('.episode-item')
else print("Warning: .episode-item not found")
)For faster generation, use multiprocessing:
from multiprocessing import Pool
def generate_screenshot_worker(args):
html_path, output_path, config = args
return generate_screenshot(html_path, output_path, config)
# In main():
with Pool(processes=4) as pool:
tasks = [(html, output, config) for config in scenarios]
screenshots = pool.map(generate_screenshot_worker, tasks)# In generate_screenshot():
browser = p.chromium.launch(
headless=True, # Ensure headless mode
args=[
'--disable-gpu',
'--no-sandbox',
'--disable-dev-shm-usage',
'--disable-extensions',
]
)Cache generated HTML to avoid regeneration:
# Check if HTML exists and is newer than source
if [ temp/viewer.html -nt source.py ]; then
echo "Using cached HTML"
else
echo "Regenerating HTML..."
python generate_viewer.py
fi-
Add HTML file to repo root (e.g.,
new_viewer.html) -
Add scenarios to script:
SCREENSHOT_SCENARIOS["new_viewer"] = [
ScreenshotConfig(name="overview", description="Main view"),
ScreenshotConfig(name="detail", description="Detail panel"),
]-
Update README with new section
-
Regenerate screenshots:
python scripts/generate_comprehensive_screenshots.py --viewers allAfter modifying viewer HTML/CSS:
# Regenerate specific viewer
python scripts/generate_comprehensive_screenshots.py --viewers segmentation
# Or all viewers
python scripts/generate_comprehensive_screenshots.py --viewers all
# Commit updated images
git add docs/images/*.png
git commit -m "docs: update screenshots for <feature>"Viewport Sizes:
- Full page: 1400x900 (default)
- Detail panel: 1400x600
- Sidebar focus: 800x900
- Chart/graph: 1400x400
File Sizes:
- Target: < 150 KB per screenshot
- Maximum: < 300 KB per screenshot
- Use PNG for UI (sharp text)
- Consider JPEG for photo-heavy content
Naming Convention:
- Format:
{viewer}_{scenario}.png - Examples:
segmentation_overview.png,benchmark_task_list.png - Use underscores, not hyphens
- Lowercase only
Coverage:
- ✅ 4+ viewers documented with screenshots
- ✅ 20+ total screenshots generated
- ✅ All major features visible (search, filters, playback, selection)
Quality:
- ✅ Screenshots < 200 KB average
- ✅ Text is crisp and readable
- ✅ Colors consistent with viewer themes
- ✅ No loading indicators or blank states in screenshots
Automation:
- ✅ One command regenerates all screenshots
- ✅ CI runs on every PR
- ✅ Script exits with error code on failure
- ✅ Clear error messages for debugging
Documentation:
- ✅ README has comprehensive screenshot gallery
- ✅ Each screenshot has descriptive caption
- ✅ Pipeline documented for maintainers
- ✅ Troubleshooting guide available
| Phase | Duration | Cumulative |
|---|---|---|
| 1. Environment Setup | 10 min | 10 min |
| 2. Capture Viewer | 30 min | 40 min |
| 3. Segmentation Viewer | 30 min | 1h 10m |
| 4. Synthetic Demo Viewer | 30 min | 1h 40m |
| 5. Benchmark Viewer | 30 min | 2h 10m |
| 6. README Update | 45 min | 2h 55m |
| 7. CI Integration | 30 min | 3h 25m |
| Total | 3h 25m |
Note: Times assume:
- Dependencies are installable without issues
- Viewers load correctly
- No major debugging needed
- Familiarity with tools
Add 1-2 hours buffer for troubleshooting.
-
Install Playwright (if not already done)
cd /Users/abrichr/oa/src/openadapt-viewer uv pip install ".[screenshots]" uv run playwright install chromium
-
Generate Capture Viewer Screenshots
python scripts/generate_readme_screenshots.py \ --capture-dir ../openadapt-capture \ --output-dir docs/images
-
Generate All Other Viewer Screenshots
python scripts/generate_comprehensive_screenshots.py \ --viewers all \ --output-dir docs/images
-
Review Generated Screenshots
open docs/images/
-
Update README
- Add new viewer sections
- Update image references
- Add captions
-
Test and Commit
git add -A git commit -m "feat: comprehensive screenshot pipeline" git push
For issues or questions:
- Check troubleshooting section above
- Review SCREENSHOT_PIPELINE_AUDIT.md for design rationale
- Check script help:
python scripts/generate_comprehensive_screenshots.py --help - Open issue on GitHub with
documentationlabel
This implementation provides:
- Comprehensive coverage of all viewer functionality
- Systematic approach to screenshot generation
- Automated pipeline for maintainability
- Clear documentation for future updates
The enhanced pipeline transforms the README from showing 2 viewers to showcasing 4+ complete viewers with 20+ screenshots demonstrating every major feature.
Status: Ready for implementation - all files created, plan documented, next steps clear.