morethanwords/tweb/master • b185aad • 6 files, +114/-27
Stop the ESG search from freezing on a failed fetch
Reading a rejected Solid resource throws, so the effect that publishes the
results aborted before ever setting them: the previous query's results stayed
on screen with no spinner and no error, and every following query looked like
it never started. GIF search reached that state on its own - the input had no
debounce, so each keystroke was an inline bot query and typing a couple of
words earned a FLOOD_WAIT long enough to fail every search for minutes.
Follow tdesktop's gifs_list_widget for the request side: a 400ms debounce
(kSearchRequestDelay), a per-query cache that also collects the pages scrolled
into a query and is shared with the emoji category buttons, and the search bot
taken from help.getConfig's gif_search_username instead of a hardcoded @gif.
A cached query is answered synchronously and skips the debounce.
Also stop the exiting search results from being stranded when their cross-fade
animation is cancelled - Promise.all on animation.finished had no catch, so the
container was never released and every later result stacked on top of it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
morethanwords/tweb/master • 0af53a3 • 2 files, +159/-12
Stop re-rendering chatlist rows that did not change
Every dialog event — dialog_unread, dialogs_multiupdate, dialog_notify_settings,
and filter_update, which sweeps every cached dialog — runs updateDialog, which
runs the whole setLastMessage pipeline. Opening a chat fires two of them, so the
subtitle was torn down and rebuilt twice (wrapMessageForReply, custom emoji,
media thumbs and all) for a change that only cleared a badge.
setLastMessage now keeps a signature of everything the subtitle is rendered from
and skips the render when nothing moved. Since plenty of other places (community
dialogs, search results, sidebar pickers) write their own subtitle into
lastMessageSpan, a matching signature is only trusted while the rendered nodes
are still the ones in the DOM. textColor is left out of it: setDialogActiveStatus
recolors the already rendered custom emoji itself, so opening a chat must not
cost its row a re-render. The time label stays outside the guard — it is
relative to the current day.
Same story in setBadgeState, which replayed its transitions for unchanged state.
SetTransition keeps `animating` on the element for the full duration, and
.has-only-pinned-badge:not(.animating) drops the subtitle's trailing margin while
it is there, so every redundant update widened a pinned row's subtitle by 24px
and snapped it back — which reads as the ellipsis blinking. Badges whose
visibility did not change, and the only-pinned flag when it did not flip, no
longer animate.
Opening a pinned chat with unread messages: 2 subtitle rebuilds and 2 transition
passes before, 0 and 1 after.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
#webk
morethanwords/tweb/master • b185aad • 6 files, +114/-27 Stop the ESG search from freezing on a faile
Telegram github commits and releases
@tgappsupdatesBroadcast from the most important Telegram clients' repositories
4,538 مشتركًا
فتح في تيليجرام