phetsims / joist

Joist is the main framework for PhET Interactive Simulations. Joist creates and displays the simulation content, home screen, navigation bar, About dialog, enables switching between tabs, and other framework-related features.
MIT License
8 stars 6 forks source link

Long sim title strings break layout on single-screen sims #863

Closed jonathanolson closed 1 year ago

jonathanolson commented 1 year ago

To reproduce:

  1. Run a single-screen sim (e.g. WOAS) with &stringTest=asrtalasrkntalskrntalskrntalksrntlaksrntlaksrntalskrntalksrntaaslrtknaslrktnalsrktnalsrktnalskrntalksrntalskrntalskrntalksrntalskrnt

The title will overshoot the PhET button:

image

Presumably we'll need a maxWidth for this

jonathanolson commented 1 year ago

In NavigationBar, we're subtracting by this.a11yButtonsHBox.width, which in this sim's case happens to have no bounds (thus its width is -Infinity), thus the maxWidth becomes +Infinity.

jonathanolson commented 1 year ago

@marlitas could you review this change?

marlitas commented 1 year ago

Looking through this I pulled up Waves on a String to test the functionality, and while using the helper dialog I hit an assertion when looking for the A11yButtonsHBox. It seems buggy to me that A11yButtonsHBox would have no bounds. If the HBox has no content its bounds should reflect that as 0.

marlitas commented 1 year ago

Talked through my questions with @jonathanolson. Feels good to close!