compose_paste: Convert large pasted text into uploaded text file.

When pasting a long piece of text into the compose box (or
message edit textarea), we show a banner giving an option to
put the text into a file and upload it.

The banner is only shown if the text is larger than
`MINIMUM_PASTE_SIZE_FOR_FILE_TREATMENT`.

If the user chooses to "convert to file", the textarea content is
restored to its state before pasting and a file with the pasted
content is uploaded. The banner is hidden as soon as any change is
made to the textarea content to avoid inconsistent state and
confusion.

Fixes #33107.

Co-authored-by: Aditya Chaudhary <aditya.chaudhary1558@gmail.com>
This commit is contained in:
Kislay Verma
2025-07-07 23:49:19 +05:30
committed by Tim Abbott
parent 40956ae4c5
commit e6dabb4ef4
5 changed files with 97 additions and 5 deletions

View File

@@ -80,6 +80,8 @@ IGNORED_PHRASES = [
r"email",
r"enabled",
r"signups",
# Pasted text filename
r"PastedText",
# Placeholders
r"keyword",
r"streamname",