Add the option to overwrite a file when importing

Hi guys, I’ve just noticed this and I think some improvement is welcome.

I’m working on a project on a team while I have a personal library that I’m working on stored on my personal drafts. I’ve downloaded it and imported a copy on this team I’m working, but I made some updates to it and as I’ve exported it and imported into the team once again there were no prompts to ask me if I wanted to overwrite the existing one, Penpot just created a new one, forcing me to relink all the stuff to the new one before deleting the old version.

Would be nice to have this option to overwrite when the files have the exact same name, and only if I say “no” on this new prompt the file will be added as a new file with a different name.

Hey,
If I understood correctly, the issue comes from the fact that this file is a shared library and thus some of its components are used in other files ?

I’m not sure if it would be possible to overwrite it and keep the connections with the components, but maybe a solution would be to copy and paste the new elements you created into the file, instead of reimporting the complete file (assuming the changes where minor).

Why did you need to duplicate the file into your drafts for making the changes instead of working on the file being used within the team ? It’s a genuine question, I’m curious to understand the process as this situation could happen to anyone :smiley:

1 Like

Sure @Louis, no problem.

This project on my drafts is a library I’m working on and I have plans to publish it here so anyone can use. So I’m making improvements to it over time. Parallel to this, I’m working on a customer project where I’ve used a previous version of this same library, and I wanted to update it so it would fix some bugs and change the appearance of certain elements, but I’ve found this problem while doing it.

The thing is that the solution you gave will work for minor changes, but not for a complete recreation, for example.

My proposal is to add a way to verify the following:

1- Does both files have the exact same name? If YES, ask if the user want to overwrite it.

2- Does the components inside this file have the same name as the prior version had? If YES, link them wherever they were used before.

I think this could tackle this issue of using shared libraries across teams, or just updating libraries using external files.

1 Like

Ok got it, it makes sense to me !