LOGIC BUILDER NAME EDIT FIX
Documentation for Plans
๐ง Logic Builder - Flow Name Editing Fix
Date: October 12, 2025
Status: โ
FIXED
Severity: HIGH (User Experience)
๐ The Problem
Flow name editing was broken in the Logic Builder. When clicking the flow name to edit it, the input field would appear but changes wouldn't be saved properly.
๐ Root Cause
The template was using two-way binding [(ngModel)] with a signal, which doesn't work in Angular:
<!-- โ BROKEN: Two-way binding with signal -->
<input
type="text"
class="flow-name-input"
[(ngModel)]="currentFlowName"
...
/>
Problem: currentFlowName is defined as a signal:
readonly currentFlowName = signal<string>('Untitled Flow');
Why it breaks: Angular's two-way binding [(ngModel)] expects a regular property, not a signal. Signals have a different API (.set() and () for reading).
โ The Fix
Changed to use one-way binding with manual signal updates:
<!-- โ
FIXED: One-way binding + manual signal update -->
<input
type="text"
class="flow-name-input"
[ngModel]="currentFlowName()"
(ngModelChange)="currentFlowName.set($event)"
(blur)="finishEditingFlowName()"
(keydown.enter)="finishEditingFlowName()"
(keydown.escape)="cancelEditingFlowName()"
...
/>
How it works:
[ngModel]="currentFlowName()"- Read the current value from the signal(ngModelChange)="currentFlowName.set($event)"- Update the signal when the input changes- Other events (blur, enter, escape) still work as before
๐งช How to Test
- Open Logic Builder (
/singularity/logic-builder) - Click on the flow name (e.g., "Untitled Flow")
- Input field appears - Type a new name (e.g., "My Amazing Flow")
- Press Enter or click outside the input
- Flow name updates โ
- Save flow - Name persists after save
- Reload page - Name is still there
Test Keyboard Shortcuts
- Enter - Save the new name โ
- Escape - Cancel editing and restore previous name โ
- Tab/Click outside - Save the new name โ
๐ Impact
| Action | Before | After |
|---|---|---|
| Click flow name | โ Input appears | โ Input appears |
| Type new name | โ Doesn't update | โ Updates in real-time |
| Press Enter | โ Name lost | โ Name saved |
| Save flow | โ Old name saved | โ New name saved |
๐ File Changed
libs/singularity-lib/src/lib/components/logic-builder/logic-builder.component.html- Changed
[(ngModel)]="currentFlowName"to one-way binding with signal update
- Changed
๐ Lesson Learned
Signals vs Two-Way Binding
When working with Angular signals in templates:
โ DON'T use two-way binding:
<input [(ngModel)]="mySignal" /> <!-- Won't work! -->
โ DO use one-way binding + event:
<input
[ngModel]="mySignal()"
(ngModelChange)="mySignal.set($event)"
/>
Or use the new signal input syntax (Angular 17+):
// In component
readonly myValue = signal('');
// In template
<input [(ngModel)]="myValue" /> <!-- Works with model() signals -->
๐ Related Issues
This is a common pattern issue when migrating to signals. Any time you see:
- Input fields not updating
- Form controls losing values
- Two-way binding with signals
Check if you're using [(ngModel)] with a signal instead of a regular property.
Status: โ FIXED - READY TO USE
Flow name editing now works correctly with signals! ๐