phetsims / gravity-and-orbits

"Gravity And Orbits" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
12 stars 6 forks source link

Time display looks jumpy #463

Closed Nancy-Salpepi closed 1 year ago

Nancy-Salpepi commented 1 year ago

Test device MacBook Air (m1 chip)

Operating System macOS 12.6

Browser safari 16.0

Problem description For https://github.com/phetsims/qa/issues/841, I noticed that the grammar was fixed for the time displayed (1 earth day instead of days or 1 earth minute instead of minutes) between RC.2 and RC.3. This makes the time look a little jumpy when you first press Play. I was wondering if there is anything that can be done to prevent the entire time from shifting when an 's' is added/removed?

Visuals

https://user-images.githubusercontent.com/87318828/194378174-9e3d4ce4-73ff-44ca-b950-474d714c229b.mp4

Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Gravity and Orbits‬ URL: https://phet-dev.colorado.edu/html/gravity-and-orbits/1.6.0-rc.3/phet/gravity-and-orbits_all_phet.html Version: 1.6.0-rc.3 2022-10-06 04:17:15 UTC Features missing: applicationcache, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Language: en-US Window: 1324x702 Pixel Ratio: 2/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 (1.0) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}
samreid commented 1 year ago

@arouinfar how do you want to address this? Should the text be left aligned? Do you just want it to say "1 Earth Days"? I'm not sure of a robust way to make sure the "1 Earth day" has the same left coordinate as "2 Earth days". Keep in mind our solution needs to be robust against locale changes and phet-io text customization.

arouinfar commented 1 year ago

@samreid I am fine with always using the plural Days/Minutes to avoid the jumpy behavior. Keep in mind that if we get rid of the singular forms, we should get rid of their string keys in #438.

samreid commented 1 year ago

Fixed and ready for cherry-picking.

samreid commented 1 year ago

Please close after verifying.

Nancy-Salpepi commented 1 year ago

Looks good in 1.6.0-rc.4. Closing.