Skip to content

Add loading state to save button in Edit sync provider dialog#3642

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-loading-prop-to-save-button
Draft

Add loading state to save button in Edit sync provider dialog#3642
Copilot wants to merge 2 commits intomainfrom
copilot/add-loading-prop-to-save-button

Conversation

Copy link
Contributor

Copilot AI commented Oct 15, 2025

Problem

The Edit sync provider dialog was missing a loading indicator on the save button during the async operation. When users clicked "Save", the plugin would:

  1. Validate credentials
  2. Fetch tokens from the remote provider
  3. Show a Pull dialog if successful

However, there was no visual feedback during this process, leaving users uncertain whether their action was being processed.

Solution

Added loading state tracking to the EditStorageItemModal component that:

  • Sets isLoading to true when the save operation begins
  • Passes the loading state down through StorageItemForm to all provider-specific form components
  • Displays a loading indicator on the save button via the loading prop
  • Resets the loading state after the operation completes (success or failure)

Changes

  • EditStorageItemModal.tsx: Added isLoading state management and error state reset on save
  • StorageItemForm.tsx: Added isLoading prop that gets passed to all provider forms
  • All provider forms (GitForm, ADOForm, BitbucketForm, GenericVersioned, JSONBinForm, SupernovaForm, TokensStudioForm, URLForm): Added loading={isLoading} prop to submit buttons

Result

Users now see a loading indicator on the save button while the plugin is:

  • Validating credentials
  • Fetching tokens from the remote provider
  • Processing the response

This provides clear visual feedback and prevents confusion about whether the save operation is in progress.

Testing

  • Verified linting passes
  • Build completes successfully
  • All sync-related tests pass (15 test suites, 47 tests)
Original prompt

The Edit sync provider dialog is missing a loading prop on the button when saving. As in, when you hit save we attempt to fetch and then show a Pull dialog if successful (or error if not). we need to adust logic so that on saving we await the fetch, and show the loading prop on the button, and then advance.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2025

🦋 Changeset detected

Latest commit: 32334a1

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

Co-authored-by: six7 <4548309+six7@users.noreply.github.com>
Copilot AI changed the title [WIP] Add loading prop to save button in edit sync provider dialog Add loading state to save button in Edit sync provider dialog Oct 15, 2025
Copilot AI requested a review from six7 October 15, 2025 07:28
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