phetsims / scenery-phet

Reusable components based on Scenery that are specific to PhET simulations.
MIT License
8 stars 6 forks source link

UndoButtton vs ReturnButton #816

Closed Luisav1 closed 1 year ago

Luisav1 commented 1 year ago

In reviewing this point in phetsims/build-a-nucleus#112

Are any significant chunks of code duplicated? In addition to manual identification, tools include: WebStorm Code > Analyze Code > Locate Duplicates and https://github.com/danielstjules/jsinspect.

I found that the UndoButton and ReturnButton look very similar and do the same function. Investigate why do we use the ReturnButton instead of the UndoButton? Could these merge to become the same?

zepumph commented 1 year ago

After some investigation and slack discussion, I think we should keep the implementation of UndoButton, and call it ReturnButton. The undo font awesome icon is more of a "reset" loop arrow, counter clockwise, and there are more usages of ReturnButton, conveying an argument for meaning and understanding too.

zepumph commented 1 year ago

Ok, this is done now. We are now using ReturnButton. I renamed local variables too except in CG because it wasn't worth the tandem name change.