Skip to content

Conversation

@akshay-gupta7
Copy link
Contributor

@akshay-gupta7 akshay-gupta7 commented Oct 21, 2025

Why does this PR exist?

This PR introduces a feature flag that allows bypassing the license check within the Figma plugin.

What does this pull request do?

Testing this change

Additional Notes (if any)

@changeset-bot
Copy link

changeset-bot bot commented Oct 21, 2025

🦋 Changeset detected

Latest commit: c9088fe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tokens-studio/figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

⤵️ 📦 ✨ The artifact was successfully created! Want to test it? Download it here 👀 🎁

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

Commit SHA:048faf3bce210b9a45ecf4d782490d44a3591643

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: add-launch-darkly-feature-flag 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 65.06 (0) 57.04 (0.05) 61.86 (-0.01) 65.38 (0)
🟢 packages/tokens-studio-for-figma/src/app/components/ProBadge.tsx 85.71 (0) 100 (50) 50 (0) 85.71 (0)
🔴 packages/tokens-studio-for-figma/src/app/components/LaunchDarkly/useFlags.ts 55.55 (-44.45) 40 (-10) 66.66 (-33.34) 55.55 (-44.45)
🟢 packages/tokens-studio-for-figma/src/app/components/TokenFlowButton/index.tsx 47.36 (0) 50 (25) 50 (0) 47.36 (0)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

Commit SHA:048faf3bce210b9a45ecf4d782490d44a3591643
Current PR reduces the test coverage percentage by 1 for some tests

@akshay-gupta7 akshay-gupta7 self-assigned this Oct 21, 2025
@akshay-gupta7 akshay-gupta7 requested a review from Copilot October 21, 2025 08:34
Copy link

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 a feature flag (bypassLicenseCheck) to control whether license validation is enforced in the Figma plugin. The implementation includes fallback logic to keep the plugin functional when LaunchDarkly is unavailable (by defaulting to true when the flag is undefined), and comprehensive test coverage for all three flag states: false (normal validation), true (bypass), and undefined (LaunchDarkly down).

Key Changes

  • Implemented feature flag logic with three-state handling (false/true/undefined) in useIsProUser hook
  • Enhanced Cypress test infrastructure to support feature flag injection for E2E tests
  • Added comprehensive unit test coverage for all flag states across affected components

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
useIsProUser.ts Implements the feature flag logic with fallback behavior for when LaunchDarkly is unavailable
Navbar.test.tsx Adds test coverage for all three flag states (false/true/undefined) for navbar features
ProBadge.test.tsx Adds test coverage for badge display behavior under different flag states
useFlags.ts Extends flag system to support Cypress feature flag injection via window object
commands.js Adds Cypress command to set feature flags for E2E testing
branches.cy.js Updates E2E test to explicitly set flag state for pro upgrade modal test
tricky-toys-destroy.md Contains the required changeset for this patch

@akshay-gupta7 akshay-gupta7 marked this pull request as ready for review October 21, 2025 08:35
@akshay-gupta7 akshay-gupta7 requested a review from six7 October 21, 2025 08:41
@akshay-gupta7 akshay-gupta7 marked this pull request as draft October 28, 2025 19:03
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.

2 participants