Commit Graph
932 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 33dd7dd224 refac 2026-10-09 16:17:11 +04:00
Timothy Jaeryang Baek 37138282fb refac 2026-10-09 15:54:44 +04:00
Timothy Jaeryang Baek 7d205a86dc refac 2026-10-08 23:49:38 +04:00
Timothy Jaeryang Baek 286926d299 refac 2026-10-08 21:15:42 +04:00
Timothy Jaeryang Baek 62f70a844e refac 2026-10-08 17:06:21 +04:00
Timothy Jaeryang Baek 1e9dd6e330 refac 2026-10-08 15:29:52 +04:00
Timothy Jaeryang Baek f694210fdc refac 2026-10-07 15:01:47 +04:00
Timothy Jaeryang Baek 106aae70e9 refac 2026-10-06 21:45:10 +04:00
Timothy Jaeryang Baek 67e725c198 refac 2026-10-05 12:49:22 +04:00
Timothy Jaeryang Baek 7977cdc343 refac 2026-10-05 09:46:43 +04:00
Timothy Jaeryang Baek 51f0e01258 refac 2026-10-05 09:24:43 +04:00
Classic298 c5dac0070d fix: pasted emails are sent with the same text repeated many times (#31890)
With Rich Text Input for Chat on, pasting an HTML email or newsletter into the chat input looked fine, but the sent message repeated the same text over and over as Markdown table rows. These emails are laid out with tables nested inside other tables, and the content of each inner table was counted again for every table around it. Pasted content is now sent once, and regular tables are unaffected.

Fixes #24657
2026-10-05 06:46:33 +04:00
G30 e797a44806 fix: don't bring up the keyboard when menus open or close on mobile (#31657) 2026-10-01 03:09:14 +04:00
Classic298 d09ab78fce fix: typing with an input method breaks in the empty chat input while a follow-up suggestion is shown (#31393)
After a reply, the first suggested follow-up question sits as grey ghost text in the empty chat input. Typing into it with an input method (Chinese, Japanese or Korean) broke the word being composed: on iOS the input lost focus after the first character, and in Chromium the first letter was left behind, so typing "ni" and picking "你" gave "n你". Clearing the ghost text rebuilt the input's line of text while the keyboard was still composing the word. The ghost text is now drawn over the empty input without being written into it, so input methods work again, and Tab to accept it and the follow-up buttons under the reply behave as before.

Fixes #31372
2026-09-30 19:49:49 +04:00
G30 e276d33352 fix: keep a note's pasted images when the note is rebuilt from HTML (#31513) 2026-09-30 19:47:05 +04:00
G30 8600ab9fa7 fix: keep a table cell's line breaks inside its row when converting to Markdown (#31539) 2026-09-30 19:25:38 +04:00
Classic298 b6f9679985 refac: only open web, mail, phone and relative file links (#31491)
File attachment links and the file links in code execution results now go through the same link check as links in chat messages, so only web, mail, phone and relative links are opened.
2026-09-28 01:52:15 +04:00
Timothy Jaeryang Baek fdae17f8a6 refac 2026-09-28 00:14:36 +04:00
Timothy Jaeryang Baek 8fc416ee78 refac 2026-09-27 23:15:13 +04:00
Timothy Jaeryang Baek b39abad5c2 refac 2026-09-27 23:07:52 +04:00
Timothy Jaeryang Baek ff89756b6d refac 2026-09-24 00:14:58 -04:00
G30 e67d7f9e40 fix: stop Interface settings save from overwriting the default model (#30953) 2026-09-23 23:00:41 -05:00
Classic298 e14f245586 fix: keep the M mute shortcut working during voice calls (#30421)
In voice mode, pressing M after a turn typed an "m" into the chat box instead of muting. After each voice message the chat input pulled keyboard focus back to itself, and the call overlay ignores M while focus is in a text field so typing still works.

The chat input now leaves focus alone while a call is open: clearing it after a send, the remount on the first message of a new chat and the editor's autofocus all skip focusing during a call. Clicking into the box and typing during a call still works, and outside a call the input focuses exactly as before.

Checked in a browser with a fake microphone: M mutes after the first, second and third turn, in new and existing chats; "m" typed into a focused input during a call still types.

Fixes #30406
2026-09-23 23:55:21 -04:00
Classic298 46ea826e01 refac: keep rendered diagrams and SVG on same-origin resources (#30271)
Mermaid diagrams and the shared SVG sanitizer now accept only same-origin and data: references. Image URLs, class styles and directive config are checked on the parsed diagram before it renders, and the sanitizer drops attribute values and stylesheet rules that point at another origin. use elements keep local #id references only.

SVGPanZoom and the SVG file preview call the shared sanitizer instead of keeping their own configs, so SVG artifacts and uploaded SVG files follow the same rule. Uploaded SVGs that reference external sprites now render those parts blank, which is the point of the change.

A diagram that references an external resource now reports an error instead of rendering, and an SVG artifact keeps everything except the rules that reference one.
2026-09-21 15:15:28 -04:00
Timothy Jaeryang Baek bf476452a8 chore: format 2026-09-21 11:35:30 -04:00
Classic298 488b3c571c perf: stop note co-editing echoing every remote update back to the server (#28185)
Every client in a note re-broadcasts each update it receives, with a full content snapshot attached, and the server appends each echo to the document log and writes the note again. Traffic and note writes therefore scale with the number of people who have the note open: every extra participant adds one more full echo of every keystroke.

Remote updates are now applied with the `'server'` origin the state path already uses, which the local listener ignores, so the echo stops. The echo did carry one thing worth keeping: the receiving client holds the merged document, which the sender had not seen yet, so each receiver now sends a content-only message once the edits settle, debounced 500ms, and flushes a pending one when the editor is torn down. The backend accepts an update message with no `update` field for that case, where it previously raised and dropped the save.

Replaying keystrokes at 120ms with a real Yjs document, socket messages fall 48.8% with two clients, 65.6% with three and 79.2% with five, with byte counts tracking the same on notes up to 50KB. Server-side update appends drop by a factor of the client count. The cost is one snapshot upload per receiving client per typing pause, which the server's own debounce then collapses into a single extra note write however many people are watching. A snapshot has to come from a client because the server cannot rebuild the markdown, HTML and JSON shape the note record stores. It also moves the merge 500ms later than the echo delivered it, so if two edits cross on the wire and every editor then loses its connection and closes inside that window, the note keeps what it was last sent and one of the two edits is lost. A client still connected at teardown flushes its pending snapshot, and any other editor left in the note closes the gap.
2026-09-21 08:53:27 -04:00
G30 881f7c9400 fix: save only the changed key when pinning, reordering or picking a default outside the Settings modal (#30183) 2026-09-19 17:34:02 -04:00
Classic298 6d73780fd1 fix: bundle seaborn and give black its dependencies in the Pyodide lock (#30148)
seaborn was listed among the Pyodide distribution packages, but it is not part of that distribution, so the build wrote no wheel for it. Since seaborn is on the code interpreter's package list, it was quietly downloaded from pypi.org in the user's browser instead, which is what bundling the wheels is meant to avoid. It now takes the PyPI wheel path, like openpyxl.

The code editor's Format button was broken for non-admin users, with or without internet, because black's bundled lock entry declared no dependencies and the hand-written list next to the caller was missing packaging. black's dependencies are now declared in the lock, so that list goes back to black alone and every future caller gets them too.

Both of these shipped unnoticed because nothing checked that a listed package produced a wheel. The build now fails when one did not, naming it.

Verified offline with the network cut at undici's dispatcher: seaborn, black, the Excel roundtrip and the other listed packages all install from the bundled wheels, and a deleted wheel, a missing lock entry or a non-canonical key each fail the build.

Fixes #30145
2026-09-18 19:30:54 -04:00
Timothy Jaeryang Baek 7cbaabe02f refac 2026-09-18 10:51:00 -04:00
Timothy Jaeryang Baek e69236bccb refac 2026-09-13 23:33:22 -04:00
Classic298 5af01fe604 refac: make markdown embed rendering opt-in (#29985)
The embed flag defaults to off and is now forwarded through every markdown render path, including the standalone tool-call branch, colon fences and alerts, so embeds render only where a call site opts in. Assistant responses opt in for the viewer's own chat; channel messages pass it explicitly off.
2026-09-13 20:21:00 -04:00
G30 887372aca5 fix: apply the selection highlight only when the editor is unfocused and keep it out of the chat input (#29952) 2026-09-12 16:19:09 -05:00
Timothy Jaeryang Baek 0edd731c74 refac 2026-09-12 17:11:37 -04:00
Timothy Jaeryang BaekandG30 7aaa4a692e refac
Co-Authored-By: G30 <50341825+silentoplayz@users.noreply.github.com>
2026-09-10 19:05:36 -04:00
G30 eb9b7b659f fix: render mentions whose ID contains any non-whitespace character as chips (#29864)
* fix: render channel mentions whose ID contains spaces or parentheses, such as workspace model IDs

* fix: accept any non-whitespace mention ID, matching the model ID rule on dev
2026-09-09 19:27:35 -04:00
G30 e4d65d0351 fix: close modal shortcut closes only the top modal (#29830) 2026-09-09 12:11:38 -04:00
Timothy Jaeryang Baek d8f27e745b refac 2026-09-08 13:25:16 -04:00
G30 2823bf64e1 fix: scale dropdown menu item text with the UI scale setting (#29493) 2026-09-07 13:20:43 -04:00
Classic298 7fc979f95b fix: skip embedded HTML parts and restrict link targets in docx preview (#29699)
* fix: skip embedded HTML parts in docx preview

The docx preview no longer renders altChunk parts, so an embedded HTML sub-document is omitted from the rendered output instead of being handed to the renderer.

* fix: restrict docx preview link targets to safe schemes

The docx preview kept whatever link target the document supplied, so a document could point a link at any scheme the browser understands.

After rendering, a link target is now kept only when it resolves to http, https, mailto or tel. Anything else has its target removed and the link renders as plain text. Targets resolve against the page URL, so internal bookmark links and relative targets are unaffected, while an empty target, which the renderer emits for a hyperlink with no external relationship, is dropped instead of reloading the app.

DOMPurify was not used because running it over the rendered document would strip the renderer's own markup and styling, so the check stays limited to link targets. Links using file: or Office application schemes no longer resolve.
2026-09-06 16:40:01 -04:00
Timothy Jaeryang Baek 85b11a4f35 refac 2026-09-04 23:34:32 -04:00
Timothy Jaeryang Baek 3facfa61d4 refac 2026-09-04 22:53:37 -04:00
Timothy Jaeryang Baek 858ab727d2 refac 2026-09-04 18:31:59 -04:00
Classic298 59f9502240 fix: install black's transitive deps in the pyodide code formatter (#29503)
Saving any tool or function in the admin UI threw "ModuleNotFoundError:
No module named 'click'" in the browser, even on a fresh tool with no
custom code, because the click name never appears in user code at all.

The in-browser formatter runs black through a Pyodide/micropip worker.
black needs click, mypy_extensions, pathspec, platformdirs and pytokens
at import time, but the vendored pyodide-lock.json records none of
these as black's dependencies, and micropip only walks a locked
package's declared deps when install() is given explicit constraints,
which this worker never does. So only black itself ever got installed.

Requesting the five packages explicitly alongside black fixes it
without touching the worker or the lock file.
2026-09-04 00:45:58 -04:00
Timothy Jaeryang Baek f677fdbf50 refac 2026-09-03 20:22:32 -04:00
Timothy Jaeryang Baek a6f9751401 refac 2026-08-31 01:37:36 -04:00
Classic298 89716ea880 perf: stop scanning every socket.io payload for binary data (#28180)
* perf: stop scanning every socket.io payload for binary data

Every socket.io event the backend sends was first walked recursively to check whether any value was a bytes object needing binary attachment framing. Open WebUI never emits binary, so the walk always came back empty and the work was thrown away. It has no early exit and allocates at every level, so it scaled with the full size of the message, and the messages are the big ones: chat streaming re-emits the whole assistant message on every update, note collaboration sends document state as a JSON array with one entry per byte. With the Redis manager it ran once per instance per emit on top of that, since every instance builds its own copy of the packet.

The server now installs a Packet subclass with binary events off, through python-socketio's own serializer hook, the same mechanism its msgpack serializer uses. Inbound binary attachments are decoded to int lists rather than refused, so the one frontend path that sends a raw Uint8Array keeps working and handlers can still echo client data straight back out. One scan remains in multi-instance setups: python-socketio's Redis manager calls it on the base Packet class directly, where the serializer hook cannot reach.

Measured per encode:

| payload | before | after |
|---|---|---|
| chat completion re-emit (7.5 KB JSON) | 30 us | 13 us |
| collaborative document state (292 KB JSON) | 9.0 ms | 1.7 ms |

With ENABLE_ORJSON=true, where the scan is nearly the whole encode cost: 20 us to 2.3 us, and 7.8 ms to 0.14 ms.

Closes #28164

* fix: match the other Yjs emits and send the full state as an array

Collaboration.ts sent the initial full-document state as a raw Uint8Array while the other two Yjs emit sites convert with Array.from first. socket.io framed that one as a binary attachment, so with the JSON-only packet class the server turns it into a list of ints and re-broadcasts it as JSON: a 10240-byte state update becomes 36561 JSON characters. Converting at the emit site keeps the wire form uniform across all three sites.

Also trims the JSONOnlyPacket docstring, which claimed attachments already arrive as int lists when the override is what converts them, and annotates the new reconstruct_binary parameters.
2026-08-31 01:22:06 -04:00
Timothy Jaeryang BaekandG30 b3ba6823a9 refac
Co-Authored-By: G30 <50341825+silentoplayz@users.noreply.github.com>
2026-08-30 21:41:03 -04:00
Timothy Jaeryang Baek ddc886fdc1 refac 2026-08-30 21:39:13 -04:00
Timothy Jaeryang Baek 120409ef01 refac 2026-08-30 17:45:50 -04:00
Timothy Jaeryang Baek e4694f82eb refac 2026-08-30 17:45:18 -04:00