Context
Issue #301 requires capturing multi-step form screenshots with realistic data, which will increase complexity in the current custom Playwright script (scripts/generate-screenshots.ts).
@omachala suggested Heroshot as a more maintainable alternative that externalizes screenshot configuration into YAML/JSON instead of hardcoded TypeScript.
Objective
Evaluate Heroshot's feasibility as a replacement for the current screenshot generation script by:
- Analyzing feature parity with current implementation
- Testing ease of implementation for our use cases
- Identifying implementation steps and effort required
- Making a recommendation (keep custom script vs. migrate to Heroshot)
Current Implementation Analysis
Current script: scripts/generate-screenshots.ts
- Uses Playwright directly
- Hardcoded interactions in TypeScript
- Captures 11 screenshots (1024x768 viewport)
- Automatically starts/stops backend and frontend servers
- Manual form filling logic for test data
Pain points:
- Adding new scenarios requires TypeScript code changes
- Multi-step form interactions need complex Playwright logic
- No built-in light/dark mode support
- Manual viewport management
Heroshot Capabilities
Based on documentation review:
Core Features:
- Visual Picker: Initial setup through UI (no manual config writing)
- Config-based: All screenshots defined in
.heroshot/config.json
- Actions API: Pre-built actions for form interactions (
click, type, fill_form, wait, etc.)
- Multi-viewport: Desktop/tablet/mobile presets + custom dimensions
- Theme Support: Automatic light/dark mode variants (
screenshot-light.png, screenshot-dark.png)
- CI/CD Ready: GitHub Actions integration with encrypted session storage
- Framework Integration: Vue component for rendering screenshots in docs
Actions API Relevant to Our Use Case:
{
"actions": [
{"type": "click", "selector": ".next-button"},
{"type": "type", "selector": "input[name='url']", "text": "https://example.com"},
{"type": "fill_form", "fields": [
{"selector": "#projectName", "value": "My Project"},
{"selector": "#description", "value": "Test description"}
]},
{"type": "wait", "time": 500}
]
}
Vue Integration:
<script setup>
import { Heroshot } from 'heroshot/vue';
</script>
<template>
<Heroshot name="dashboard" alt="Dashboard view" />
</template>
Implementation Steps (Proposed)
Phase 1: Proof of Concept
-
Install Heroshot
npm install heroshot --save-dev
-
Create initial config for 1-2 existing screenshots
- Test capturing dashboard and project list views
- Verify output matches current screenshots
-
Test multi-step form (the main challenge)
- Configure actions for ProjectForm wizard:
- Step 1: Fill basic info + click Next
- Step 2: Fill crawl settings + click Next
- Step 3: Fill run profile + capture
- Compare ease vs. current Playwright code
Phase 2: Full Migration
- Port all 11 screenshots to Heroshot config
- Handle server startup/shutdown
- Keep npm script wrapper or integrate into Heroshot workflow
- May still need custom logic for backend/frontend coordination
- Update documentation
docs/screenshots/README.md
docs/guides/frontend-dev.md#screenshot-updates
- Remove old script (
scripts/generate-screenshots.ts)
Phase 3: Enhancements (Optional)
- Add Vue component for rendering screenshots in docs
- CI/CD integration for automated screenshot updates on deploy
- Light/dark mode variants (currently we only have light mode)
Evaluation Criteria
| Criterion |
Current Script |
Heroshot |
Winner |
| Ease of adding screenshots |
TypeScript code |
JSON config + visual picker |
? |
| Multi-step form handling |
Custom Playwright |
Actions API (click, type, wait) |
? |
| Server lifecycle |
Built-in (auto start/stop) |
Requires external script |
? |
| Maintainability |
Code changes for new scenarios |
Config changes only |
? |
| Theme support |
Manual (single theme) |
Automatic light/dark |
Heroshot ✅ |
| Documentation integration |
Manual image links |
Vue component + auto-switching |
Heroshot ✅ |
| Learning curve |
Playwright knowledge |
Heroshot config format |
? |
Questions to Answer During Evaluation
- Form interaction complexity: Can Heroshot's Actions API handle our 3-step wizard reliably?
- Server coordination: How do we integrate backend/frontend startup with Heroshot workflow?
- Test data: How do we inject realistic form data (currently hardcoded in TS)?
- Migration effort: Is the migration justified vs. extending current script?
- Long-term maintenance: Will Heroshot reduce ongoing screenshot maintenance burden?
Implementation Suggestions
If migrating to Heroshot:
-
Keep server startup script separately
// package.json
{
"scripts": {
"screenshots": "npm run screenshots:servers && npx heroshot",
"screenshots:servers": "node scripts/start-servers.js"
}
}
-
Example config for multi-step form
{
"outputDirectory": "docs/screenshots",
"browser": {
"viewport": {"width": 1024, "height": 768}
},
"screenshots": [
{
"name": "03-project-create-step1",
"url": "http://localhost:5173/projects/new",
"actions": [
{"type": "type", "selector": "#projectName", "text": "My Website Upgrade"},
{"type": "type", "selector": "#websiteUrl", "text": "https://example.com"},
{"type": "type", "selector": "#description", "text": "Testing framework upgrade"},
{"type": "wait", "time": 200}
]
},
{
"name": "03-project-create-step2",
"url": "http://localhost:5173/projects/new",
"actions": [
{"type": "type", "selector": "#projectName", "text": "My Website Upgrade"},
{"type": "click", "selector": ".next-button"},
{"type": "wait", "time": 300},
{"type": "click", "selector": "#crawlEnabled"},
{"type": "type", "selector": "#maxPages", "text": "50"},
{"type": "wait", "time": 200}
]
}
]
}
-
Vue component integration (optional enhancement)
<!-- In documentation or README -->
<Heroshot name="dashboard" alt="Dashboard view" />
Acceptance Criteria
Related Documentation
Context
Issue #301 requires capturing multi-step form screenshots with realistic data, which will increase complexity in the current custom Playwright script (
scripts/generate-screenshots.ts).@omachala suggested Heroshot as a more maintainable alternative that externalizes screenshot configuration into YAML/JSON instead of hardcoded TypeScript.
Objective
Evaluate Heroshot's feasibility as a replacement for the current screenshot generation script by:
Current Implementation Analysis
Current script:
scripts/generate-screenshots.tsPain points:
Heroshot Capabilities
Based on documentation review:
Core Features:
.heroshot/config.jsonclick,type,fill_form,wait, etc.)screenshot-light.png,screenshot-dark.png)Actions API Relevant to Our Use Case:
{ "actions": [ {"type": "click", "selector": ".next-button"}, {"type": "type", "selector": "input[name='url']", "text": "https://example.com"}, {"type": "fill_form", "fields": [ {"selector": "#projectName", "value": "My Project"}, {"selector": "#description", "value": "Test description"} ]}, {"type": "wait", "time": 500} ] }Vue Integration:
Implementation Steps (Proposed)
Phase 1: Proof of Concept
Install Heroshot
Create initial config for 1-2 existing screenshots
Test multi-step form (the main challenge)
Phase 2: Full Migration
docs/screenshots/README.mddocs/guides/frontend-dev.md#screenshot-updatesscripts/generate-screenshots.ts)Phase 3: Enhancements (Optional)
Evaluation Criteria
click,type,wait)Questions to Answer During Evaluation
Implementation Suggestions
If migrating to Heroshot:
Keep server startup script separately
Example config for multi-step form
{ "outputDirectory": "docs/screenshots", "browser": { "viewport": {"width": 1024, "height": 768} }, "screenshots": [ { "name": "03-project-create-step1", "url": "http://localhost:5173/projects/new", "actions": [ {"type": "type", "selector": "#projectName", "text": "My Website Upgrade"}, {"type": "type", "selector": "#websiteUrl", "text": "https://example.com"}, {"type": "type", "selector": "#description", "text": "Testing framework upgrade"}, {"type": "wait", "time": 200} ] }, { "name": "03-project-create-step2", "url": "http://localhost:5173/projects/new", "actions": [ {"type": "type", "selector": "#projectName", "text": "My Website Upgrade"}, {"type": "click", "selector": ".next-button"}, {"type": "wait", "time": 300}, {"type": "click", "selector": "#crawlEnabled"}, {"type": "type", "selector": "#maxPages", "text": "50"}, {"type": "wait", "time": 200} ] } ] }Vue component integration (optional enhancement)
Acceptance Criteria
Related Documentation
scripts/generate-screenshots.tsdocs/guides/frontend-dev.md#screenshot-updates