fix(icons): support RTL and fix temp file collision in variable-mode dark generation#79
Merged
alexey1312 merged 3 commits intomainfrom Mar 30, 2026
Merged
Conversation
buildDarkPack now processes all images in a pack (not just the first), preserving isRTL, scale, idiom, and format from the light variant.
…rk generator buildDarkPack could silently overwrite temp files when a pack had multiple images with the same RTL polarity (e.g. different scales). Include loop index in temp file names to guarantee uniqueness. Add warning log when all images in a pack fail processing.
There was a problem hiding this comment.
Code Review
This pull request enhances the VariableModeDarkGenerator to support Right-to-Left (RTL) variants and multiple image scales within a single icon pack. The implementation now iterates through all images in a pack, preserving metadata such as isRTL, scale, and idiom, and uses unique temporary filenames to prevent collisions. Comprehensive unit tests were added to verify RTL flag preservation, color replacement accuracy, and robust error handling. I have no feedback to provide.
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.
Summary
buildDarkPacknow iterates ALL images in a pack (not just.first), preservingisRTL,scale,idiom, andformatfrom light variantsTest plan
testProcessLightPacksPreservesRTLFlag— both LTR and RTL dark images generatedtestDarkRTLImageHasReplacedColors— colors replaced in both variants, original removedtestProcessLightPacksPreservesScaleAndIdiom— scale/idiom/format preservedtestDarkRTLImageHasRTLSuffixInFileName— naming convention_rtlverifiedtestMultipleNonRTLImagesGetDistinctFiles— no temp file collision, distinct contenttestPartialFailureStillProducesDarkPack— partial failure produces pack from surviving imagestestAllImagesFailReturnsNil— all failures return nil with warning logged