-
Notifications
You must be signed in to change notification settings - Fork 247
Adds name filtering and text truncation for display in HomeScreen #730
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
Adds name filtering and text truncation for display in HomeScreen #730
Conversation
0e8b8f2 to
834b801
Compare
|
Tested on ThinkNode M1, looks much better. Thanks for contributing! :) I'll leave the code review for Scott. |
| } | ||
| } | ||
| dest[j] = 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method name is a bit confusing. Maybe something like 'translateUTF8toBlocks()' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
| text[--len] = 0; | ||
| } | ||
| strcat(text, ellipsis); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have actually been meaning to introduce something like this, but at the DisplayDriver level.
If you look at drawTextCentered() for instance, there is a dumb, generic impl there, but it can be overridden by sub-classes if the particular display has a better way of doing it.
Would be good to have a new DisplayDriver method, say, drawTextEllipsized(x, y, w, str) with a basic imp like above, but where display-specific could have some optimised impl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relocated; let me know if that isn't how you had intended
e555f6e to
df41257
Compare
|
Could this be refactored into a display driver helper such as Just noticed a bunch of other commits get merged/forced in. Definitely keen to see this UI improvement make it into firmware. |
|
Oh, it looks like you did that! Nice. Missed it within all those other commits :D I would definitely recommend a rebase of your branch to clean up the commit diff. |
- Add translateUTF8ToBlocks() method to convert UTF-8 characters to displayable blocks - Add drawTextEllipsized() method for text truncation with ellipsis - Apply UTF-8 filtering to node names, recent contacts, and message content - Use ellipsized text rendering for recent contacts to prevent overflow - Addresses PR feedback by moving text processing to DisplayDriver level
df41257 to
bd6aa98
Compare
|
Sorry I had to go on a choose your own adventure with git to get the PR clean again. I think it should be ready for review again now 😅 |
…-improvements Adds name filtering and text truncation for display in HomeScreen
Adds methods to replace non-ASCII characters and truncate text with ellipsis based on available width in Recent adverts. For devices like the Nano G2 Ultra, this addresses the multiple glitched characters that a single emoji would render as and instead shows "
█".Lilygo T-Echo Before and After:
Nano G2 Ultra Before and After:
Note: This doesn't address text truncation of the companion node name in the top, only in the list of recently heard adverts.