When you add a new costume in the costumes tab, or add a new sound in the sounds tab, the selection state does not change, and the editor continues to display the costume or sound that was already selected.
In Scratch 2.0, the selection state changes to the newly added costume or sound, and the editor shows the new one. Should we replicate this behavior?
Personally, I expected the selection to update as it does in Scratch 2.0.
I believe replicating the behavior would be ideal for Scratch. I don't see as many benefits in making the selection stay the same.
Agreed. I'm going to reframe this as a bug.
I could have a go at this, but I'm not certain where to write the new code.
The "Add Costume" button runs this:
onNewCostumeClick: e => {
e.preventDefault();
dispatch(openCostumeLibrary());
}
That opens up the CostumeLibrary modal, which, when a costume is selected to be added, runs this:
this.props.vm.addCostume(item.md5, vmCostume);
But CostumeLibrary is very separate from CostumeTab - how should CostumeLibrary tell CostumeTab to select the new costume?
If I were creating my own editor, I'd attach a callback/.then() to my "library open" method (think: openCostumeLibrary().then(i => { this.setState({selectedCostumeIndex: i}) })), but of course that's not exactly how scratch-gui's code works!
Most helpful comment
I believe replicating the behavior would be ideal for Scratch. I don't see as many benefits in making the selection stay the same.