Skip to content

feat(review): add review.visual.themes config for dark-mode capture #3678

Description

@JSONbored

Context

Phase 3 of the visual-evidence upgrade (epic #3607, following #3667 full-page screenshots and #3674 the pixel-diff Diff column). Screenshots today only ever render in whatever theme a page defaults to (no prefers-color-scheme override) — a repo that ships dark mode has no way to get before/after evidence for it.

Deliverables

  • review.visual.themes: string[] in the manifest schema (focus-manifest.ts), validated against the enum light | dark, following the same list-parsing idiom already used for review.visual.routes.paths (dedupe, cap, warn-and-drop invalid entries) — not the review.features tri-state pattern, which doesn't fit a "which variants" list.
  • captureShot (shot.ts) accepts a theme parameter and calls page.emulateMediaFeatures([{ name: "prefers-color-scheme", value: theme }]) before navigation.
  • capturePage's cache-key fingerprint includes the theme (so light/dark don't collide in storage, mirroring how viewport is already included).
  • buildCapture resolves the configured theme list (default ["light"], byte-identical to today) and produces one CaptureRoute entry per (route, theme) pair, reusing the existing per-viewport capture/diff logic unchanged inside an outer theme loop — CaptureRoute gains one new optional theme?: "light" | "dark" field, no restructuring of the existing flat before/after/diff fields.
  • unified-comment-bridge.ts's "Visual preview" table shows the theme in the viewport label when set (e.g. "desktop (dark)"), unchanged when absent.
  • Default (no config) stays byte-identical: single light-theme capture exactly as today.

Expected outcome

A repo can opt into review.visual.themes: [light, dark] and get before/after evidence for both color schemes, without any change to repos that don't configure it.

Part of #3607.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)visualUI/web visual work — owner-led, NOT for Gittensor contributors (extensions excepted)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions