morethanwords/tweb/master • 00c1e1a • 1 files, +64/-52
Render the hh:mm fast path through the cached Intl formatter
Replace the hand-built zero-padded string + amPmCache day-period snapshot
in IntlDateElement.update() with formatTimeString(): the cached
{hour: '2-digit', minute: '2-digit'} formatter (the locale already
carries -u-hc-h12/h23) plus a per-minute-of-day memo. This deletes
updateAmPm/amPmCache entirely and fixes the residual half-localization —
native digits for fa/my, locale time separators for fi/da/id — while the
other locales stay byte-identical.
Perf stays at hand-built parity (~36ns vs ~24ns per render; raw cached
format() is ~560ns): rendered strings are memoized by hours*60+minutes in
a WeakMap keyed by the formatter instance, so the memo dies with it
whenever cachedDateTimeFormats is cleared, with no extra invalidation
wiring. A new memo pre-renders all 1440 minutes in chunked idle tasks
(bailing if its generation is orphaned by a locale/format change), so
batches of distinct times — 30+ bubbles, shared media — never pay for
Intl after warmup. The prewarm skips DST-hole wall times, leaving them to
the lazy path, which is always self-consistent for real dates.
Also: setTimeFormat now drops cached formatters on the first call too
(they carry no -u-hc- before timeFormat is known), and getDateTimeFormat
no longer builds an invalid language tag while timeFormat is undefined.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
morethanwords/tweb/master • f73102e • 4 files, +154/-33
Explain an unknown sender's emoji status in the actions plate
A stranger writing to us can wear a badge next to their name, and nothing said
what it was — easy to read as a verification mark. Add the note the other
clients show: a line under the contact-status buttons naming the badge and
pointing at Premium.
Only a badge that carries information is worth the line: a collectible, or a
custom emoji of the sender's own. The recolorable ones every subscriber picks
from say nothing, which is the `text_color` attribute here and the coloredSetId
check in tdesktop. Resolving the document can hit the network, so it runs after
the plate is up rather than on the chat-open path — the note appears once it
lands — and it is gated to the states where we are deciding about a stranger,
so no Premium promo turns up under the topic-reopen or set-photo prompts.
Layout: the note goes below the buttons, not above. The cross belongs with the
buttons (it dismisses the bar), and the note is a two-line footnote rather than
a caption for the action the way the fee notice is, so putting it on top would
push the buttons away from the topbar. The plate is a column now with the
buttons in a row of their own; `flex-wrap` would have dropped the cross onto a
line of its own once `is-multiple` makes it a flex item.
The text styling is shared with the fee notice rather than copied, and the
badge needs three overrides to sit in a sentence: it is a `display: flex` box
built to be a flex item beside the peer title, carrying a margin meant for that
spot. The Premium link carries no href, so it needs its own cursor to beat the
`cursor: default` the plate inherits from `.sidebar-header`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
#webk
morethanwords/tweb/master • 00c1e1a • 1 files, +64/-52 Render the hh:mm fast path through the cached
Telegram github commits and releases
@tgappsupdatesBroadcast from the most important Telegram clients' repositories
4,538 subscribers
Open in Telegram