membrane

genekim 2025-01-12T22:30:23.592999Z

Hi, @smith.adriane — is there any sample code on how to emulate an HTML textarea input box, where you can edit text across multiple lines? I’m trying to build something that assembles a bunch of LLM prompts, and just need textareas to put text in, and some buttons trigger actions. Thank you!!!!

genekim 2025-01-12T22:32:44.837919Z

Literally the equivalent to https://www.w3schools.com/tags/tag_textarea.asp Is something like this available in Skia? Or maybe in Cljfx? Thx!

phronmophobic 2025-01-12T22:49:18.842579Z

There's membrane.basic-components/textarea, but you do have to opt into the membrane.component stuff

phronmophobic 2025-01-12T22:50:17.466009Z

https://github.com/phronmophobic/membrane/blob/master/src/membrane/example/todo.cljc may be a good starting point

genekim 2025-01-13T00:04:10.307559Z

Thx so much! I was just studying the TODO example — is there a way to set the # of rows or vertical size of the textarea? (Or do you do it by putting it in a layout object?) Keep up all the amazing work!

phronmophobic 2025-01-13T00:12:17.609669Z

Not currently.

genekim 2025-01-13T00:12:41.679859Z

Roger roger!!!

genekim 2025-01-13T00:12:46.348669Z

And thx!

phronmophobic 2025-01-13T00:13:52.441309Z

Are you just trying to make it easier to click to focus? Or just a minimum size?

genekim 2025-01-13T00:18:28.069609Z

Some prompt elements might be thousands of lines, so I'd want to set {:rows 50} or even 20. Others prompt elements are super intricate, and I'd want to user to have 50 lines to see a bigger part of the prompt. In my ideal, a starting layout would be: • column left ◦ user prompt: 50 lines ◦ user context: 10 line (might be quite large, not mostly paste and forget) ◦ project prompt: 20 lines ◦ project context: 10 lines (thousands of lines: paste and forget) • column right ◦ response from Claude: 50 lines (entire vertical space of window) Purely FYI — just trying to find the easiest way to write an app like this.

phronmophobic 2025-01-13T00:22:01.833529Z

Ok, it's helpful to know what folks are trying to do to help prioritize future development. A text input designed for editing thousands of lines of text is currently beyond the scope of any of the builtin components. It's something I would eventually like to have, but it doesn't exist yet.

phronmophobic 2025-01-13T00:24:24.801469Z

Editing dozens of lines of text is workable. You can wrap the textarea in a scrollview to limit the size.

phronmophobic 2025-01-13T00:25:43.901219Z

It would also be possible to make a component that is a text input for <50 lines of text and becomes a component that shows the first 20 lines (non-editable) otherwise.

phronmophobic 2025-01-13T00:41:21.218409Z

I realize that might not be enough to fit your requirements, but happy to help try to make it work if you're interested.