ScratchAddons icon indicating copy to clipboard operation
ScratchAddons copied to clipboard

Delete other assets

Open Jazza-231 opened this issue 2 years ago • 21 comments

Resolves #4692

Changes

Adds a button to the right click menu for costumes, backdrops, and sounds to delete all the others.

Reason for changes

Apparently people want this.

Tests

Tested on brave, restore deleted costumes etc work, i think its all good. Please suggest changes to addon.json name and desc etc

Jazza-231 avatar Jan 02 '24 09:01 Jazza-231

~~Shouldn't this be marked dangerous?~~ EDIT: Oh wait, there's a confirmation. Didn't notice.

ghost avatar Jan 02 '24 12:01 ghost

I'll do it later™

Jazza-231 avatar Jan 02 '24 16:01 Jazza-231

Shouldn't this be marked dangerous? EDIT: Oh wait, there's a confirmation. Didn't notice.

I'm not saying it needs to be but disable auto save doesn't remove the confirmation but it's still marked as dangerous.

Samq64 avatar Jan 02 '24 21:01 Samq64

@Joeclinton1 done, done and done

Jazza-231 avatar Jan 03 '24 02:01 Jazza-231

Tested on brave, restore deleted costumes etc work,

So does it restore all of the deleted costumes/sounds? I think this is quite important and we didn't mention it in #4692. It's sometimes easy to forget about undo.

WorldLanguages avatar Jan 03 '24 04:01 WorldLanguages

It sure does!

Jazza-231 avatar Jan 03 '24 04:01 Jazza-231

I'm not saying it needs to be but disable auto save doesn't remove the confirmation but it's still marked as dangerous.

It's a browser native confirmation, and it should be dangerous because you will forget to save, here you need to invoke it manually.

Secret-chest avatar Jan 03 '24 07:01 Secret-chest

Could the menu item be made orange by marking it as dangerous

I added the dangerous property and set it to true as a test and it seemed to not change the colour? I'm not sure why, perhaps I did something wrong, could someone suggest the code change so that I can see if I'm doing it right?

It would also be nice if the restore message was made plural but that isn't really necessary.

Yeah that annoyed me too, I'll see if it's decently easy for me to do.

Jazza-231 avatar Jan 04 '24 02:01 Jazza-231

I don't think this should be marked as dangerous, since you can just restore the costumes, there's nothing dangerous about it. This also doesn't remove functionality it adds functionality.

Joeclinton1 avatar Jan 04 '24 12:01 Joeclinton1

I don't think this should be marked as dangerous, since you can just restore the costumes, there's nothing dangerous about it. This also doesn't remove functionality it adds functionality.

I think they were talking about changing the "delete others" button in the context menu to use the color orange when hovered over.

DNin01 avatar Jan 04 '24 18:01 DNin01

image image It seems that even with dangerous: true, the button does not change colour when hovered. Tbh, I don't think it needs to be dangerous, there is a confirmation, and you can restore the costumes easily

Jazza-231 avatar Jan 05 '24 02:01 Jazza-231

It seems that even with dangerous: true, the button does not change colour when hovered.

That's a bug in editor dark mode. It does become orange on hover if dark mode is disabled.

mxmou avatar Jan 05 '24 08:01 mxmou

Oh ok, I'll add it then

Jazza-231 avatar Jan 05 '24 09:01 Jazza-231

The restore button now properly reflects how many assets are being restored (aka it's pluralised)

Jazza-231 avatar Jan 06 '24 14:01 Jazza-231

  1. done
  2. done
  3. i have no idea what could be causing this

Jazza-231 avatar Jan 07 '24 13:01 Jazza-231

I looked into the "sounds being out of order" bug and it seems that the function addSounds has different logic to addCostumes, so it's kind of a bug on Scratch's part. You might not be able to fix this.

Joeclinton1 avatar Jan 07 '24 14:01 Joeclinton1

I looked into the "sounds being out of order" bug and it seems that the function addSounds has different logic to addCostumes, so it's kind of a bug on Scratch's part. You might not be able to fix this.

I think the solution is clear. You should pollute the addSounds and fix their bug. It's literally the only thing left for this addon to be finished.

Joeclinton1 avatar Feb 23 '24 14:02 Joeclinton1

I looked into the "sounds being out of order" bug and it seems that the function addSounds has different logic to addCostumes, so it's kind of a bug on Scratch's part. You might not be able to fix this.

I think the solution is clear. You should pollute the addSounds and fix their bug. It's literally the only thing left for this addon to be finished.

Frankly both my motivation and spare time have plummeted, and I'm resigned to no addons of mine being added, if you or anyone else wants to do this please do, otherwise it will take me a while to do, if it all.

Jazza-231 avatar Feb 23 '24 15:02 Jazza-231

Ok, i have some spare time so ill work on this

Jazza-231 avatar Mar 02 '24 06:03 Jazza-231

@Joeclinton1 @WorldLanguages i dont know who else wants to test but im pretty sure this is all good now, if it could be merged that would make me happi uwu

Jazza-231 avatar Mar 02 '24 08:03 Jazza-231

This should be ready for final reviews and approvals

Jazza-231 avatar Mar 25 '24 01:03 Jazza-231

I'm not 100% sure if Jaza is active nowadays, so I'll make a few changes myself.

Thanks for the reviews!

WorldLanguages avatar Jun 09 '24 22:06 WorldLanguages