tokens-studio / figma-plugin

Official repository of the plugin 'Tokens Studio for Figma' (Figma Tokens)
https://www.figma.com/community/plugin/843461159747178978
MIT License
1.36k stars 196 forks source link

Local multiplayer collaboration #2348

Open fokkerone opened 1 year ago

fokkerone commented 1 year ago

Describe the bug If more then one Figma Editors working with the plugin, this ends up in a mess.

To Reproduce Steps to reproduce the behavior:

  1. EDITOR A: Open the plugin Edit the tokens, leave the Plugin open
  2. EDITOR B Open the Plugn in the same Figma file an edit the token (simultaneously, one after the other it does not matter)
  3. EDITOR A: Edit token again, Changes from B are gone
  4. Same thing MIGHT happen if you work one after the other. Even if you close the plugin + reopen. an hour or 2 in between regardless SOEMTIMES the tokens are not synced between two or ore users.

Expected behavior Sync on save, Livereload, SSE, Websockets. to sync Toekens between different users. OR a button to force the update

2375 also describes the same issue

When multiple designers are editing tokens in the same file. They expect changes to be shared across plugin clients. We end up with a syncing issue where multiple users are writing to the document data, and overwriting each other's progress. This results in complaints that "syncing to GitHub isn't showing all my work"

Describe the solution you'd like

The token listing in the plugin should show a true reflection of the document state.

Currently, we set JSON in the plugin-client, and send that to Figma - without confirming the plugin-data we set is correct.

Image

This leads to a scenario where we could have a mismatch between the data in the document and the data in the plugin - if multiple users are editing the tokens in a document.

Ideally, we should send that data to Figma, and then have a callback to return the document state to the plugin client.

Image

Describe alternatives you've considered

We could sync local changes to client storage instead of document storage, but this could lead to confusion where people are editing the same file and expect to see the same changes before syncing to a sync provider.

Additional context

We can listen for "REMOTE" document changes to our sharedPluginData, and then ping those messages back to the client.

six7 commented 1 year ago

We should be able to listen to document changes on the root where we store tokens to update the visible tokens for other users as well.

We already listen for some documentchanges but not for the root level tokens right now, doing so (and updating the list of tokens for other users) would solve this

fokkerone commented 11 months ago

Is there any news on this? As this is a massive pain point when working as a team with TokenStudio... Most of the time, even "check-in check-out" (that is, even if only one is working within the Token plugin) doesn't work for us.

Even reopening the file/s does not result in a 100% update. We suspect it is some sort of caching in Figma, as restarting Figma updates the tokens.

We are waiting for license keys for the Pro version to save all token files in Azure. This doesn't solve the collaboration issue, but maybe the tokens will be stored in a more reliable single source of truth

Volker

esthercheran commented 11 months ago

Hi @fokkerone we are working on this at the moment. Will keep you updated

fokkerone commented 4 months ago

ready or not?