https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
m

Mo Sobhy

06/07/2023, 7:49 AM
Hey everyone! I'm playing around with KMPP + Compose (desktop + mobile) building a markdown editor and was looking at the Notepad example here and I'm wondering about this comment:
// TextField isn't efficient for big text files, we use it for simplicity
So what would be the most efficient component for large text files? 🤔 thank you color
a

adte

06/07/2023, 9:37 AM
So what would be the most efficient component for large text files?
A "virtualized" control, so a control that only draws the text that's visible. (Kinda like a RecyclerView) The basic text field control provided by ui frameworks always keeps all the text in memory and draws all the text when painting, even when it's not visible
m

Mo Sobhy

06/07/2023, 12:42 PM
Thanks @adte, I appreciate the response. Do you happen to have (or know of) an example of this being done. I think I get the concept, but not sure about best practices. gratitude thank you
a

Adam Brown

06/07/2023, 8:42 PM
there is a BasicTextfield2 being worked on, but I don't think it addresses this specific concern.
e

efemoney

06/08/2023, 3:31 PM
Feel free to add this as a feature request for future BasicTextField(/2) consideration/optimization. soft ping @Zach Klippenstein (he/him) [MOD] 🙈
z

Zach Klippenstein (he/him) [MOD]

06/08/2023, 8:51 PM
BTF rewrite probably won’t get this sort of feature for it’s initial release at least, there’s too many other issues to address first
But supporting editing large things is on the roadmap
a

Adam Brown

06/08/2023, 10:44 PM
@Zach Klippenstein (he/him) [MOD] is BTF2 going to be available in compose 1.5.0 as experimental?
z

Zach Klippenstein (he/him) [MOD]

06/09/2023, 6:17 AM
only in the last alpha, and the 1.6 alphas. It’s not in the 1.5 beta+
3 Views