TGViewer
Telegram github commits and releases Telegram github commits and releases @tgappsupdates · 4.49K subscribers
Post #20704 36
UnigramDev/Unigram/formatted-text-block-dates • 62ce609 • 2 files, +25/-6
Stop building the syntax colour tables per text block

_light and _dark held 28 entries each and were instance fields, so every
FormattedTextBlock in the app carried both - the chat list, replies, web page
previews, all of them - to serve the rare one that renders a code block. Color
is a value type and the tables are never written to, so they are static.

The brushes built from them can't be shared the same way, since a
DependencyObject belongs to the thread that created it and the app runs a XAML
thread per view, but they can wait until a code block asks for one.

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

UnigramDev/Unigram/formatted-text-block-dates • 1eb61cb • 2 files, +24/-7
Set the I-beam on the way in, not on every pointer move

_textSelectionIBeam was assigned and never read, so an Extended block set
CoreWindow.PointerCursor - a marshalled call, plus a CoreCursor allocation - for
every pointer sample over its text.

Testing it is not enough on its own: a Hyperlink puts its own Hand cursor up, so
once the pointer crosses one, ours is no longer what is on screen. The flag is
cleared there, or moving back onto text would skip the I-beam and leave the Hand.

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

UnigramDev/Unigram/formatted-text-block-dates • f35945b • 2 files, +31/-12
Measure an expandable quote once per width, not once per pass

MaxLines is a native text layout over the whole quote, and it ran on every
measure - so on every window resize and every InvalidateMeasure the bubble
takes - to answer a question whose inputs had not moved.

The text is compared by reference rather than by value, which is exact here:
GetParts returns the same instance until a relative date rewrites the paragraph,
and that is the one thing that can change the answer at a fixed width.

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

UnigramDev/Unigram/formatted-text-block-dates • 22a1d7a • 2 files, +42/-22
Allocate the entity collections only for text that has entities

Seven collections were built in the field initializers of a control that the
chat list, replies, web page previews and every message bubble instantiate.
Links, dates and spoilers are rare enough that those three are now null until
something is added; the active-element lists are not, because every rendered
block fills them.

All four active collections become List<T>: nothing can be added twice - each
element is newly constructed or dequeued from the pool, Recycle clears the
lists, and the one mid-render hand-back removes before it enqueues - so the
hashing bought nothing but the cost of a Contains that runs once per code block.

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

#unigram
More from @tgappsupdates
  1. Oct 11, 2026New TGX-Android/Telegram-X release: v0.29.1.1817 (stable) **Telegram X** `0.29.1.1817` has…
  2. Oct 10, 2026Assets for release v7.3.1 of telegramdesktop/tdesktop: • Windows on ARM: Portable • Window…
  3. Oct 10, 2026telegramdesktop/tdesktop/dev • 4b529b9 • 2 files, +63/-34 Added grouping of webpage photo…
  4. Oct 10, 2026New telegramdesktop/tdesktop release: v7.3.1 (stable) - Fix wallet encryption with Windows…
  5. Oct 10, 2026UnigramDev/Unigram/develop • bab9f3c • 3 files, +52/-17 Use sticky headers in folder setti…
  6. Oct 10, 2026UnigramDev/Unigram/develop • b39b5d1 • 1 files, +18/-0 vcpkg fix UnigramDev/Unigram/develo…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →