phetsims / hookes-law

"Hooke's Law" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 4 forks source link

Value above leftAppliedForceVector can get cut off in smaller window sizes #104

Closed Nancy-Salpepi closed 1 month ago

Nancy-Salpepi commented 1 month ago

Test device MacBook Air M1 chip and Dell

Operating System MacOS 14.5 and Win10

Browser Chrome

Problem description This is an edge case: For https://github.com/phetsims/qa/issues/1104, on the Systems Screen when the springs are in series the '1' in '100.0' above the Left Applied Force Vector can get cut off. This doesn't happen in published because it doesn't have the zero in the tenths place.

Steps to reproduce

  1. Go to the Springs Screen
  2. Select the Springs in Series
  3. Check Spring Force checkbox
  4. Select Components radio button
  5. Check Value Checkbox
  6. Set the Applied Force to -100.0 N
  7. Grab the left side of the window and move it to the right

Visuals RC:

Screenshot 2024-07-10 at 3 48 37 PM

Published:

Screenshot 2024-07-10 at 3 49 31 PM
Nancy-Salpepi commented 1 month ago

This also happens with longer strings using ?stringTest=dynamic

Screenshot 2024-07-10 at 4 19 47 PM
pixelzoom commented 1 month ago

This is actually a problem with the default window size. And when "Values" are off, you also can't see how long the vector is because it extends off the left edge of the screen, so you can't make a qualitative comparison of vector lengths.

I'm pretty sure that this has come up before, and we decided to live with it (but I can't find a paper trail). The goal of the 1.1 release is to republish this sim without new problems, and this is not a new problem. So my recommendation is to do nothing.

That said...There's nothing practical that we can do to ensure that we can always see the entire vector -- that would require leaving a lot of blank space to the left of the spring system. We could ensure that we always see the vector value by putting values closer to the vector tail, rather than centering them on the vector. That would need to be done uniformly for all vectors, not by somehow detecting when a value will be off-screen. And it might look a little odd. It also won't address the ?stringTest=dynamic case shown above, but that will not occur in practice.

@arouinfar thoughts?

pixelzoom commented 1 month ago

@arouinfar and I met about this, and we found a decent compromise. On the Systems screen, we simply moved the entire spring system a bit to the right, so that the entire vector value is visible in the worst-case scenario. See screenshot below with ?dev.

Note that we decided not to make any changes to the other 2 screens, so the "wall" that the spring(s) connect to is not always in the same position when switching screens. And we're not worrying about the ?stringTest=dynamic case, because units are not likely to be super long in practice.

@Nancy-Salpepi please review. If it looks OK, unassign yourself, and we'll verify in 1.1.0-rc.2.

screenshot_3414
Nancy-Salpepi commented 1 month ago

Looks good in main.

pixelzoom commented 1 month ago

Ready for verification in https://github.com/phetsims/qa/issues/1112. Please close if OK.

Nancy-Salpepi commented 1 month ago

This is fixed in rc.2. Closing.