FTXUI icon indicating copy to clipboard operation
FTXUI copied to clipboard

Dynamic text length from `ConstStringListRef::Adapter` in a `Menu` breaks rendering

Open markmandel opened this issue 6 months ago • 2 comments

So in this project, I just implemented that if you are in a voice call with someone, it puts a telephone emoji next to your name.

Image

As soon as that happens, you can see above, the rendering gets bumped over by a character - like the Menu render assumes that Menu items length won't ever change after they have been initially created.

Souce:

  • Setup of my menu: https://github.com/markmandel/discord-social-tui/blob/9b1370d812e3799bd4d1da09085190e90cf93062/src/app/app.cpp#L46-L48
  • Friend formatted name: https://github.com/markmandel/discord-social-tui/blob/9b1370d812e3799bd4d1da09085190e90cf93062/src/app/friend.cpp#L43-L67
  • Implementation of [] operation for ConstStringListRef::Adapter : https://github.com/markmandel/discord-social-tui/blob/9b1370d812e3799bd4d1da09085190e90cf93062/src/app/friend.cpp#L214-L219

markmandel avatar May 28 '25 00:05 markmandel

Oh boy! I was trying to come up with a workaround, so added the telephone to the end of everything... and it's the telephone?

Image

markmandel avatar May 28 '25 00:05 markmandel

Looks like this might be a duplicate of #929 - lemme know if it is, and I'll close this one.

markmandel avatar May 28 '25 00:05 markmandel

Thanks @markmandel , Yes this looks like a duplicate of #929.

If you know of how to fix it. I would happily merge a PR.

ArthurSonzogni avatar Jun 21 '25 07:06 ArthurSonzogni