-
-
Notifications
You must be signed in to change notification settings - Fork 670
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
Menu item text gets hidden if it is too long #4019
Comments
UI tests pass with the local hack, which just unconditionally runs the first branch in the above code. This tells me that the other branches are dead code. |
Taken from
Or rather the menu is not walked-through in UI tests? |
Indeed, not all menus are tested. But what is worse? I don't see a case for a menu item with no text - a menu item with incomplete text is certainly better. So, I see 3 issues here:
|
agreed, or @mmilata @obrusvit do you know of a case where we want to render icon without text?
we can crash in debug mode, if detecting this is easy at run-time. i'm not sure about that, @obrusvit @mmilata can you advise? |
nope
Seems to be easy in this particular case since we already have the widths in variables? For general case we'd probably have to extend the text renderer. Or perhaps graphics driver to detect drawing off-screen, but that sounds like it will have its own problems. |
Right, it was a silly question from my side to start with. That's what the if in question does - detect when the text does not fit and hide the text. So it knows it does not fit. |
On the other hand, I am thinking what is the gain of crashing if the menus are not walked-through by the tests / CI anyway. There is a very slim chance somebody will manually get to that point while testing, and if they do, they will still notice the menu looks bad, no? Crashing at that point will just annoy somebody that is trying to do something unrelated. So maybe the best way is to simply show the incomplete text? |
Most probably, as on every other places. |
a lot of tests actually do involve menus the point of this is to crash if a translation causes a menu item to not render; we don't really check all languages screen by screen, so the crash will indicate that some translation string doesn't fit and we need to change it |
Yes, but then shouldn't you have seen some UI tests diffs when you disabled the other branches? |
i didn't run all the languages |
OK, I'll do that then and see what happens. The way it is now is very bad, anyway. |
@lapohoda I think we can do the multiline items, right? |
Describe the bug
problem:
after a local hacky fix:
offending code:
trezor-firmware/core/embed/rust/src/ui/model_mercury/component/button.rs
Lines 624 to 635 in 7005129
Why do we even have this? ISTM we should default to showing both icon and text in all cases.
To reproduce
trezorctl btc get-address -n m/44h/0h/0h/0/0 -d
then click the menu
The text was updated successfully, but these errors were encountered: