Commit graph

17 commits

Author SHA1 Message Date
Classic298
4e4b324246
fix: skip the pyodide plt.show patch when matplotlib is not loaded (#30381)
Any Python code that only mentioned "matplotlib" (a comment, a string, or an importlib.util.find_spec("matplotlib") check) failed with ModuleNotFoundError before a single line of it ran. The plt.show() patch was applied on a plain substring match, but matplotlib is only installed when the code actually imports it, so the patch's own import crashed the run. The user's try/except could not catch it, because their code never started. The same thing broke the code editor's Python formatter on any code that imports matplotlib, since that run only installs black.

The patch now also requires matplotlib to be present in the runtime's loaded packages, in both the worker and the sandboxed iframe host. Real matplotlib code still gets inline PNG output from plt.show(), and code that merely mentions matplotlib runs unchanged.

Gating on the callers' import regex instead was also tested and still fails the formatter case, because there the code containing the import sits inside a string while only black is installed.

Fixes #29894
2026-09-23 23:51:39 -04:00
Timothy Jaeryang Baek
5c4062c648 refac 2026-03-24 16:20:29 -05:00
Timothy Jaeryang Baek
3ceaa107ab chore: format 2026-03-07 20:14:32 -06:00
Timothy Jaeryang Baek
ce0ca894fe enh: code interpreter pyodide fs 2026-03-07 19:23:18 -06:00
silentoplayz
7a80e60785 fix(frontend): Attempt to resolve TypeError in RichTextInput.svelte
Fixes an issue where `ue.getWordAtDocPos is not a function` would be thrown in `MessageInput.svelte`.

The error was caused by a timing issue where the `getWordAtDocPos` method on the `RichTextInput` component was not available when called from an event handler within the same component.

This change refactors the code to pass the `getWordAtDocPos` function as a callback prop from `RichTextInput` to `MessageInput`, ensuring it's available when needed.
2025-08-03 22:36:08 -04:00
Timothy Jaeryang Baek
29c781875d refac 2025-02-10 00:02:23 -08:00
Timothy Jaeryang Baek
d95e5e0ba5 enh: kokorojs call support 2025-02-09 23:54:24 -08:00
Timothy Jaeryang Baek
205ce635f6 feat: Kokoro-js TTS support 2025-02-09 23:42:27 -08:00
Timothy Jaeryang Baek
6ee924924e refac: code interpreter 2025-02-04 18:33:22 -08:00
Timothy Jaeryang Baek
9c0a783991 refac: pyodide 2025-02-04 17:29:10 -08:00
Timothy Jaeryang Baek
58d2fd9ac1 refac: styling 2025-02-03 00:03:41 -08:00
Timothy Jaeryang Baek
09cd95bffe enh: pyodide 2025-02-02 23:08:37 -08:00
Timothy Jaeryang Baek
0d33725d21 enh: pyodide 2025-02-02 21:18:52 -08:00
Timothy Jaeryang Baek
74172461c7 enh: pyodide python result handling 2025-02-02 16:56:21 -08:00
Timothy J. Baek
23859756d8 fix: >:( 2024-05-20 19:20:49 -07:00
Timothy J. Baek
066789d423 refac: pyodide worker error handling 2024-05-19 05:19:48 -07:00
Jun Siang Cheah
781c904c91 refac: fetch pyodide deps at build time, not checked into git 2024-05-18 14:30:42 +08:00