phetsims / natural-selection

"Natural Selection" is an educational simulation in HTML5, by PhET Interactive Simulations
GNU General Public License v3.0
3 stars 7 forks source link

Problem with generation spinner in Proportions chart #299

Closed stemilymill closed 3 years ago

stemilymill commented 3 years ago

Test device Chromebook

Operating System Chrome OS 90.0.4430.218

Browser Chrome 90.0.4430.218

Problem description For https://github.com/phetsims/qa/issues/662 During a double string test, when the generation number reaches triple digits the beginning and end of the string get cut off by the generation scroll buttons in the proportions graph panel

Steps to reproduce Select Intro screen Establish a stable population (for instance, brown fur dominant, wolves, limited food) Select Proportions graph panel Run simulation until it reaches the 100th generation

Visuals gen 100 g and 0 get cut off double stringtest

Link to video (zoomed in more) https://drive.google.com/file/d/16kJ7xpcOb81HlC6Q8cpJbF9tPIMqPCDl/view?usp=sharing

Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Natural Selection‬ URL: https://phet-dev.colorado.edu/html/natural-selection/1.4.0-rc.1/phet/natural-selection_all_phet.html Version: 1.4.0-rc.1 2021-06-21 23:54:30 UTC Features missing: applicationcache, csstransforms3d, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (X11; CrOS aarch64 13904.77.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.147 Safari/537.36 Language: en-US Window: 1300x612 Pixel Ratio: 1.0499999523162842/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 15 uniform: 1024 Texture: size: 8192 imageUnits: 16 (vertex: 16, combined: 96) Max viewport: 8192x8192 OES_texture_float: true Dependencies JSON: {}

pixelzoom commented 3 years ago

This is a general problem with NumberSpinner -- it doesn't account for a dynamic range -- so I've reported it in https://github.com/phetsims/sun/issues/709. And it can happen without ?stringTest.

In Natural Selection, you can see how we gradually lose horizontal spacing as the generation number gains digits. With 1 digit:

screenshot_1045

2 digits:

screenshot_1046

3 digits:

screenshot_1044

It won't become a problem until we reach 1000. That's the max generation, and the sim will then stop. When we hit 1000, there will be some overlap of the "Generation 1000" with the buttons, as @stemilymill reported above.

A couple of options for the 1.4 release, with estimates:

(1) Ignore this problem since (in pratice) it only occurs at 1000. Estimate=0. (2) Add more space horizontal space in sim-specific code, so it won't be a problem for 1000. Estimate = 20 minutes. (3) Address the NumberSpinner issue, patch the release branch, etc. Estimate = 3 hours.

@amanda-phet which option would you prefer?

pixelzoom commented 3 years ago

(3) Address the NumberSpinner issue, patch the release branch, etc. Estimate = 3 hours.

I went with this option, because I thought of an easier way to address it. By the time I finish patching the 1.4 release branch, it will probably have taken me 45 minutes.

pixelzoom commented 3 years ago

Patch in sun 'natural-selection-1.4' and natural-selection '1.4' branches.

Ready for testing in next 1.4 RC.

pixelzoom commented 3 years ago

To verify in RC testing:

  1. Run the sim
  2. Select Intro screen
  3. Establish a stable population (for instance, brown fur dominant, wolves, limited food)
  4. Select Proportions graph panel
  5. Each time the Generation number gains a digit (e.g. 9 > 10, 99 > 100, 999 > 1000 ) you'll see that the space between the arrow buttons and "Generation {number}" remains constant, the arrow buttons move out a bit, and the control remains centered under the graph.
KatieWoe commented 3 years ago

Things look ok in rc.2