-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Discussion: deleting an asset should remove it from projects #2979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
According to me we can also approach this by introducing a The During sketch listing, it will validate the assets and will display a "Missing Assets" warning for sketches with missing assets. Additionally, ![]() And if the user still wants to continue and open the sketch he/she still will be able to. And if the sketch is openedIf the sketch is opened we can improve the way the error is being shown in the console, as @lindapaiste suggested, we should notify the user about the name of missing file. |
|
@lindapaiste I agree with @ash97531 , we should ask for a confirmation first then if the user is ok we should delete the it from the array of project. Because creating asset validator as just said by @Keshav-0907 could be messy. |
Agree with @ash97531 as well that showing the user a list of sketches that the asset they want to delete are in before removing it would be helpful. |
i would to like to work on this issue... @raclim @lindapaiste |
We already have an "are you sure?" modal but it doesn't mention the name of the sketch. How about these 3 changes:
|
I think this is smart! It's potentially not 100% accurate if the files are using string concatenation to load a file, like |
Yep!! This will be good enough... |
I am getting issues in uploading images in local setup. |
Increasing Access
It is confusing for a sketch to contain an asset which no longer exists.
Feature enhancement details
Let's say that I create a sketch and upload an image to it. Then I go to the "My Assets" page and delete that file. What should happen to the sketch?
Right now we do not modify the sketch at all when the asset is deleted. The image (
image.svg
) will still be listed in the files menu of the project. But the file itself no longer exists, and cannot be previewed or used in the project. Trying to load the image with the p5loadImage()
function it won't work, and the error messaging is very confusing because it references the actual URL of the asset ("https://assets.editor.p5js.org/6457f440a66277001a43e859/201273ad-0121-44e1-a5b4-585ea4d9fb8e.svg"
) rather than the local file path ("image.svg"
).It also causes a bug where the sketch containing the deleted file cannot be downloaded. I fixed that bug by ignoring the deleted file, but that feels like a bandaid solution. The root of the issue is more fundamental -- why do we have projects containing files which do not exist?
I'm open to discussion on how we should handle this situation. My opinion is that when someone deletes an asset we should remove it from from the
files
array of any projects.The text was updated successfully, but these errors were encountered: