Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 11, 2025

Problem

When the plugin detects unsaved local changes versus what's stored in the remote repository during startup, it displays a confirmation dialog asking "Recover local changes?" The dialog previously used default button labels ("Yes" and "Cancel") which were:

  1. Not explicit enough - "Yes" doesn't clearly communicate what action will be taken
  2. Potentially confusing - The semantic relationship between the title question and button actions wasn't clear
  3. Missing danger signals - No visual indication that one action is destructive (discarding local changes)

User feedback indicated these button labels needed to be more explicit about the consequences of each action.

Solution

Updated the dialog to use clear, action-oriented button labels with appropriate styling:

Before

const shouldRecoverLocalChanges = await useConfirmResult.confirm({
  text: 'Recover local changes?',
  description: 'You have local changes unsaved to the remote storage.',
  // Uses defaults: confirmAction: 'Yes', cancelAction: 'Cancel'
});

After

const shouldUseRemote = await useConfirmResult.confirm({
  text: 'Recover local changes?',
  description: 'You have local changes unsaved to the remote storage.',
  confirmAction: 'Use remote',
  cancelAction: 'Recover changes',
  variant: 'danger',
});
// Return inverted since "Use remote" is now the confirm action
return !shouldUseRemote;

User Experience Improvement

The dialog now presents two clearly labeled options:

  • "Use remote" (right side, danger styling) - Explicitly states that this action will discard local changes and pull from remote
  • "Recover changes" (left side, secondary styling) - Explicitly states that this action will keep local changes

The danger variant styling (red button) on "Use remote" provides a strong visual signal that this is a potentially destructive action, helping users make an informed decision.

Technical Details

  • Swapped button semantics to apply danger styling to the destructive action (the confirm dialog API only applies variant: 'danger' to the confirm button)
  • Inverted the return logic to maintain existing behavior with the new button positions
  • Added comprehensive test coverage for the new button labels and danger variant
  • All existing tests updated and passing

Testing

✅ All unit tests passing
✅ New test added to verify button labels and danger variant
✅ Linting passing
✅ Changeset created

Original prompt

When you exit the plugin with changes in your local configuration vs what is stored in your repo, you get this warning message to either use the local ones or pull down from the repo and discard the local changes:

User feedback - the button copy could be more explicit. Although “Yes” ties into the title, it doesn’t work quite as well grammatically with the modal body content. Given this is also a potentially destructive change if you hit “Cancel”, it might be better using a danger/destructive semantic:

Let's use "Recover changes" or "Use remote"


💡 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.

@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2025

🦋 Changeset detected

Latest commit: db4f674

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

Copilot AI and others added 2 commits October 11, 2025 12:30
…r styling

Co-authored-by: six7 <4548309+six7@users.noreply.github.com>
Co-authored-by: six7 <4548309+six7@users.noreply.github.com>
Copilot AI changed the title [WIP] Update button labels for configuration warning modal Improve recovery dialog button labels for better clarity and safety Oct 11, 2025
Copilot AI requested a review from six7 October 11, 2025 12:36
Copilot finished work on behalf of six7 October 11, 2025 12:36
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