refactor(producer): remove typecasts, deduplicate, name constants#1421
Closed
miguel-heygen wants to merge 2 commits into
Closed
refactor(producer): remove typecasts, deduplicate, name constants#1421miguel-heygen wants to merge 2 commits into
miguel-heygen wants to merge 2 commits into
Conversation
…erns - Extract seekInjectAndQueryStacking() and seekAndInject() helpers to deduplicate the seek+inject+query pattern across sequential loop, hybrid loop, and per-scene transition capture (3 call sites → 1 helper) - Fix sceneBuf as Buffer casts by properly typing the scene-capture arrays as [Buffer, Set<string>][] instead of using as const + cast - Replace as NonNullable<> cast on outputFormat with as const fallback - Add explanatory comments on inherent linkedom DOM casts
- Replace magic 0.001/0.999 with TRANSFORM_IDENTITY_EPSILON and OPAQUE_ALPHA_THRESHOLD; replace BPP=6 with RGB48_BYTES_PER_PIXEL - Add AffineMatrix tuple type + isAffineMatrix guard, eliminating all 4 non-null assertions on matrix indices - Extract resolveBlitOpacity() to replace 5 identical ternaries - Narrow fallow-ignore-file to line-level complexity suppressions
This was referenced Jun 13, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.

Code quality polish on the extracted HDR compositor:
seekInjectAndQueryStacking/seekAndInjecthelpers, deduplicating the seek+inject+query pattern across 3 capture files (5→2 clone groups)as Buffercasts with properly typed arraysTRANSFORM_IDENTITY_EPSILON,OPAQUE_ALPHA_THRESHOLD,RGB48_BYTES_PER_PIXELconstantsAffineMatrixtuple type +isAffineMatrixguard, eliminating 4 non-null assertionsresolveBlitOpacityhelper (5 identical ternaries → 1 function)fallow-ignore-fileto line-levelfallow-ignore-next-line complexity239 LOC (147 insertions, 92 deletions)
Stack: 5/5