Revert "In Workflow Settings, disable the "Generate Code" toggle, and always set it to true." (#3488)

This commit is contained in:
Shuchang Zheng
2025-09-19 20:30:46 -07:00
committed by GitHub
parent 5e1409a5c7
commit 864f5226e2
2 changed files with 6 additions and 9 deletions

View File

@@ -50,7 +50,7 @@ const emptyWorkflowRequest: WorkflowCreateYAMLRequest = {
title: "New Workflow", title: "New Workflow",
description: "", description: "",
ai_fallback: true, ai_fallback: true,
generate_script: true, generate_script: false,
workflow_definition: { workflow_definition: {
blocks: [], blocks: [],
parameters: [], parameters: [],

View File

@@ -72,7 +72,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
? data.maxScreenshotScrolls ? data.maxScreenshotScrolls
: null, : null,
extraHttpHeaders: data.withWorkflowSettings ? data.extraHttpHeaders : null, extraHttpHeaders: data.withWorkflowSettings ? data.extraHttpHeaders : null,
useScriptCache: data.withWorkflowSettings ? data.useScriptCache : true, // TODO(jdo/always-generate): set to false useScriptCache: data.withWorkflowSettings ? data.useScriptCache : false,
scriptCacheKey: data.withWorkflowSettings ? data.scriptCacheKey : null, scriptCacheKey: data.withWorkflowSettings ? data.scriptCacheKey : null,
aiFallback: data.withWorkflowSettings ? data.aiFallback : true, aiFallback: data.withWorkflowSettings ? data.aiFallback : true,
runSequentially: data.withWorkflowSettings ? data.runSequentially : false, runSequentially: data.withWorkflowSettings ? data.runSequentially : false,
@@ -211,14 +211,11 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
<Label>Generate Code</Label> <Label>Generate Code</Label>
<HelpTooltip content="Generate & use cached code for faster execution." /> <HelpTooltip content="Generate & use cached code for faster execution." />
<Switch <Switch
disabled={true} // TODO(jdo/always-generate): remove
className="ml-auto" className="ml-auto"
checked={true} // TODO(jdo/always-generate): set to `inputs.useScriptCache` checked={inputs.useScriptCache}
onCheckedChange={ onCheckedChange={(value) => {
(/*value*/) => { handleChange("useScriptCache", value);
// handleChange("useScriptCache", value); // TODO(jdo/always-generate): put back }}
}
}
/> />
</div> </div>
</div> </div>