figma-plugin icon indicating copy to clipboard operation
figma-plugin copied to clipboard

Allow folder import for free users

Open Copilot opened this issue 8 months ago • 1 comments

Problem

Free users were unable to import token projects exported as folders into the plugin. When attempting to use the "Choose folder" import feature, free users would be redirected to the tokens page without any tokens being imported and without any error message.

Root Cause

The file provider (src/app/store/providers/file.tsx) was restricting multi-file functionality to Pro users only:

if (isProUser) storageClient.enableMultiFile();

This meant that folder imports (which require multi-file support) would silently fail for free users.

Solution

Removed the Pro user restriction for local folder import by calling enableMultiFile() for all users:

// Before
if (isProUser) storageClient.enableMultiFile();

// After  
storageClient.enableMultiFile();

Changes Made

  1. Updated file provider (src/app/store/providers/file.tsx):

    • Removed useIsProUser import and dependency
    • Call enableMultiFile() unconditionally for all users
    • Cleaned up unused dependencies
  2. Added comprehensive test coverage:

    • Created tests for the file provider to verify multi-file functionality works for all users
    • Added multi-file folder import test to FileTokenStorage.test.ts
    • Verified backwards compatibility with existing single-file imports

Scope

This change is specifically for local folder import via the "Choose folder" button in the import dialog. Remote provider restrictions (GitHub, GitLab, Bitbucket, ADO) remain unchanged as they are outside the scope of this issue.

Testing

  • ✅ All existing tests pass
  • ✅ New tests verify folder import works without Pro license
  • ✅ Build succeeds without errors
  • ✅ Backwards compatibility maintained for single-file imports

Free users can now seamlessly import token projects from folders, making it easier to restore backups and migrate existing projects.

Fixes #3417.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Jun 06 '25 15:06 Copilot

⚠️ No Changeset found

Latest commit: 259838d683a5bac280eb2b3bfc1d996deba96bc5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

changeset-bot[bot] avatar Jun 06 '25 15:06 changeset-bot[bot]

bugbot run

six7 avatar Jun 11 '25 17:06 six7