Skip to content

fix(icons): support RTL and fix temp file collision in variable-mode dark generation#79

Merged
alexey1312 merged 3 commits intomainfrom
fix/variable-dark-rtl-support
Mar 30, 2026
Merged

fix(icons): support RTL and fix temp file collision in variable-mode dark generation#79
alexey1312 merged 3 commits intomainfrom
fix/variable-dark-rtl-support

Conversation

@alexey1312
Copy link
Copy Markdown
Collaborator

Summary

  • RTL support: buildDarkPack now iterates ALL images in a pack (not just .first), preserving isRTL, scale, idiom, and format from light variants
  • Temp file collision fix: Include loop index in temp file names to prevent silent overwrite when pack has multiple images with same RTL polarity (e.g. different scales)
  • Missing warning: Add warning log when all images in a pack fail processing (convention: every guard-else must log)

Test plan

  • testProcessLightPacksPreservesRTLFlag — both LTR and RTL dark images generated
  • testDarkRTLImageHasReplacedColors — colors replaced in both variants, original removed
  • testProcessLightPacksPreservesScaleAndIdiom — scale/idiom/format preserved
  • testDarkRTLImageHasRTLSuffixInFileName — naming convention _rtl verified
  • testMultipleNonRTLImagesGetDistinctFiles — no temp file collision, distinct content
  • testPartialFailureStillProducesDarkPack — partial failure produces pack from surviving images
  • testAllImagesFailReturnsNil — all failures return nil with warning logged

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.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

@alexey1312 alexey1312 merged commit 3c93f8c into main Mar 30, 2026
4 checks passed
@alexey1312 alexey1312 deleted the fix/variable-dark-rtl-support branch March 30, 2026 06:18
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