Show pipeline name on step nodes in partial YAML configs#4
Conversation
…d API section display Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> Agent-Logs-Url: https://github.com/GoCodeAlone/workflow-editor/sessions/ea7ca8f8-b3c7-4723-8ec5-3390aa3ab46e
There was a problem hiding this comment.
Pull request overview
Adds per-step pipeline labeling so synthesized step nodes in pipeline-only partial YAML views (and route-attached handler chains) are visually distinguishable on the canvas.
Changes:
- Extend
WorkflowNodeDatawith optionalpipelineName. - Populate
pipelineNamewhen synthesizing pipeline step nodes (and when creating handler route pipeline step nodes) inconfigToNodes. - Render
pipelineNameas an italic subtitle row inBaseNode, and add multifile fixtures + a new Vitest suite validating partial-YAML pipeline behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/stores/workflowStore.ts |
Adds pipelineName?: string to node data model. |
src/utils/serialization.ts |
Sets pipelineName on synthesized pipeline step nodes and on handler-chain step nodes. |
src/components/nodes/BaseNode.tsx |
Renders pipelineName subtitle for nodes that have it. |
src/utils/serialization-pipeline-labels.test.ts |
Adds extensive tests for pipeline-only partial YAML and multifile resolution behavior. |
test-fixtures/multifile/forms.yaml |
New fixture with many pipelines sharing step names to reproduce the UI ambiguity. |
test-fixtures/multifile/application.yaml |
New multifile root fixture importing base.yaml and forms.yaml. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const testResult = useWorkflowStore((s) => s.testResults[label]); | ||
|
|
||
| // Pipeline name for step nodes (shows which pipeline a step belongs to) | ||
| const pipelineName = useWorkflowStore((s) => { |
There was a problem hiding this comment.
pipelineName is derived via s.nodes.find(...) for every rendered node. This makes BaseNode rendering O(n²) across the graph (each node component scans the full nodes array), and the selector work also runs on every store update. Consider avoiding the linear search (e.g., pass pipelineName through node props, or add/maintain an id→node map in the store and select from that, or at least short-circuit for non-step.* nodes).
| const pipelineName = useWorkflowStore((s) => { | |
| const pipelineName = useWorkflowStore((s) => { | |
| // Only step.* modules participate in pipelines; avoid scanning s.nodes for others. | |
| if (!moduleType.startsWith('step.')) { | |
| return undefined; | |
| } |
| moduleType: stepModuleType, | ||
| label: step.name, | ||
| config: step.config ?? (stepInfo ? { ...stepInfo.defaultConfig } : {}), | ||
| pipelineName: node.data.label, | ||
| }, |
There was a problem hiding this comment.
The new pipelineName behavior for route-attached pipeline steps (handler chains created from api.query/api.command route pipeline.steps) isn’t covered by tests in this PR. Adding a focused unit test that builds a minimal config with an api.query/api.command node + route pipeline steps and asserts the generated step nodes have pipelineName set to the handler label would prevent regressions here.
|
@copilot apply changes based on the comments in this thread |
…rcuit BaseNode selector; add handler chain tests Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> Agent-Logs-Url: https://github.com/GoCodeAlone/workflow-editor/sessions/8e3b10b2-06cc-4cb8-a97b-8647be0bd1eb
Applied all three changes from the review thread in commit
|
pipelineHandlerId?: stringtoWorkflowNodeDatapipelineName: node.data.labelcopy withpipelineHandlerId: node.idfor route-attached handler chain stepsstep.*modules; resolve handler label viapipelineHandlerIdat render timeapi.query/api.commandroute-attached pipeline steps assertingpipelineHandlerIdis set correctly📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.