mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-05 11:07:55 -05:00
perf: typing lags while many folder chat tabs are open (#35689)
Typing in a folder chat gets sluggish once a dozen chats are open as tabs. Every key press searched the whole page for an open dialog before checking whether the key was a tab shortcut at all, and that search gets slower with every open tab. Now only the tab shortcut keys trigger the search, so normal typing skips it and the shortcuts behave as before. The table shows typing 40 characters with 12 folder chat tabs open, as the median of 8 interleaved runs per side (Chromium with 6x CPU slowdown, WebKit unthrottled). <table> <tr><th>action</th><th>browser</th><th>before</th><th>after</th></tr> <tr><td>time the page is blocked while typing</td><td>Chromium</td><td>1012 ms</td><td>79 ms</td></tr> <tr><td>time the page is blocked while typing</td><td>WebKit</td><td>2870 ms</td><td>864 ms</td></tr> <tr><td>delay from key press to screen update</td><td>Chromium</td><td>58 ms</td><td>43 ms</td></tr> <tr><td>delay from key press to screen update</td><td>WebKit</td><td>63 ms</td><td>35 ms</td></tr> </table> Fixes #35688
This commit is contained in:
1 parent
5573fca1f2
commit
259fe51cb7
1 file changed
+2
-1
@@ -1759,17 +1759,18 @@
|
||||
};
|
||||
|
||||
const handleWorkspaceShortcut = (event: KeyboardEvent) => {
|
||||
const shortcut = matchKeybinding(event);
|
||||
if (
|
||||
event.defaultPrevented ||
|
||||
event.repeat ||
|
||||
$settings?.keyboardShortcuts === false ||
|
||||
!shortcut ||
|
||||
document.querySelector('.modal, [role="alertdialog"]') ||
|
||||
(event.target instanceof Element &&
|
||||
event.target.closest('[role="dialog"], [role="menu"], [role="listbox"]'))
|
||||
)
|
||||
return;
|
||||
|
||||
const shortcut = matchKeybinding(event);
|
||||
let action: (() => void) | undefined;
|
||||
switch (shortcut) {
|
||||
case Shortcut.VOICE_NOTE:
|
||||
|
||||
Reference in new issue
Block a user