Repository navigation
fix(captions): preserve zero plate grain in generated postfx - #3656
Merged
Merged
Conversation
miga-heygen
approved these changes
Sep 4, 2026
miga-heygen
left a comment
Contributor
There was a problem hiding this comment.
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 — correctgrain > 0→noise = ",noise=alls=${grain}:allf=t+u"— leading comma keeps the filter chain validgrain === 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 thedoesNotMatch(/,\s*\[v\]/)trailing-comma guard are both discriminating
+55/-5. LGTM.
— Miga
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Themes specifying
plate.grain: 0still 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.