UnigramDev/Unigram/develop • 7b2af21 • 2 files, +76/-8 Paste through a batched insert, and don't rel

Telegram github commits and releases

Telegram github commits and releases

@tgappsupdates

Broadcast from the most important Telegram clients' repositories

4,538 مشتركًا
فتح في تيليجرام
UnigramDev/Unigram/develop7b2af212 files, +76/-8
Paste through a batched insert, and don't relabel a link that is one already

The insert and the caret move that follows it each lay the document out, so they
run inside BatchDisplayUpdates.

Pasting a URL over a selection labelled it by way of SetText, which rewrote the
selection with its own text so it could re-derive a range from offsets. It sets
the link on the range directly instead, which drops two side effects: SetTextImpl
ran the text through IsLongerThanMaxLength, so replacing a selection with itself
could be truncated near the limit, and it destroyed anything hidden inside the
selection.

It no longer labels a selection that is a link already, whether it carries one or
is one. Nothing marks a typed URL as a link while composing - entities are
resolved at send - so replacing one link with another turned the old URL into the
label of a link pointing at the new one.

IsValidUrl rejects on whitespace before handing the string to the entity parser,
since it only accepts an entity spanning the whole string anyway.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

UnigramDev/Unigram/developb44e2b31 files, +122/-0
Write down what the composer review turned up

Unfixed findings in FormattedTextBox and ChatTextBox, ordered by severity, with
the ones fixed while investigating listed at the end so the file reads as the
current state. Check an item off in the same commit as its fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

UnigramDev/Unigram/develop900d34b2 files, +25/-8
Unfreeze the editor when GetFormattedText throws

It set _updateLocked, batched display updates when clearing, and undid both
after the walk - with nothing in between guarding against an exception. Any
throw left the editor frozen and UpdateCustomEmoji switched off for the rest of
the control's life, since it early-returns on _updateLocked. Neither has a
symptom that points anywhere near here.

Split into GetFormattedTextImpl the way SetText already was, so the finally
undoes both.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

UnigramDev/Unigram/develop0b4e29b2 files, +119/-80
Scope the undo group so it can't be left open

Eight Begin/EndUndoGroup pairs, none of them guarded. Anything thrown in
between left the counter standing, and UpdateFormat is gated on it reaching
zero again - so one failed TOM call anywhere in the composer stopped blockquote
font sizes being normalized for the rest of the control's life, with nothing to
point at why.

BeginUndoGroup returns a disposable scope now. InsertBlockquote takes the same
Impl split as SetText and GetFormattedText, since its pair is conditional on
batch, and InsertEmoji's display batch is guarded the same way - a group that
closes while the editor stays frozen isn't much better.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

#unigram
فتح المنشور في تيليجرام