Commit dfa4b77
authored
fix clicking nested workflow (#11391)
## Description
Fix clicking nested workflows in the sidepanel. Previously, clicking
"View Nested Graph" on a workflow node inside an already-open nested
workflow panel would throw a runtime error (`TypeError: n is not a
function`). Additionally, even if the click succeeded, the graph
wouldn't update - only the title would change.
**Changes:**
- Updated `WorkflowNestedNode` to use `useWorkflowStepDetail` directly
instead of going through `WorkflowNestedGraphContext`, which wasn't
available inside the nested graph panel
- Added a `key` prop to `ReactFlowProvider` in the step detail panel to
force React to remount the graph when switching between nested
workflows, ensuring the nodes/edges reinitialize with the new data
## Related Issue(s)
#11385
## Type of Change
- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [x] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Fixed a runtime error that occurred when clicking "View Nested Graph"
in nested workflow panels.
* Improved graph updating behavior when switching between different
nested workflows.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 20e411a commit dfa4b77
File tree
3 files changed
+8
-4
lines changed- .changeset
- packages/playground-ui/src/domains/workflows
- components
- workflow
3 files changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
0 commit comments