feat: Add page-level filtering for icons and images#54
Conversation
Summary of ChangesHello @alexey1312, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the asset export process by introducing page-level filtering for Figma icons and images. Previously, filtering was limited to the frame level, which could lead to incorrect exports when multiple Figma pages contained frames with identical names. The new functionality allows for more precise control over which assets are exported by specifying the Figma page, thereby preventing naming conflicts and improving the reliability of asset generation. This change impacts configuration, CLI usage, and the core loading logic, ensuring a robust and flexible filtering mechanism. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Enhance configurations to allow filtering by Figma page names. This change aids in distinguishing components across pages with identical frame names. Updates include: - Introduced `figmaPageName` in both `FrameSource` and platform-specific entries. - Updated relevant loading functions and configurations to acknowledge this filter. - Improved tests to validate various fallback scenarios for `figmaPageName`.
8206c7c to
ddfaba5
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces page-level filtering for icons and images by adding a figmaPageName field. The changes are extensive and well-executed, touching configuration schemas, data loaders, CLI commands, and documentation. The new feature is consistently threaded through all layers of the application, and the accompanying tests are thorough, covering the new logic and fallback behaviors. I've identified a couple of minor maintainability improvements in the test files.
Description
Add optional
figmaPageNamefield to enable page-level filtering for icons and images. Previously, filtering was limited tofile → frame, which caused incorrect exports when multiple Figma pages contained identically-named frames. Filtering now supportsfile → page → framewith a 3-tier fallback: entry → common → nil.figmaPageNameto PKLFrameSource,Common.Icons, andCommon.ImagesschemaspageNametoIconsSourceInput,ImagesSourceInput,IconsLoaderConfig,ImagesLoaderConfigImageLoaderBase.fetchImageComponents()filter to checkcontainingFrame.pageNamepageNamethrough all loading methods (8 methods in ImageLoaderBase, IconsLoader, ImagesLoader)figmaPageNameto source inputs--page/-pCLI option to download commandsfigmaPageNameexamples to init template configsfigmaPageNamedocumentation