Skip to content
canvas-filmstrip-testing logo

Canvas Filmstrip Testing Skill

canvas-filmstrip-testing

Visual regression for canvas-rendered matrix progressions. Tests filmstrip strips that show how 2D data evolves visually over time. Auto-apply when editing *Progressions.ts strip definitions or stories with filmstrip components.

SKILL.md

Full skill instructions

Canvas Filmstrip Testing Skill

Tests canvas-rendered filmstrips that visualize how matrix data (energy fields, foam grids, etc.) evolves over simulated time. Each strip shows multiple frames side-by-side.

This is about visual rendering of data progressions. It catches:

  • Color scale/​gradient changes
  • Canvas rendering bugs
  • Missing or misaligned frames
  • Incorrect visual interpolation

For the underlying data correctness, see matrix-data-model-progression-testing first.

When to Use This

  • Verifying canvas-rendered strips match expected appearance
  • Testing color scales and gradients
  • Debugging visual artifacts in filmstrip rendering
  • Validating that progression data renders correctly

The 8-Layer Visual Pipeline

Each layer tests a specific aspect of the wave physics simulation:

LayerStoryProgressions File
101-bathymetrysrc/​render/​bathymetryProgressions.ts
202-energy-fieldsrc/​state/​energyFieldProgressions.ts
303-shoalingsrc/​render/​shoalingProgressions.ts
404-wave-breakingsrc/​render/​waveBreakingProgressions.ts
505-energy-transfersrc/​render/​energyTransferProgressions.ts
606-foam-gridsrc/​render/​foamGridProgressions.ts
707-foam-dispersionsrc/​render/​foamDispersionProgressions.ts
808-foam-contourssrc/​render/​foamContoursProgressions.ts

Architecture

stories/
  01-bathymetry/
    01-bathymetry.mdx              → MDX story page
    01-bathymetry.visual.spec.ts   → Playwright visual test
    strip-bathymetry-basic.png     → Baseline screenshot (colocated)
    strip-bathymetry-features.png
  02-energy-field/
  ...

src/​render/​*Progressions.ts        → Progression data + strip definitions

Strip Definition Pattern

Each progression file exports strips for visual testing:

// src/​render/​bathymetryProgressions.ts
export const BATHYMETRY_STRIP_BASIC = {
  testId: 'strip-bathymetry-basic',
  pageId: '01-bathymetry',
  snapshots: PROGRESSION_BATHYMETRY_BASIC.snapshots,
};

export const BATHYMETRY_STRIPS = [
  BATHYMETRY_STRIP_BASIC,
  BATHYMETRY_STRIP_FEATURES,
];

Visual Test Pattern

// stories/​01-bathymetry/​01-bathymetry.visual.spec.ts
import { BATHYMETRY_STRIPS } from '../​../​src/​render/​bathymetryProgressions';
import { defineStripVisualTests } from '../​visual-test-helpers';

defineStripVisualTests(BATHYMETRY_STRIPS);

Commands

# Run visual tests
npm run test:visual:headless        # CI/​agents
npm run test:visual:headed          # Debugging with browser UI

# Update baselines after intentional changes
npm run test:visual:update:headless
npm run test:visual:update:headed

# Clear test artifacts
npm run reset:visual                # Clear results/​reports only
npm run reset:visual:all            # Clear results + colocated baselines

# Start dev server for interactive debugging
npm run stories                     # Starts on http://localhost:3001

Workflow: Data First, Then Visual

CRITICAL: Always verify data before visual testing.

Wrong workflow:
  Change coefficient → Update visual snapshot → "Looks the same, try higher"

Correct workflow:
  Change coefficient → Run npx vitest run *Progressions.test.ts →
  Verify matrix values changed → Then update visual if needed
  1. Verify data with ASCII - Run *Progressions.test.ts
  2. If data correct, update visual - npm run test:visual:update:headless
  3. If data wrong, fix logic first - Don't touch visuals

Mapping testId to Source

When a visual test fails:

  1. testId like strip-bathymetry-basic → BATHYMETRY_STRIP_BASIC in progressions file
  2. pageId like 01-bathymetry → stories/​01-bathymetry/ folder
  3. Pattern: strip-{layer}-{variant} → *{layer}Progressions.ts

Debugging with Chrome DevTools MCP

// Start dev server
npm run stories

// Open specific story page
mcp__chrome-devtools__new_page({
  url: "http://localhost:3001/?page=01-bathymetry"
})

// Take snapshot to find strip UIDs
mcp__chrome-devtools__take_snapshot()

// Screenshot the strip element
mcp__chrome-devtools__take_screenshot({ uid: "<strip-uid>" })

// After code changes, reload and compare
mcp__chrome-devtools__navigate_page({ type: "reload" })
mcp__chrome-devtools__take_screenshot({ uid: "<strip-uid>" })

Common Issues

Visual Differs but Data is Correct

Check:

  • Color scale mapping (value → color)
  • Canvas context settings (smoothing, etc.)
  • Cell sizing/​spacing in strip renderer

Visual Passes but Looks Wrong

The baseline may be incorrect. Manually verify:

  1. Start dev server: npm run stories
  2. Navigate to the story
  3. Visually inspect the strip
  4. If wrong, update baseline: npm run test:visual:update:headless

Related Skills

  • matrix-data-model-progression-testing - Verify data correctness first
  • component-screenshot-testing - For React UI component screenshots
  • visual-regression - Shared infrastructure and commands
  • visualization-algorithms - Canvas rendering algorithms

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View