deep-chat icon indicating copy to clipboard operation
deep-chat copied to clipboard

BUG: Line breaks are not maintained in chat

Open tasdflkjweio opened this issue 1 year ago • 7 comments

When I type a message into that input that looks like...

This is my first line in my first paragraph....and then i start a list:
- An item
- An item
- An item

Then a new paragraph

Line breaks are removed when shown in the message area:

This is my first line in my first paragraph....and then i start a list:- An item- An item- An itemThen a new paragraph

tasdflkjweio avatar Apr 09 '24 19:04 tasdflkjweio

Hi @tasdflkjweio, I will investigate this bug shortly and report to you on the progress.

OvidijusParsiunas avatar Apr 10 '24 00:04 OvidijusParsiunas

Hi @tasdflkjweio. This issue has now been fixed in deep-chat-dev and deep-chat-react-dev package versions 9.0.163.

Please note that the user message is parsed by the Remarkable library (just like the ai response messages), so the line (-) syntax will be re-formated to be a bullet point, would this be problematic?

Let me know, thanks!

OvidijusParsiunas avatar Apr 10 '24 20:04 OvidijusParsiunas

had a chaotic couple days at work so just checking this out now.

so the line (-) syntax will be re-formated to be a bullet point, would this be problematic? thanks for asking, it should be fine.

i'll test it out today and let you know soon

tasdflkjweio avatar Apr 12 '24 17:04 tasdflkjweio

Alright, tested and it's a little better but a bit off still.

Example 1:

line 1
line 2
line 3
line 4
- bullet 1
- bullet 2
line 5

is formatted as: image

Example 2:

line 1
line 2
line 3

line 4

- bullet 1
- bullet 2


line 5

line 6
line 7

is formatted as: image

tasdflkjweio avatar Apr 12 '24 20:04 tasdflkjweio

Ah i see - it seems Remarkable is expecting CommonMark format. Hrm

tasdflkjweio avatar Apr 12 '24 20:04 tasdflkjweio

The breaks flag seems to improve this some. Line 5 is off, but everything else seems good: image

The second example seems better: image

That's presumably what you've enabled tho?

tasdflkjweio avatar Apr 12 '24 20:04 tasdflkjweio

Hi @tasdflkjweio.

Deep Chat uses the Remarkable library's defaults to format text. This way the user will not experience any unexpected behaviour.

To note, if the parent application imports the highlight.js module as an external dependency, we specifically set the configuration to help with coding syntax.

The code can be found here.

OvidijusParsiunas avatar Apr 13 '24 00:04 OvidijusParsiunas

@OvidijusParsiunas When can we expect the next update to the non-dev package? Would love to see this in deep-chat-react (as well as other fixes/improvements I've seen made to the dev package in recent months)!

jbrachtie avatar Jun 28 '24 22:06 jbrachtie

Hi @jbrachtie I share your frustration and want to get the big new update out of the way ASAP! I have set myself with a deadline of 11th of July, so if nothing else jumps up in the interim - expect a big update very soon!

OvidijusParsiunas avatar Jun 28 '24 22:06 OvidijusParsiunas

@OvidijusParsiunas oh wow! Great to know, and certainly understand the effort to get such a big update out. I know a lot has gone into dev since the last release. Thanks for the quick reply and very excited about the next big update :)

jbrachtie avatar Jun 28 '24 23:06 jbrachtie

Hi folks. It appears that my previous solution causes strange space issues when rendering code. I have changed the Remarkable configuration to now always use the breaks option mentioned by by @tasdflkjweio.

The fix is available in deep-chat-dev and deep-chat-react-dev versions 9.0.185, let me know if this causes issues for anyone. Thanyou!

OvidijusParsiunas avatar Jul 03 '24 12:07 OvidijusParsiunas

Hi, everything mentioned in this issue has now been released in Deep Chat version 2.0.0.

OvidijusParsiunas avatar Jul 16 '24 12:07 OvidijusParsiunas