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 upBeforeAfter
Time the browser spent redoing styles15.1 s0.24 s
Longest freeze, desktop6.6 s0.05 s
Longest freeze, phone sized screen with CPU slowed 4x30 s0.2 s
Frames per second, desktop3560
Adding one piece of content to a message36 msunder 1 ms
Fixes #35444 --- src/lib/components/admin/Settings/AdminSettingRow.svelte | 6 ++++-- src/lib/components/admin/Settings/Events.svelte | 6 ++++-- src/lib/components/chat/Settings/Notifications.svelte | 6 ++++-- src/lib/components/chat/Settings/UserSettingRow.svelte | 6 ++++-- src/lib/components/common/InterfaceSettings.svelte | 5 +++-- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/lib/components/admin/Settings/AdminSettingRow.svelte b/src/lib/components/admin/Settings/AdminSettingRow.svelte index b7e03563f3..b966f7cccc 100644 --- a/src/lib/components/admin/Settings/AdminSettingRow.svelte +++ b/src/lib/components/admin/Settings/AdminSettingRow.svelte @@ -9,11 +9,13 @@ const labelId = `admin-setting-${uuidv4()}`; -
+
diff --git a/src/lib/components/admin/Settings/Events.svelte b/src/lib/components/admin/Settings/Events.svelte index 5c300d0e6a..2023f4ce98 100644 --- a/src/lib/components/admin/Settings/Events.svelte +++ b/src/lib/components/admin/Settings/Events.svelte @@ -724,14 +724,16 @@
{#each webhooks as webhook} -
+
diff --git a/src/lib/components/chat/Settings/Notifications.svelte b/src/lib/components/chat/Settings/Notifications.svelte index 0f2e530692..3b433bec1a 100644 --- a/src/lib/components/chat/Settings/Notifications.svelte +++ b/src/lib/components/chat/Settings/Notifications.svelte @@ -314,12 +314,14 @@ .filter((event) => target.events.includes(event.event)) .map((event) => $i18n.t(event.label)) .join(', ')} -
+
diff --git a/src/lib/components/chat/Settings/UserSettingRow.svelte b/src/lib/components/chat/Settings/UserSettingRow.svelte index 4389ccfc31..b44223a9bc 100644 --- a/src/lib/components/chat/Settings/UserSettingRow.svelte +++ b/src/lib/components/chat/Settings/UserSettingRow.svelte @@ -9,11 +9,13 @@ const labelId = `user-setting-${uuidv4()}`; -
+
diff --git a/src/lib/components/common/InterfaceSettings.svelte b/src/lib/components/common/InterfaceSettings.svelte index 3d5081bb70..4611e71252 100644 --- a/src/lib/components/common/InterfaceSettings.svelte +++ b/src/lib/components/common/InterfaceSettings.svelte @@ -131,9 +131,10 @@ let fontFamilyInput = ''; let showTextScaleSlider = false; let showFontFamilyInput = false; - const settingRowClass = 'group/setting-row flex items-center justify-between gap-2.5'; + const settingRowClass = + 'group/setting-row has-[button[id$=-control]:enabled]:[&_label]:cursor-pointer has-[button[id$=-control]:disabled]:[&_label]:cursor-not-allowed flex items-center justify-between gap-2.5'; const settingLabelClass = - 'min-w-0 text-xs text-base-600 group-has-[button[id$=-control]:enabled]/setting-row:cursor-pointer group-has-[button[id$=-control]:disabled]/setting-row:cursor-not-allowed transition-colors duration-150 group-hover/setting-row:text-base-900 group-focus-within/setting-row:text-base-900 dark:text-base-400 dark:group-hover/setting-row:text-white dark:group-focus-within/setting-row:text-white'; + 'min-w-0 text-xs text-base-600 transition-colors duration-150 group-hover/setting-row:text-base-900 group-focus-within/setting-row:text-base-900 dark:text-base-400 dark:group-hover/setting-row:text-white dark:group-focus-within/setting-row:text-white'; const settingControlClass = 'flex shrink-0 items-center justify-end gap-1.5'; const sectionHeadingClass = 'mt-4 text-xs text-base-600 dark:text-base-500'; const firstSectionHeadingClass = 'text-xs text-base-600 dark:text-base-500';