Skip to content

fix(cli): preserve snapshot alpha and create shot dirs#2238

Open
miguel-heygen wants to merge 1 commit into
mainfrom
fix/alpha-snapshots-shot-output-dir
Open

fix(cli): preserve snapshot alpha and create shot dirs#2238
miguel-heygen wants to merge 1 commit into
mainfrom
fix/alpha-snapshots-shot-output-dir

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

  • preserve transparency in full-frame and zoomed snapshot PNGs
  • create missing parent directories for keyframes --shot output paths

Why

Transparent standalone overlays rendered correctly to VP9 alpha, but their snapshot review PNGs were forced to opaque RGB. The same workflow also failed with ENOENT when --shot targeted a file inside a directory that did not already exist. Both behaviors reproduce on CLI 0.7.52.

How

  • pass Puppeteer omitBackground: true for snapshot screenshots and cropped snapshot captures
  • recursively create the shot output parent before browser capture
  • add regression coverage for both behaviors

Test plan

  • bun run --filter @hyperframes/cli test -- --run src/commands/snapshot.test.ts src/commands/keyframes.test.ts src/capture/captureCompositionFrame.test.ts
  • bun run --filter @hyperframes/cli typecheck
  • bunx oxlint on the six changed files
  • built the CLI and verified a transparent repro emits RGBA snapshot PNGs and writes a nested --shot path without pre-creating the directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant