Feat: eval button

This commit is contained in:
2025-11-13 18:23:08 +01:00
parent 53adb131e0
commit 00fa9bff21
3 changed files with 27 additions and 1 deletions

View File

@ -34,6 +34,7 @@
PanelLeftOpen,
PanelRightOpen,
CircleStop,
Play,
} from "lucide-svelte";
const appContext = createAppContext();
@ -51,6 +52,7 @@
let analyserNode = $state<AnalyserNode | null>(null);
let interpreterLogs = $state<LogEntry[]>([]);
let editorWithLogsRef: EditorWithLogs;
let logsUnsubscribe: (() => void) | undefined;
@ -350,6 +352,15 @@
<Share2 size={18} />
</button>
{/snippet}
<button
onclick={() => editorWithLogsRef?.triggerEvaluate()}
class="icon-button evaluate-button"
disabled={!$initialized}
class:is-running={$running}
title="Evaluate (Cmd-E)"
>
<Play size={18} />
</button>
<button
onclick={() => uiState.toggleScope()}
class="icon-button"
@ -405,6 +416,7 @@
<div class="editor-area">
<EditorWithLogs
bind:this={editorWithLogsRef}
value={projectEditor.content}
onChange={handleEditorChange}
onExecute={handleExecute}
@ -588,6 +600,14 @@
border-color: var(--danger-hover);
}
.icon-button.evaluate-button.is-running {
color: var(--accent-color);
}
.icon-button.evaluate-button.is-running:hover:not(:disabled) {
border-color: var(--accent-color);
}
h3 {
margin-top: 0;
color: var(--text-color);