Skip to content

Conversation

@LokmaneKrizou
Copy link
Contributor

@LokmaneKrizou Lokmane Krizou (LokmaneKrizou) commented Aug 4, 2025

This pull request introduces integration with Figma Code Connect for several Backpack Compose components, enabling automated documentation and validation workflows. It adds Figma Code Connect configuration, updates CI/CD workflows to support Figma-related checks and publishing, and implements .figma.kt files for multiple UI components. The changes are grouped into build system/workflow updates and new component documentation files.

Build System and Workflow Integration:

  • Added Figma Code Connect plugin and dependency to the project via app/build.gradle to enable Figma integration. [1] [2]
  • Updated .detekt-compose.yml to exclude .figma.kt files from the ModifierMissing rule, preventing unnecessary linting errors.
  • Enhanced the _build.yml, pr.yml, and release.yml GitHub Actions workflows to support Figma Code Connect:
    • Added support for a figma_enabled input and FIGMA_ACCESS_TOKEN secret.
    • Implemented steps to detect changes in Figma-related files, install Figma Code Connect, and validate or publish Code Connect files as needed during PRs and releases. [1] [2] [3] [4] [5] [6]

Component Documentation and Figma Integration:

  • Introduced .figma.kt files for several Backpack Compose components, each annotated for Figma Code Connect. These files provide Figma-compatible documentation and mapping for properties and variants:
    • BpkButton with multiple icon and style variants.
    • BpkCard and BpkCardWrapper. [1] [2]
    • BpkCarousel.
    • BpkDividedCard.
    • BpkDivider.
    • BpkGraphicPromo with overlay, kicker, sponsor, and alignment properties.
    • BpkLink with text and style mapping.

Remember to include the following changes:

  • Component README.md
  • Tests

If you are curious about how we review, please read through the code review guidelines

Copilot AI review requested due to automatic review settings August 4, 2025 08:54
@LokmaneKrizou Lokmane Krizou (LokmaneKrizou) changed the title Figma code connect PoC Figma code connect Aug 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces Figma Code Connect integration for Backpack Android components to bridge the gap between design and development. The integration enables automatic generation of accurate code snippets from Figma designs, improving the design-to-development handoff process.

  • Updates Kotlin version from 2.1.20 to 2.0.0 for Figma Code Connect compatibility
  • Adds comprehensive documentation for Figma Code Connect integration
  • Implements Code Connect annotations for BpkButton, BpkText, and BpkCard components

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
gradle/libs.versions.toml Updates Kotlin/KSP versions and adds Figma Code Connect dependencies
figma.config.json Configures Figma Code Connect parser settings for Compose
figma-code-connect/*.md Comprehensive documentation covering setup, integration, examples, and best practices
backpack-compose/src/main/kotlin/*/BpkTextCodeConnect.kt Implements 18 typography variant classes for text component
backpack-compose/src/main/kotlin/*/BpkCardCodeConnect.kt Basic card component integration example
backpack-compose/src/main/kotlin/*/BpkButtonCodeConnect.kt Four button variants (None, Left, Right, Icon only) with comprehensive property mapping
backpack-compose/build.gradle Adds Figma Code Connect plugin and dependency
Comments suppressed due to low confidence (1)

gradle/libs.versions.toml:2

  • Kotlin version 2.0.0 is an older version that has known issues and has been superseded by more stable releases. Consider using a more recent stable version like 2.1.20 or the latest stable release.
kotlin = "2.0.0"

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against d37edc1

@LokmaneKrizou Lokmane Krizou (LokmaneKrizou) added the minor A new & backwards compatible feature/component label Aug 5, 2025
@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 7036a5b

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against e269d9f

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 1034659

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 4b50e3b

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against fa89564

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 2496c15

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 20cd6ec

@skyscanner-backpack-bot skyscanner-backpack-bot bot added the ai: copilot used to indicate involvement of copilot in writing code in this PR label Dec 8, 2025
@skyscanner-backpack-bot
Copy link
Contributor

Fails
🚫 These new files do not include the license heading: app/src/main/java/net/skyscanner/backpack/demo/figma/button/BpkButton.figma.kt, app/src/main/java/net/skyscanner/backpack/demo/figma/cardwrapper/BpkCardWrapper.figma.kt, app/src/main/java/net/skyscanner/backpack/demo/figma/carousel/BpkCarousel.figma.kt, app/src/main/java/net/skyscanner/backpack/demo/figma/dividedcard/BpkDividedCard.figma.kt, app/src/main/java/net/skyscanner/backpack/demo/figma/divider/BpkDivider.figma.kt, app/src/main/java/net/skyscanner/backpack/demo/figma/graphicpromo/BpkGraphicPromo.figma.kt, app/src/main/java/net/skyscanner/backpack/demo/figma/link/BpkLink.figma.kt, app/src/main/java/net/skyscanner/backpack/demo/figma/panel/BpkPanel.figma.kt, app/src/main/java/net/skyscanner/backpack/demo/figma/savebutton/BpkSaveButton.figma.kt, app/src/main/java/net/skyscanner/backpack/demo/figma/sharebutton/BpkShareButton.figma.kt

Generated by 🚫 Danger Kotlin against 1e19046

active: true
ModifierMissing:
active: true
excludes: ['**/*.figma.kt']
Copy link
Contributor Author

Choose a reason for hiding this comment

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

those compostables are place holders to display snippet code in figma

Image

Copy link
Contributor

Choose a reason for hiding this comment

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

compost 😆

@LokmaneKrizou Lokmane Krizou (LokmaneKrizou) changed the title PoC Figma code connect Integrating Figma code connect + mapping first 10 components Dec 9, 2025
secrets:
GH_APP_PRIVATE_KEY:
required: true
FIGMA_ACCESS_TOKEN:
Copy link
Contributor

Choose a reason for hiding this comment

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

Has this been added to the secrets? Who owns it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its in the backpack android Github secretes yes

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes but whose figma account generated it?


@FigmaProperty(FigmaType.Enum, "Style")
val type: BpkButtonType = Figma.mapping(
"Primary" to BpkButtonType.Primary,
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we're missing a single source of truth for this, would that be something Supernova could do?

"app/src/main/java/net/skyscanner/backpack/demo/figma/**/*.figma.kt"
],
"documentUrlSubstitutions": {
"FIGMA_BUTTON": "https://www.figma.com/design/KXf2gHNLDe2cXWUoHl4cTX/Backpack%E2%80%A8Foundations---Components?node-id=10858-8677",
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look fragile at all! 🙀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai: claude ai: copilot used to indicate involvement of copilot in writing code in this PR minor A new & backwards compatible feature/component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants