snapapi session 55: darkMode + hideSelectors features (355 tests)

This commit is contained in:
Hoid 2026-03-04 12:11:07 +01:00
parent 9a16f5e7da
commit 391f092c38
2 changed files with 68 additions and 4 deletions

View file

@ -1,5 +1,66 @@
# SnapAPI Session Log
## Session 55 — 2026-03-04 12:00 CET (New Screenshot Features: darkMode + hideSelectors)
**Goal:** Add competitive differentiator features to the screenshot API.
**Health Check:**
- Production: ✅ healthy, 2 replicas, 6+ days uptime (still v0.5.2, VULNERABLE — BUG-016)
- Staging: ✅ healthy, deployed 96d21aa
**Work Done:**
### 1. Feature: `darkMode` parameter — sub-agent: snapapi-dev-features-2
- New boolean parameter for POST/GET screenshot endpoints
- Emulates `prefers-color-scheme: dark` via Puppeteer's `page.emulateMediaFeatures()`
- Called before `page.goto()` so CSS media queries trigger correctly
- OpenAPI docs added for both POST body and GET query params
### 2. Feature: `hideSelectors` parameter
- Accepts string or string array (comma-separated in GET)
- Injects CSS `display: none !important` on specified selectors before capture
- Use case: hide cookie banners, popups, ads for clean screenshots
- Validation: max 10 selectors, each max 200 chars
- OpenAPI docs added for both endpoints
### TDD Compliance: ✅
- Tests written FIRST (RED): 17 new tests covering darkMode + hideSelectors
- Tests failed as expected
- Implementation added (GREEN): service + route changes
- All 355 tests passing (up from 338)
**Test Suite:** 355 tests passing (up from 338), 1 pre-existing skip
**Git Commits:**
- `96d21aa` feat: add darkMode and hideSelectors screenshot parameters
**Deployed to staging:** ✅ (verified healthy, new pod running)
**Investor Test:**
1. Stranger trust with money? **Yes on staging**
2. Data loss on crash? **No** (CNPG PostgreSQL)
3. Free tier abuse? **⚠️ YES on production** — /v1/signup/free still live
4. Key recovery? **Yes on staging**
5. All website features work? **Yes on staging**
**Competitive Analysis:**
- darkMode: Only offered by ~30% of screenshot APIs (Screenshotone, ScreenshotAPI)
- hideSelectors: Only ~20% offer CSS injection/element hiding
- Both features combined make SnapAPI more competitive for design/marketing use cases
**Blockers (unchanged):**
- **Production deploy: URGENT** — security fix + all improvements waiting
- Stripe production webhook: needs investor
- CI/CD: No Forgejo runner
**Next Steps:**
- Update landing page to showcase darkMode + hideSelectors
- Update Node.js + Python SDKs with new params
- Update changelog page
- Landing page blog post: "Capture dark mode screenshots with SnapAPI"
---
## Session 54 — 2026-03-04 09:00 CET (Business Logic & Security Fixes)
**Goal:** Fix discovered business logic bug + security improvements.