Commit Graph
7726 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 254e29b9af refac 2026-09-08 13:19:14 -04:00
Timothy Jaeryang Baek e723dcda58 refac 2026-09-08 01:45:35 -04:00
Timothy Jaeryang Baek 98a920168e refac 2026-09-07 14:46:52 -04:00
Timothy Jaeryang Baek 675b9839f1 refac 2026-09-07 13:26:30 -04:00
G30 d49e424874 fix: enable ask_user submit when the last question uses the other field (#29494) 2026-09-07 13:21:12 -04:00
G30 2823bf64e1 fix: scale dropdown menu item text with the UI scale setting (#29493) 2026-09-07 13:20:43 -04:00
Timothy Jaeryang Baek 9e634c0c56 refac 2026-09-07 13:19:16 -04:00
Timothy Jaeryang Baek e1bfefdf9f refac 2026-09-07 13:13:25 -04:00
Timothy Jaeryang Baek f9f815c862 refac 2026-09-07 12:21:23 -04:00
Timothy Jaeryang Baek 3cda47cdb4 refac 2026-09-07 12:16:09 -04:00
G30 3aabbfebfe fix: wait for a pending note save before navigating away (#29745) 2026-09-07 11:26:45 -04:00
Timothy Jaeryang Baek 3795d5b292 refac 2026-09-06 19:37:59 -04:00
Timothy Jaeryang Baek 57fc344873 refac 2026-09-06 18:30:00 -04:00
Timothy Jaeryang Baek de1203f9b5 refac 2026-09-06 17:46:35 -04:00
Timothy Jaeryang Baek f3eade42ae refac 2026-09-06 17:43:17 -04:00
Timothy Jaeryang Baek 508de20779 refac 2026-09-06 17:27:30 -04:00
Timothy Jaeryang Baek 0fa4dea5ff refac 2026-09-06 17:21:57 -04:00
Timothy Jaeryang Baek d27aa72ab4 refac 2026-09-06 17:13:32 -04:00
Timothy Jaeryang Baek c4a349651e refac 2026-09-06 17:10:01 -04:00
Classic298 831b3b0df2 refac: validate the citation embed URL before use (#29701)
A citation's embed_url now has to be an http or https URL, or protocol-relative, before it is opened or handed to the embed panel. Anything else falls back to the citation modal, which already renders the source.
2026-09-06 16:54:44 -04:00
Timothy Jaeryang Baek cb942bb94c refac 2026-09-06 16:48:30 -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
G30 ffe6ab9869 fix: stop the note editor date reading as a button (#29708) 2026-09-06 15:31:47 -04:00
Classic298 a3c90e5aac fix: blank chat messages on iOS home screen apps and in-app browsers (#29734)
Chat messages are virtualized with content-visibility: auto, which WebKit paints incorrectly and can leave blank. #26805 skipped that on Safari by looking for the Safari token in the user agent, but iOS in-app browsers, home screen apps and iPadOS desktop-class standalone windows send no such token, so those users still get empty assistant responses.

Check the navigator vendor string as well, which every WebKit surface reports regardless of user agent. The user agent check stays, because non-Apple WebKit ports can compile a different vendor string while shipping the same paint bug.

That earlier fix also withheld the message-listitem class entirely, and the class doubles as the styling hook the sidebar hover preview reaches through, so hover previews have rendered at full chat spacing and width on Safari since v0.11.0. Only the content-visibility rule is gated now, on its own class, and the hook stays on every message. Safari hover previews become compact like every other engine.

Verified across fourteen engine cases: virtualization is off on every Apple WebKit surface, unchanged on Chromium, Firefox and Android, the hover preview overrides apply again on Safari, and the screenshot export still captures every message on both.

Refs #26712, #29688
2026-09-06 15:21:09 -04:00
Timothy Jaeryang Baek 85b11a4f35 refac 2026-09-04 23:34:32 -04:00
Timothy Jaeryang Baek 54a7a7a7ce refac 2026-09-04 22:56:00 -04:00
Timothy Jaeryang Baek 3facfa61d4 refac 2026-09-04 22:53:37 -04:00
Timothy Jaeryang Baek 67ac1a4e93 refac 2026-09-04 19:12:41 -04:00
Timothy Jaeryang Baek 858ab727d2 refac 2026-09-04 18:31:59 -04:00
Timothy Jaeryang Baek 7b6562e335 refac 2026-09-04 17:39:34 -04:00
Classic298 323f8da202 fix: show relevance badge for single-source citations (#29647)
A response with exactly one citation never showed its relevance badge, even though the source carried a perfectly valid score. Adding a second citation made the badge appear for that same source, so the score looked like it came and went at random.

calculateShowRelevance hides relevance when a result set mixes distance metrics (cosine in -1..1 next to unbounded L2), since those numbers are not comparable. With a single distance that check degenerates: distances.length - 1 is 0, so the "all but one are out of range" clause matches whatever the value is, and the score is hidden. A lone distance cannot be a mix of two metrics, so it now returns before the outlier check runs.

Sets of two or more distances behave exactly as before, mixed-metric sets are still suppressed.

Fixes #29646
2026-09-04 17:17:14 -04:00
G30 4f419627f8 fix: remove the stray background band from the Attach Webpage modal footer (#29664) 2026-09-04 17:16:47 -04:00
G30 b49db6f287 fix: stop the browser back button creating extra notes (#29645) 2026-09-04 15:54:10 -04:00
G30 cc14f3dac0 fix: report version check failures instead of claiming latest (#29626)
GET /api/version/updates returned the running version as latest whenever
the GitHub request failed, so an instance that cannot reach GitHub
reported itself up to date however far behind it was. The exception was
logged at debug, below the default level, so nothing recorded that the
check never happened.

The failure path now returns latest: None and logs at warning.

A null latest cannot be passed to compareVersion as it stood.
current.localeCompare(null) coerces to the string "null", and "0.10.2"
sorts before it, so the function returned true. The backend change alone
would have turned a false (latest) into a false update-available plus a
toast, so the guard is part of the fix.

The three callers stop substituting the running version in their catch,
and the two badge surfaces gain a third state. When latest is unknown
the badge is plain text, since there is no release to link to.

Admin Settings > General was wrong in a worse way than reported: it
initialised updateAvailable false with latest set to the running
version, and never checked on mount, so it claimed (latest) having made
no request at all. It now matches About.svelte, which starts unknown and
checks on mount.

Closes #29580
2026-09-04 11:39:52 -04:00
G30 0b804c5316 feat: shift quick delete for notes in list and grid views (#29635) 2026-09-04 11:27:57 -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 237b11c6d9 refac 2026-09-03 20:26:40 -04:00
Timothy Jaeryang Baek f677fdbf50 refac 2026-09-03 20:22:32 -04:00
Timothy Jaeryang Baek cffd734a18 refac 2026-09-03 16:18:39 -04:00
Timothy Jaeryang Baek 1457000ba6 refac 2026-08-31 10:27:01 -04:00
Timothy Jaeryang Baek 471b5cbbb1 refac 2026-08-31 01:41:17 -04:00
Timothy Jaeryang Baek a6f9751401 refac 2026-08-31 01:37:36 -04:00
Timothy Jaeryang Baek 2daa610cba refac 2026-08-31 01:28:40 -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
Classic298 b75e2670b7 fix: keep a custom recurrence rule when the editor reopens it (#29260)
Loading an automation whose rule the visual controls cannot represent switched the schedule to Custom but left the bookkeeping the seeding block reads on the previous value, so that block immediately replaced the rule with a freshly built default. The rule was lost when the editor opened, before anything was saved, and cloning carried the default across as well. Recording the switch alongside it leaves the stored rule in place.

Verified in a browser against the same build without this line: a minutely rule and a yearly rule now survive reopen and save byte for byte, cloning keeps the original, and every schedule the editor itself produces, along with switching to Custom by hand, behaves exactly as before.
2026-08-31 00:08:28 -05:00
Classic298 188fc83a79 fix: surface files the browser cannot read during a knowledge base directory sync (#29135)
* fix: surface files the browser cannot read during a knowledge base directory sync

Syncing a local folder into a knowledge base could fail with nothing but "Error accessing directory": no failing file name, no network request, no server log, and no console output either, because production builds strip console.error. On Windows this happens once the absolute path of a file passes the platform limit, at which point the browser refuses to open a file it just listed.

The directory scan now handles that per file. It names the first failing path and how many files are affected, and stops before anything is uploaded. Stopping is the point: a file missing from the manifest is treated as deleted by the sync, so continuing would remove the knowledge base copy of a file that still exists on disk.

Dragging a folder in hit the same failure and reported nothing at all, and the Firefox picker path returned its promise without awaiting it, so a rejection escaped the error handler and surfaced only as an unhandled rejection. Both report through the existing handler now, and production builds keep console.error so the underlying exception stays visible.

* fix: narrow the change to the silent drag-and-drop folder failure

Dropping a folder onto a knowledge base did nothing at all when the browser refused to open one of the files inside it: the rejection escaped the async drop listener, so the user got no toast, no upload and no clue why. The listener now routes that failure through the same error handler the directory picker already uses, so one path and one message cover both ways of adding a folder.

The rest of the branch is reverted. Dropping `console.error` from the esbuild `pure` list un-stripped 597 call sites across 103 files from every production bundle, which is a repo-wide logging policy change that needs its own argument. The picker-side collect-and-count machinery only reworded a toast the existing catch already showed, and the Firefox `return await` fix is a different bug in a different path.
2026-08-31 00:45:26 -04:00
Timothy Jaeryang Baek e8bdbd716b refac 2026-08-31 00:33:43 -04:00
Timothy Jaeryang Baek 7a11154182 refac 2026-08-31 00:32:46 -04:00
G30 95032b6c61 fix: let the model defaults capability and prompt suggestion sections scroll (#29235) 2026-08-31 00:11:34 -04:00
Timothy Jaeryang Baek 84d0940da1 refac 2026-08-31 00:11:04 -04:00