phetsims / vegas

Reusable game components for PhET simulations.
MIT License
1 stars 4 forks source link

Text shifts in top banner of game level with ?stringTest=dynamic #127

Closed Nancy-Salpepi closed 4 months ago

Nancy-Salpepi commented 4 months ago

Test device MacBook Air M1 chip/Dell

Operating System 14.4.1 and Win10

Browser all browsers

Problem description

For https://github.com/phetsims/qa/issues/1066 and https://github.com/phetsims/qa/issues/1067, with ?stringTest=dynamic: In a game level, pressing the right/left arrow keys causes the text in the banner to shift after a delay. Also seen in main.

I don't see this when switching locales--possibly because the shift happens before I close the Preferences dialog or maybe it is a weird thing that happens with stringTest=dynamic. I'm not sure it is worth doing anything about, but thought I would report anyway.

Steps to reproduce

  1. Add ?stringTest=dynamic to the end of the url
  2. Go to any game level and press the right arrow key 3 times (pausing in between)
  3. Press the left arrow key a few times (pausing in between)

Visuals

https://github.com/phetsims/graphing-lines/assets/87318828/999f34bc-a148-4dbb-9dda-953fc484733e

pixelzoom commented 4 months ago

Reproduced in main.

The "banner" at the top of is vegas FiniteStatusBar. So if there's something to fix here, it will be in vegas -- so transferring this issue to vegas.

If I run with the clock visible (by clicking the toggle button to the botton-left of the level-selection button) then it looks the the weird update occurs when the clock updates.

pixelzoom commented 4 months ago

The problem was definitely related to the time display (ElapsedTimeNode). It was missing dependencies on the localized strings that it uses to format the time. It wasn't reformatting the time when the strings changes, it was happening the next time the time display changed -- and hence the odd delay you were seeing.

@Nancy-Salpepi please verify in main. Then assigning back to me, while I ruminuate on whether this is worth patching for GL and GSI releases.

Nancy-Salpepi commented 4 months ago

This is fixed in main. Over to you to ruminate on.....

pixelzoom commented 4 months ago

I patched this for GL and GSI to make it easier to do any future vegas cherry picks. We'll verify https://github.com/phetsims/graphing-lines/issues/158 in the next RC, so closing this issue.