bubble-table icon indicating copy to clipboard operation
bubble-table copied to clipboard

Cell with multi-line text does not work

Open ahmedxfn opened this issue 3 years ago • 1 comments

How to implement a cell with multi-line ?

when I added a new line in text like some text\n some other text, it appeared like this some text...

ahmedxfn avatar Jun 07 '22 16:06 ahmedxfn

This is currently by design, as there is no way to separate cells visually if they can span multiple lines. I'm cautiously open to the idea, but it will take some work to solve.

Evertras avatar Jun 07 '22 23:06 Evertras

I did some dirty cell wrapping in the bubble.Table https://github.com/charmbracelet/bubbles/pull/433 but it does not respect words. I may do a POC with reflow usage - maybe something valuable will pop out

prgres avatar Nov 23 '23 12:11 prgres

Okay, with reflow.wordwrap it looks like this

image

The issue now is that divider is a single char and it breaks layout

prgres avatar Nov 23 '23 12:11 prgres

The other issue here is that there's no way to tell that "The first table entry, ever" and "This is a really, really..." are separate rows. I'm not sure if that particular issue is solvable with this table setup by default.

Evertras avatar Nov 23 '23 12:11 Evertras

It will be more readable if the other cells in that row align to the top

prgres avatar Nov 23 '23 13:11 prgres

I have opened the PR https://github.com/Evertras/bubble-table/pull/159 let's move future conversation there

prgres avatar Nov 23 '23 13:11 prgres

In the PR I successfully implemented that but it needs a review regarding the regression in the proposed logic.

prgres avatar Nov 24 '23 12:11 prgres

Released as v0.15.6, thanks to @prgres for the work here! It's been a while so I'll close this one myself, but feel free to reopen or create a new issue if there's more to do here.

Evertras avatar Nov 26 '23 04:11 Evertras