Skip to content

fix: crisp full media for large stickers/custom emoji - #702

Open
anriltine wants to merge 1 commit into
morethanwords:masterfrom
HyperlinksSpace:fix/crisp-large-sticker-emoji
Open

fix: crisp full media for large stickers/custom emoji#702
anriltine wants to merge 1 commit into
morethanwords:masterfrom
HyperlinksSpace:fix/crisp-large-sticker-emoji

Conversation

@anriltine

Copy link
Copy Markdown

Summary

  • Prefer full Lottie/WebM document media for large sticker/custom-emoji displays (CSS size >= 64) instead of upscaling low-res photoSize thumbs when callers pass static: true.
  • Keep thumbnail/static path for tiny list slots and for true static stickers / unsupported WebM.
  • Mirrors the approach in fix: crisp full media for large stickers/custom emoji Ajaxy/telegram-tt#539 for the same class of blurry fullscreen/pack-preview emoji.

Fixes #701
Tracking: HyperlinksSpace/HyperlinksSpaceProgram#92

Test plan

  • Open an animated/custom emoji or sticker fullscreen / sticker viewer hold-preview — animation (or first crisp frame) should look sharp, not pixelated.
  • Open a sticker/emoji pack popup with large cells — animated stickers should load full media, not soft thumbs.
  • Confirm tiny inline custom emoji in message text / emoji picker lists still use lightweight thumbs (no unexpected heavy downloads for every cell).
  • Static (webp) stickers and WebM-on-unsupported-browsers still render via the static path.

Made with Cursor

Avoid forcing photoSize thumbs for large animated stickers and custom
emoji when `static: true` is set at a large CSS size, so fullscreen and
pack previews stay crisp. Tiny list slots still use thumbs.

Fixes morethanwords#701

Co-authored-by: Cursor <cursoragent@cursor.com>

@morethanwords morethanwords left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this. I do not think this patch currently fixes #701 in Web K.

The large preview path in stickerViewer.ts does not pass static: true, so asStatic is already false there and this new condition does not change its rendering. The issue itself reports Telegram Desktop on Windows; before changing the shared wrapper, please provide a Web K reproduction and identify the call site that is actually stuck on a thumbnail.

This global override also breaks the Chromium/WebM leak fallback in this same function. That fallback deliberately calls wrapSticker({...options, static: true}) to replace a stuck video with an image. At sizes >= 64 this block changes it back to non-static and creates another video, which can re-enter the same leak path instead of providing a stable fallback.

Please make full-media preference explicit at the confirmed call site (for example, a preferFullMedia option), preserve the forced-static WebM fallback, and add regression coverage for both paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants