Repository navigation
Add pasted text attachments to chat - #541
Merged
Merged
Conversation
Yavaren
marked this pull request as ready for review
September 14, 2026 09:54
Lazarus-931
approved these changes
Sep 14, 2026
Collaborator
|
@Yavaren This needs follow-ups for correctness issues: P1 — Undo can crash after IME input. Committing 你 through marked text, then undoing twice, crashes with NSRangeException. The draft snapshot and native text undo occupy separate groups, leaving a native undo operation targeting text already removed. The pre-merge editor passes the same sequence. P2 — Typing duplicates large attachments in undo history. Every edit rebuilds the full message and retains its previous value. A 1 MB paste followed by 100 characters added approximately 100 MB in an optimized fixture. Keeping attachment content separate and assembling the message when sending would simplify this and avoid the duplication. |
Collaborator
Author
|
@lucasnewman thanks, will patch asap. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes pasted text over 2,000 characters long an attachment in the UI. It does not make the text an actual attachment, and from the API standpoint, it is regular pasted text. However, if we follow this path of displaying long texts as attachments, we have way less Markdown to render, which will improve the scrolling experience. After pasting text, yon can open it in a popup and read and copy the contents.