chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Chainlit 2.4.400 - Pasting Content Adds an Extra Newlines Between Each Line

Open AidanShipperley opened this issue 10 months ago • 2 comments

Describe the bug

The 2.4.400 release, and specifically #2075 fixed the majority of the issues I expressed in #2032, which I greatly appreciate! Unfortunately, there seems to be one new issue with pasted content, making pasting code into Chainlit still not very feasible.

When pasting any content containing multiple lines, both code and regular text will now have additional newlines inserted between each line directly within the chat input box. This is not the same as what would happen previously, as additional newlines used to only show up in code blocks and they would only appear after sending content to the UI; they were not visible in the message composer. I tested copying from a Linux VM and a Windows VM from a Windows host machine, and both produced identical results.

To Reproduce

Copy and paste any code from an editor like VSCode or PyCharm into Chainlit's message input box. You will see the additional newlines upon pasting.

Below is a quick video showcasing the issue happening:

https://github.com/user-attachments/assets/e7fa6976-1282-4b9b-a6ca-7cb721c043a7

Expected behavior

Chainlit needs to be able to handle a user's content/code without modifying its formatting.

Desktop

  • OS: Windows 11
  • Browser Microsoft Edge
  • Version: 134.0.3124.93 (Official build) (64-bit)

AidanShipperley avatar Apr 02 '25 22:04 AidanShipperley

I found 1 similar thread that might be helpful:

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

dosubot[bot] avatar Apr 02 '25 22:04 dosubot[bot]

I now have the same extra new lines issue out of no where, running the latest version.

3eeps avatar Apr 21 '25 14:04 3eeps

Still having the same issue with 2.5.5

3eeps avatar May 06 '25 10:05 3eeps

There were a lot of bugs in V2 chat pasting typing area, this one seems to be the last one but its been there for a while now!

SeaRedm avatar May 17 '25 07:05 SeaRedm

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar Jul 27 '25 02:07 github-actions[bot]