Skip to content

fix: correctly identify default switch case edges - #453

Merged
lornakelly merged 2 commits into
open-workflow-specification:mainfrom
lornakelly:450/switch-default-bug
Sep 29, 2026
Merged

lornakelly merged 2 commits into
open-workflow-specification:mainfrom
lornakelly:450/switch-default-bug

Conversation

@lornakelly

@lornakelly lornakelly commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Closes: #450

Summary

The diagram editor was incorrectly identifying default switch cases. This caused edges to not be animated when default cases (those without a when) used different names. Fix identifies default case based on missing when.

Note: Also updated "unicorn/no-thenable" disabled tests to no longer need the lint exception

Verify: Storybook > Nested Editing > Switch Locked Cases

Copilot AI lite review requested due to automatic review settings September 25, 2026 14:39
@netlify

netlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for openworkflow-editor ready!

Name Link
🔨 Latest commit bb3dcad
🔍 Latest deploy log https://app.netlify.com/projects/openworkflow-editor/deploys/6aba1e6cfbace40008eedd89
😎 Deploy Preview https://deploy-preview-453--openworkflow-editor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Redirected edges for default cases are not animated and need coverage.

Review effort: Lite
Findings: None

What changed in this PR

Fixes switch default-case edge animation by detecting cases without a when condition instead of relying on case names.

Changes:

  • Adds default-case edge detection and animation handling.
  • Adds regression tests and updates the Storybook workflow fixture.
  • Adds a patch changeset.
File Description
packages/​open-workflow-diagram-editor/​src/​core/​graph.ts Identifies default switch-case edges.
packages/​open-workflow-diagram-editor/​src/​react-flow/​diagram/​diagramBuilder.ts Applies animation to detected edges.
packages/​open-workflow-diagram-editor/​tests/​core/​graph.test.ts Tests default-case detection.
packages/​open-workflow-diagram-editor/​tests/​react-flow/​diagram/​diagramBuilder.test.ts Tests rendered edge animation.
packages/​open-workflow-diagram-editor/​stories/​nested-editing/​workflows/​switch-locked-cases.yaml Uses a non-default case name.
.changeset/​switch-default-edge-fix.md Documents the patch release.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lornakelly lornakelly changed the title fix: correctly identify default switch case edges for animation fix: correctly identify default switch case edges Sep 25, 2026
Signed-off-by: lornakelly <lornakelly88@gmail.com>
Copilot AI review requested due to automatic review settings September 25, 2026 15:12
@lornakelly
lornakelly force-pushed the 450/switch-default-bug branch from 8b4a505 to 59aa002 Compare September 25, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

@fantonangeli fantonangeli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XS comment but LGTM

Signed-off-by: lornakelly <lornakelly88@gmail.com>
Copilot AI review requested due to automatic review settings September 28, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Redirected edges for nested switches with external targets may only be partially animated.

Review effort: Lite
Findings: None

@handreyrc handreyrc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks

@lornakelly
lornakelly merged commit 3fd59a9 into open-workflow-specification:main Sep 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: SwitchTask sets default case incorrectly

5 participants