From bde9278693b72f5c9a9bcff008a4a2185afdaf6d Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 1 Dec 2026 16:58:39 +0100 Subject: [PATCH] fix: chat freezes for seconds when scrolling inside an inline PDF preview (#35452) Scrolling inside a PDF shown inline in a chat froze the whole page for seconds at a time, on phones and on desktop, and long chats had it worst. The cause was not in the PDF preview. A style rule meant only for the settings pages was active on every page and made the browser redo the styling of a whole chat message each time a piece of content was added to it, which a PDF preview does well over a hundred times per page. That rule only decides whether the mouse pointer turns into a hand over the name of a setting, and it is now written so that it no longer costs anything noticeable outside the settings pages. The settings look and behave as before.
| Long chat with three inline PDFs, scrolling one PDF down and back up | Before | After |
|---|---|---|
| Time the browser spent redoing styles | 15.1 s | 0.24 s |
| Longest freeze, desktop | 6.6 s | 0.05 s |
| Longest freeze, phone sized screen with CPU slowed 4x | 30 s | 0.2 s |
| Frames per second, desktop | 35 | 60 |
| Adding one piece of content to a message | 36 ms | under 1 ms |