r3bl-org/r3bl-open-core

[tuify] Use offscreen buffer from r3bl_tui to make repaints smooth

Closed this issue ยท 7 comments

Context:

The r3bl_tui crate uses OffscreenBuffer as a way to massively increase the performance of terminal repainting.

Use the OffscreenBuffer in r3bl_tuify to make repainting really fast. And w/ all this extra headroom for performance use lolcat and other enhanced styling for rendering the selection and non selection (all of these can be found in the r3bl_tui crate). For ex, we can not only use interesting emoji and other ANSI glpyhs, we can also use gradient color foregrounds and background much like you see in the r3bl_tui crate.

Here are some videos to illustrate:

I can take a look at this.

This issue is open for anyone to work on.

@e0lithic Please let me know if you have any questions about this one.

@nazmulidris Apologies for disappearing for 3 weeks, personal stuff came up ๐Ÿ˜ž.

@johnmcl001 Oh no, I hope you are doing well. Whenever you have opportunity & time & motivation, you are most welcome to start contributing again! โค๏ธ

Overview:

  • Exploration of a solution involving an inline buffer encountered challenges, particularly related to terminal resizing.

Considered Solution:

  • Created a buffer matching the required viewport dimensions.
  • Determined the buffer position in the terminal and printed it at this offset.

Constraints:

  • Major issues emerged during terminal resizing.
  • Inconsistent behaviors across different emulators, even in windowed and maximized modes.
  • Difficulty in reconciling diverse behaviors for all potential terminals.

Possible Workarounds:

  • Contemplated capturing the entire screen as a potential workaround.
  • Acknowledged that this approach falls within the domain of tui and is currently out of scope for the existing library.

@e0lithic Thank you so much for capturing this context. This has been a great area of exploration for our core technology. And thank you for leading the charge in this arena and heading into the unknown to see how far we can push this thing! Kudos! ๐ŸŽ‰

This is an excellent first PR for someone who is new to TUI and Rust! ๐Ÿ‘๐Ÿฝ ๐Ÿš€
#203

And thank you for bringing light to the resize issue. We have a fix here but it is limited in what we can achieve due to terminal restrictions.

26a3609