Commit graph

3530 commits

Author SHA1 Message Date
Shirasawa
b338850cc1
Merge pull request #22127 from ShirasawaSama/patch-49
fix: Fix TypeScript syntax compilation errors
2026-03-02 11:26:58 -06:00
Timothy Jaeryang Baek
d7147d6cdd refac 2026-03-02 11:24:15 -06:00
Timothy Jaeryang Baek
832d0181b6 chore: format 2026-03-01 19:13:14 -06:00
Shirasawa
a9e9fe7899
fix: fix memory leaking of ChatControls (#22112) 2026-03-01 19:06:20 -06:00
Algorithm5838
fe837d80e7 fix: pass params when saving a temporary chat
The system prompt and other chat controls overrides were lost after
saving because `params` wasn't included in the `createNewChat` call.
2026-03-02 01:35:59 +03:00
Algorithm5838
6863ca482c perf: use rAF to debounce getContents() during streaming 2026-03-01 23:42:16 +03:00
Timothy Jaeryang Baek
5645d5bccc refac 2026-03-01 14:38:10 -06:00
Timothy Jaeryang Baek
201b93bfcc refac 2026-03-01 14:18:57 -06:00
Shirasawa
9904566513
fix: fix memory leaking in Chat.svelte (#21962)
* fix: fix memory leaking in Chat.svelte

* chore: remove useless chatIdUnsubscriber var

* fix: fix async tick
2026-03-01 15:04:47 -05:00
Classic298
597883a179
perf: use structuredClone and fast-path comparison in UserMessage (#22098)
Same optimization as the merged ResponseMessage PR: replace JSON.parse(JSON.stringify()) with structuredClone and add an O(1) fast-path check on content before falling back to full JSON.stringify comparison.
2026-03-01 14:46:05 -05:00
Timothy Jaeryang Baek
d415edcfcd chore: bump 2026-03-01 13:14:20 -06:00
Algorithm5838
e9011113b4
perf: skip redundant object spread in buildMessages (#22086) 2026-03-01 13:46:11 -05:00
Classic298
1b89bee098
perf: add fast-path comparison in MultiResponseMessages (#22100)
Same optimization as ResponseMessage: add O(1) fast-path check on content and done fields before falling back to full JSON.stringify comparison. Avoids expensive serialization when only content changes during streaming.
2026-03-01 13:44:59 -05:00
Classic298
3569280c0b
perf: replace JSON.parse(JSON.stringify()) with structuredClone in Chat.svelte (#22102)
Replace 7 instances of JSON.parse(JSON.stringify()) deep cloning with the native structuredClone API. All are on cold paths (model selection, file preparation, history saving) but structuredClone is ~2x faster and more readable.
2026-03-01 13:37:20 -05:00
Classic298
a0d6c209c3
perf: fast-path token comparison in CodeBlock (#22101)
During streaming, every token change triggers a full JSON.stringify comparison on the code block token object. Add an O(1) fast-path check on token.text and token.raw — the fields that actually change during streaming — before falling back to the expensive JSON.stringify comparison for infrequent structural changes.
2026-03-01 13:37:10 -05:00
Classic298
73617ec7fa
perf: fast-path length check in StatusHistory comparison (#22103)
Add O(1) array length check before expensive JSON.stringify comparison. During streaming, status history typically only grows via appends, so a length mismatch catches most updates without serialization.
2026-03-01 13:36:42 -05:00
Timothy Jaeryang Baek
ddedceb7ad refac 2026-03-01 12:32:44 -06:00
Timothy Jaeryang Baek
18865a9fef refac 2026-03-01 12:30:03 -06:00
Timothy Jaeryang Baek
769ef856bc chore: format 2026-03-01 03:05:47 -06:00
Timothy Jaeryang Baek
ed1b959bc6 refac 2026-03-01 02:38:45 -06:00
Timothy Jaeryang Baek
d2b38127d0 refac 2026-03-01 02:37:21 -06:00
Timothy Jaeryang Baek
3d535db304 refac 2026-03-01 02:29:37 -06:00
Timothy Jaeryang Baek
234306ff57 refac 2026-03-01 02:08:41 -06:00
Timothy Jaeryang Baek
1357dc6737 chore: format 2026-02-28 21:28:59 -06:00
Timothy Jaeryang Baek
43c30428a6 refac 2026-02-28 21:16:53 -06:00
Timothy Jaeryang Baek
a3de0bcc58 refac 2026-02-28 19:22:35 -06:00
Classic298
30ae519226
perf: throttle message list rebuild to once per animation frame during streaming (#21885)
Messages.svelte rebuilds the message list by walking the parent chain and creating spread copies on every history.messages change. During streaming, this runs on every token — hundreds of times per second — even though each ResponseMessage already has its own reactive binding for content updates. Throttle the rebuild to once per animation frame (~60Hz) during content-only updates, while keeping immediate rebuilds for structural changes (currentId changes like chat switches, navigation, or new messages). Adds onDestroy cleanup for the pending rAF.
2026-02-28 18:09:43 -05:00
Timothy Jaeryang Baek
6b462ff121 refac 2026-02-28 13:40:06 -06:00
Algorithm5838
fc5f399573
perf: batch scrollToBottom during streaming via rAF (#21946) 2026-02-28 14:13:48 -05:00
Algorithm5838
54cefedf53
perf: use structuredClone for message deep copies (#21948) 2026-02-28 14:09:29 -05:00
Shirasawa
5bb1c42fa8
fix: Fix memory leaking of MessageInput (#21968) 2026-02-28 14:03:08 -05:00
Timothy Jaeryang Baek
f5bf2a2ed7 refac 2026-02-28 00:41:10 -06:00
Timothy Jaeryang Baek
ab3f03bbd5 refac 2026-02-28 00:40:20 -06:00
Timothy Jaeryang Baek
5ac502e93f refac 2026-02-27 17:24:34 -06:00
Timothy Jaeryang Baek
c60b0fa0e3 refac 2026-02-27 17:20:49 -06:00
Timothy Jaeryang Baek
9544a80aa0 refac 2026-02-27 17:14:54 -06:00
Timothy Jaeryang Baek
3a6c88ade9 refac 2026-02-27 16:47:36 -06:00
Timothy Jaeryang Baek
3be06132db refac 2026-02-27 16:41:52 -06:00
Timothy Jaeryang Baek
bbbcf27dd5 refac 2026-02-27 16:37:53 -06:00
Timothy Jaeryang Baek
f60d386b74 refac 2026-02-27 16:21:27 -06:00
Timothy Jaeryang Baek
179a4ad9ea refac 2026-02-27 16:01:57 -06:00
Timothy Jaeryang Baek
e7a9988893 chore: format 2026-02-27 15:59:52 -06:00
Timothy Jaeryang Baek
6b01f96eac refac 2026-02-27 15:56:25 -06:00
Timothy Jaeryang Baek
d6d9d1c535 refac 2026-02-27 14:36:13 -06:00
Timothy Jaeryang Baek
646b64a318 refac 2026-02-27 13:37:03 -06:00
Timothy Jaeryang Baek
4737e1f118 feat: open terminal integration 2026-02-27 13:08:59 -06:00
Classic298
7ea6afdf95
perf: cache KaTeX module import as singleton across all renderer instances (#21880)
* perf: cache KaTeX module import as singleton across all renderer instances

KatexRenderer.svelte dynamically imports katex, mhchem, and the CSS on every component mount. When a message contains multiple math expressions, this triggers redundant module resolution for each one. Move the import promise to a module-level singleton using Svelte's context='module' script block so it loads once and is shared across all KatexRenderer instances.

* Update KatexRenderer.svelte
2026-02-26 15:34:42 -06:00
Classic298
4654ecbf1b
perf: fast-path comparison in ResponseMessage to skip JSON.stringify during streaming (#21884)
ResponseMessage compared the entire message object via JSON.stringify on every reactive tick to detect changes. During streaming, content changes on every token, making the two O(content_length) JSON.stringify calls always return different results — pure wasted work. Add a fast O(1) comparison on content and done fields first. When either differs (the common streaming case), skip straight to cloning. Only fall through to the expensive JSON.stringify comparison for infrequent changes like sources, annotations, or status updates.
2026-02-26 14:47:32 -06:00
Timothy Jaeryang Baek
419ea1c346 refac 2026-02-26 00:00:01 -06:00
Timothy Jaeryang Baek
eca9b405eb refac 2026-02-25 19:58:50 -06:00