Skip to content

Commit a2451e2

Browse files
authored
feat(agentflow) - create array input component and add test cases (#5887)
* feat(agentflow): Add array input component with field visibility - Add ArrayInput component for managing lists of structured data - Implement field visibility engine with show/hide conditions - Add minItems constraint support for array inputs - Add comprehensive test coverage for ArrayInput and EditNodeDialog - Update NodeInputHandler to support array type inputs - Update types to include array-related input parameters * Move show/hide field logic into EditNodeDialog * FIx build issue * Fix gemini comments * Fix comments * Lint error fix
1 parent 73b0b15 commit a2451e2

12 files changed

Lines changed: 844 additions & 20 deletions

File tree

packages/agentflow/examples/src/demos/CustomNodeExample.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,38 @@ const customNodeInputParams: InputParam[] = [
9999
default: 2000,
100100
show: { enableMemory: true, memoryType: 'tokenBuffer' }
101101
},
102+
{
103+
id: 'conditions',
104+
name: 'conditions',
105+
label: 'Condition',
106+
type: 'array',
107+
array: [
108+
{
109+
id: 'variable',
110+
name: 'variable',
111+
label: 'Variable',
112+
type: 'string'
113+
},
114+
{
115+
id: 'operation',
116+
name: 'operation',
117+
label: 'Operation',
118+
type: 'options',
119+
options: [
120+
{ label: 'Equals', name: 'equals' },
121+
{ label: 'Contains', name: 'contains' },
122+
{ label: 'Is Empty', name: 'isEmpty' }
123+
]
124+
},
125+
{
126+
id: 'value',
127+
name: 'value',
128+
label: 'Value',
129+
type: 'string',
130+
hide: { 'conditions[$index].operation': 'isEmpty' }
131+
}
132+
]
133+
},
102134
{
103135
id: 'outputFormat',
104136
name: 'outputFormat',

packages/agentflow/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module.exports = {
3838
coverageThreshold: {
3939
'./src/*.ts': { branches: 80, functions: 80, lines: 80, statements: 80 },
4040
'./src/Agentflow.tsx': { branches: 80, functions: 80, lines: 80, statements: 80 },
41+
'./src/atoms/ArrayInput.tsx': { branches: 80, functions: 80, lines: 80, statements: 80 },
4142
'./src/core/': { branches: 80, functions: 80, lines: 80, statements: 80 },
4243
'./src/features/canvas/components/ConnectionLine.tsx': { branches: 80, functions: 80, lines: 80, statements: 80 },
4344
// Only getMinimumNodeHeight() is tested; the component is Tier 3 UI with no business logic

0 commit comments

Comments
 (0)