Skip to content

fix(captions): preserve zero plate grain in generated postfx - #3656

Merged
jrusso1020 merged 1 commit into
mainfrom
fix/caption-zero-grain
Sep 4, 2026
Merged

jrusso1020 merged 1 commit into
mainfrom
fix/caption-zero-grain

Conversation

@jrusso1020

Copy link
Copy Markdown
Collaborator

Themes specifying plate.grain: 0 still received the default FFmpeg noise filter. Preserve zero for both regular and heroless themes and omit noise entirely, while keeping level 5 when grain is absent.

Builds on #3032 by @miguel-heygen, updated for the heroless compiler changes in #3632. Regenerates the skills manifest.

Validation: both zero-grain regressions fail before the fix; all 586 skill tests pass, including six postfx cases and all 25 heroless themes. Syntax, changed-file lint/format, manifest sync, and pre-commit checks pass.

@miga-heygen miga-heygen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 55cd6dcab.

The || → ?? fix is the right shape: (dna.plate || {}).grain || 5 treated grain: 0 as falsy and fell through to 5. Nullish coalescing preserves the explicit zero.

Verified:

  • grain === 0 → noise = "" → FFmpeg filter chain ends at ${rgba}[v] with no trailing comma — correct
  • grain > 0 → noise = ",noise=alls=${grain}:allf=t+u" — leading comma keeps the filter chain valid
  • grain === undefined → grain ?? 5 = 5 → default noise level preserved
  • Heroless path uses dna.plate?.grain ?? 5 (safe optional chaining + nullish coalescing)
  • Non-heroless path passes through dna.plate || {} unchanged — grain propagation is the caller's concern there
  • All 6 test permutations (0/3/undefined × heroless/hero) cover the matrix; the doesNotMatch(/noise=/) assertion for zero-grain and the doesNotMatch(/,\s*\[v\]/) trailing-comma guard are both discriminating

+55/-5. LGTM.

— Miga

@jrusso1020
jrusso1020 merged commit 924b98a into main Sep 4, 2026
45 checks passed
@jrusso1020
jrusso1020 deleted the fix/caption-zero-grain branch September 4, 2026 21:38
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.

2 participants