Add custom step names and fix F key shortcut
- Add name field to PromptStep, CodeStep, and ToolStep dataclasses - Update step dialogs to allow editing step names - Display custom step names in both list and flow views - Fix F key shortcut by installing event filter on graph widget - Steps without custom names show default "Prompt N" / "Code N" Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
@@ -36,6 +36,11 @@ class PromptStepDialog(QDialog):
|
||||
form = QFormLayout()
|
||||
form.setSpacing(12)
|
||||
|
||||
# Step name (optional)
|
||||
self.name_input = QLineEdit()
|
||||
self.name_input.setPlaceholderText("Optional display name")
|
||||
form.addRow("Step name:", self.name_input)
|
||||
|
||||
# Provider selection
|
||||
self.provider_combo = QComboBox()
|
||||
providers = load_providers()
|
||||
@@ -95,6 +100,10 @@ class PromptStepDialog(QDialog):
|
||||
|
||||
def _load_step(self, step: PromptStep):
|
||||
"""Load step data into form."""
|
||||
# Load name
|
||||
if step.name:
|
||||
self.name_input.setText(step.name)
|
||||
|
||||
idx = self.provider_combo.findText(step.provider)
|
||||
if idx >= 0:
|
||||
self.provider_combo.setCurrentIndex(idx)
|
||||
@@ -130,11 +139,14 @@ class PromptStepDialog(QDialog):
|
||||
# Don't store "None" profile
|
||||
if profile == "None":
|
||||
profile = None
|
||||
# Get name, use None if empty
|
||||
name = self.name_input.text().strip() or None
|
||||
return PromptStep(
|
||||
prompt=self.prompt_input.toPlainText(),
|
||||
provider=self.provider_combo.currentText(),
|
||||
output_var=self.output_input.text().strip(),
|
||||
profile=profile
|
||||
profile=profile,
|
||||
name=name
|
||||
)
|
||||
|
||||
|
||||
@@ -179,9 +191,15 @@ class CodeStepDialog(QDialog):
|
||||
layout = QVBoxLayout(self)
|
||||
layout.setSpacing(12)
|
||||
|
||||
# Top: Output variable
|
||||
# Top: Step name and Output variable
|
||||
form = QFormLayout()
|
||||
form.setSpacing(8)
|
||||
|
||||
# Step name (optional)
|
||||
self.name_input = QLineEdit()
|
||||
self.name_input.setPlaceholderText("Optional display name")
|
||||
form.addRow("Step name:", self.name_input)
|
||||
|
||||
self.output_input = QLineEdit()
|
||||
self.output_input.setPlaceholderText("result")
|
||||
self.output_input.setText("result")
|
||||
@@ -365,6 +383,9 @@ IMPORTANT: Return ONLY executable inline Python code. No function definitions, n
|
||||
|
||||
def _load_step(self, step: CodeStep):
|
||||
"""Load step data into form."""
|
||||
# Load name
|
||||
if step.name:
|
||||
self.name_input.setText(step.name)
|
||||
self.output_input.setText(step.output_var)
|
||||
self.code_input.setPlainText(step.code)
|
||||
|
||||
@@ -396,7 +417,10 @@ IMPORTANT: Return ONLY executable inline Python code. No function definitions, n
|
||||
|
||||
def get_step(self) -> CodeStep:
|
||||
"""Get the step from form data."""
|
||||
# Get name, use None if empty
|
||||
name = self.name_input.text().strip() or None
|
||||
return CodeStep(
|
||||
code=self.code_input.toPlainText(),
|
||||
output_var=self.output_input.text().strip()
|
||||
output_var=self.output_input.text().strip(),
|
||||
name=name
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user