diff --git a/src/lib/tours/scripts/simulation.ts b/src/lib/tours/scripts/simulation.ts
index f093d48b..d2ea3a5b 100644
--- a/src/lib/tours/scripts/simulation.ts
+++ b/src/lib/tours/scripts/simulation.ts
@@ -180,9 +180,9 @@ export const simulationTour: TourScript = {
openerPosition: { side: 'bottom', align: 'end' },
contentTitle: 'Python Export',
contentBody: `
-
The exported script is self-contained — copy, save or send to the Codegen tool. Useful for:
+ The exported script is self-contained — copy, save or run it anywhere. Useful for:
- - Codegen for production deployment
+ - Production deployment
- Version control of the simulation
- Running headless outside the browser
diff --git a/src/lib/tours/scripts/start.ts b/src/lib/tours/scripts/start.ts
index af73aaa1..b373edca 100644
--- a/src/lib/tours/scripts/start.ts
+++ b/src/lib/tours/scripts/start.ts
@@ -191,7 +191,7 @@ export const startTour: TourScript = {
element: '[data-tour="toolbar-files"]',
title: 'Files & Sharing',
body: `
- Save and load .pvm files. Buttons left to right: New, Open, Save, Save As, View Python Code, Send to Codegen.
+ Save and load .pvm files. Buttons left to right: New, Open, Save, Save As, View Python Code.
| Open | Ctrl/Cmd+O |
| Save | Ctrl/Cmd+S |
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 5436e217..b10a989d 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -99,10 +99,10 @@
let mousePosition = $state({ x: 0, y: 0 });
// Save feedback animation state
- let saveFlash = $state<'save' | 'save-as' | 'codegen' | null>(null);
+ let saveFlash = $state<'save' | 'save-as' | null>(null);
let saveFlashTimeout: ReturnType | undefined;
- function flashSaveButton(which: 'save' | 'save-as' | 'codegen') {
+ function flashSaveButton(which: 'save' | 'save-as') {
clearTimeout(saveFlashTimeout);
saveFlash = which;
saveFlashTimeout = setTimeout(() => { saveFlash = null; }, 1500);
@@ -118,58 +118,6 @@
if (success) flashSaveButton('save-as');
}
- // Codegen export — compress Python code into URL hash and open codegen
- const CODEGEN_URL = import.meta.env.VITE_CODEGEN_URL ?? 'https://code.pathsim.org/app';
- const CODEGEN_MAX_BYTES = 100_000; // 100 KB raw Python limit
-
- async function compressAndEncode(text: string): Promise {
- const data = new TextEncoder().encode(text);
- const cs = new CompressionStream('deflate-raw');
- const writer = cs.writable.getWriter();
- writer.write(data);
- writer.close();
- const compressed = new Uint8Array(await new Response(cs.readable).arrayBuffer());
- let binary = '';
- for (const b of compressed) binary += String.fromCharCode(b);
- return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
- }
-
- async function handleSendToCodegen() {
- const { nodes, connections } = graphStore.toJSON();
-
- if (nodes.length === 0) {
- await confirmationStore.show({
- title: 'No Model',
- message: 'There are no blocks in the current graph. Add blocks to your simulation before exporting to Codegen.',
- confirmText: 'OK',
- cancelText: 'Cancel'
- });
- return;
- }
-
- const settings = settingsStore.get();
- const codeContext = codeContextStore.getCode();
- const events = eventStore.toJSON();
- const pythonCode = exportToPython(nodes, connections, settings, codeContext, events);
-
- const rawBytes = new TextEncoder().encode(pythonCode).length;
- if (rawBytes > CODEGEN_MAX_BYTES) {
- const sizeKB = Math.round(rawBytes / 1024);
- const openExport = await confirmationStore.show({
- title: 'Model Too Large',
- message: `The generated Python code is ${sizeKB} KB, which exceeds the transfer limit. Use the Python Code export (Ctrl+E) to copy the code and paste it into Codegen manually.`,
- confirmText: 'Open Python Export',
- cancelText: 'Cancel'
- });
- if (openExport) exportDialogOpen = true;
- return;
- }
-
- const encoded = await compressAndEncode(pythonCode);
- window.open(`${CODEGEN_URL}?code=${encoded}`, '_blank');
- flashSaveButton('codegen');
- }
-
// Panel visibility state
let showProperties = $state(false);
let showNodeLibrary = $state(false);
@@ -1319,9 +1267,70 @@
-
-
-