phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Chart cell decay type should take the highest percent, not the first entry #211

Closed zepumph closed 11 months ago

zepumph commented 11 months ago

While working on #210, @Luisav1 and I found that it is awkward to hard code an index of an object's key order.

https://github.com/phetsims/build-a-nucleus/blob/92e618c77e3fe2f2e0647c36f9ca2ad5959f235c/js/chart-intro/model/NuclideChartCellModel.ts#L30-L33

Let's make this improvement so that if ever there is switch in AtomIdentifier where the keys change order, the highest percent is still going to be used.

zepumph commented 11 months ago

I think the commits above are everything.

I believe we decided that we don't need to cherry pick this into the RC because it is just for future maintenance on main.

@Luisav1 anything else here?

zepumph commented 11 months ago

Or maybe this algorithm is more dependable and we should put it into the published version. Thoughts?

zepumph commented 11 months ago

After thinking about it for 14 minutes, I think we should cherry pick this into the branch.

  1. I would want QA to tell us if we messed something up
  2. It is nice to keep the release branch as in sync to main as possible for maintainability
  3. I would consider this quite close to a bug fix, maybe it wasn't a problem for our machines, but I could imagine it would be buggy for another browser.
zepumph commented 11 months ago

For QA: We changed the algorithm for choosing the highest percentage decay type for the chart screen (which you only get one decay type for). Please poke around and just make sure you don't see any decay types in the chart that aren't the nuclide's most likely decay. We feel pretty good about this, but a spot check seems reasonable. Thanks. Feel free to close

KatieWoe commented 11 months ago

Checked all possible nucleus's on the chart screen and decay types seemed to match up. Closing.