Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox text labels handling large dynamic strings differently #283

Closed
marlitas opened this issue Mar 13, 2023 · 3 comments
Closed

Checkbox text labels handling large dynamic strings differently #283

marlitas opened this issue Mar 13, 2023 · 3 comments

Comments

@marlitas
Copy link
Contributor

From #268.

One seems to be limiting based on a maxTextWidth and another seems to be using multiple lines in Rich Text to overflow the large string. This is probably due to the fact that "Reference Line" has a space in the string which allows it to be added onto a new line.

I'm unsure how frequently we would run into this situation, but it seemed visually bizarre enough to create an issue to put eyes on it.

Screenshot 2023-03-13 at 2 56 34 PM

@marlitas
Copy link
Contributor Author

marlitas commented Mar 13, 2023

In the integral, advanced and lab screens I also noticed the grid checkbox icon can collide or completely disappear into the menu bar with longer strings.

Screenshot 2023-03-13 at 3 11 19 PM

@pixelzoom
Copy link
Contributor

pixelzoom commented Mar 14, 2023

TangentLineCheckbox, AreaUnderCurveCheckbox, and ReferenceLineCheckbox are in fact handling their strings identically -- they all use RichText, and allow the client to use whatever markup they want.

If you change "Tangent" to "Tangent<br>Line" in calculus-grapher-strings_en.json, you'll see that it behaves the same as the other checkboxes:

screenshot_2414

Or change "Reference<br>Line" to "Reference Line", and you'll see:

screenshot_2415

Using RichText anywhere in a sim does bring up the possibililty that the string height (not just its width) may become problematic. Maybe it's a bad assumption, but we assume that translators tests their work, and would notice a case like #283 (comment). But as a bit of defensive programming, I've added maxHeight to the RichText checkbox labels in the above commits.

Back to @marlitas for review, close if OK.

@marlitas
Copy link
Contributor Author

Looks much better and feels like a better safe guard. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants