Add Figma Code Connect generation for Android (Jetpack Compose) - #58
Conversation
Introduce functionality to generate Figma Code Connect Kotlin files for Jetpack Compose. The `AndroidCodeConnectExporter` class and related methods allow linking Figma design components to Compose code, creating an important connection for designers to view Compose implementations in Figma Dev Mode. - Added `AndroidCodeConnectExporter` with a method to generate Kotlin files from image packs. - Expanded `AndroidIconsEntry` and `AndroidImagesEntry` to include a `codeConnectKotlin` field for file path configuration. - Updated configuration schemas and generator logic for Code Connect inclusion. - Integrated Code Connect generation into icon and image export workflows within the `AndroidIconsExporter` and `AndroidImagesExporter` classes. - Created tests for `AndroidCodeConnectExporter` to ensure expected behavior, including asset filtering, URL generation, and file output.
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 Android development workflow by integrating Figma Code Connect. It bridges the gap between design and development by automating the generation of Kotlin files that link Figma components to their Jetpack Compose implementations. This feature aims to improve collaboration and streamline the handoff process for Android projects, ensuring that design specifications are accurately reflected in the codebase. 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
|
There was a problem hiding this comment.
Code Review
This pull request adds Figma Code Connect support for Android, which is a great feature to bring parity with the existing iOS integration. The changes are well-structured, including the new AndroidCodeConnectExporter, schema updates, integration into the export pipelines, and new tests. I've identified a few areas for improvement regarding code duplication, API consistency between icons and images, and error handling that would make this feature even more robust and maintainable. Additionally, a small update to the generated Kotlin template would align it better with modern Android development practices.
Description
Add Figma Code Connect support for Android, mirroring the existing iOS integration. When configured, ExFig now generates
.figma.ktfiles with@FigmaConnectannotations that link Figma design components to Jetpack Compose implementations, enabling designers to view corresponding Compose code directly in Figma Dev Mode.AndroidCodeConnectExporterinAndroidExportmodule with Stencil-based Kotlin generationcodeConnectKotlinfield toAndroid.IconsEntryandAndroid.ImagesEntryPKL schemasCodeConnect.figma.kt.stenciltemplate for@FigmaConnectannotated Composable functionsTest Plan
AndroidCodeConnectExporterTests— 7 tests pass (asset generation, nil handling, mixed assets, nodeId colon→hyphen, sort order, granular cache, file destination)EnumBridgingTests— 45 tests pass (PKL type bridging with newcodeConnectKotlinparameter)ExFig_AndroidTests— 32 tests pass (integration)🤖 Generated with Claude Code