Skip to content

feat: Implement filter schema by definition in the editor - #361

Merged
lornakelly merged 5 commits into
open-workflow-specification:feature/node-editingfrom
handreyrc:bump-sdk-filter-schema
Aug 28, 2026
Merged

feat: Implement filter schema by definition in the editor#361
lornakelly merged 5 commits into
open-workflow-specification:feature/node-editingfrom
handreyrc:bump-sdk-filter-schema

Conversation

@handreyrc

@handreyrc handreyrc commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Closes: #357

Summary

Add schema filter capabilities to cherry-pick a definition and merge any external dependencies into a fully formed scoped schema.

Changes

  • Added filterSchema function to filter definitions and sub-definitions
    • Added Filter Schema story
    • Merge external definitions props after target definition props.
    • Added unit tests

Testing

The output of the function getSchemaForDefinition can be tested and validated from the story "Schema Filter".

@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for openworkflow-editor ready!

Name Link
🔨 Latest commit d7a5f5d
🔍 Latest deploy log https://app.netlify.com/projects/openworkflow-editor/deploys/6a9185529a5d320008899bba
😎 Deploy Preview https://deploy-preview-361--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.

Pull request overview

This PR updates the editor to SDK Alpha-8 and adds a schema-filtering utility that can extract a single $defs definition as a self-contained schema (flattening allOf and bundling transitive $ref dependencies). It also adds Storybook + tests to validate and explore the filtered schema output.

Changes:

  • Bumped @openworkflowspec/sdk to ^1.0.3-alpha8 and updated workflow serialization to use the SDK serializer with validate: false.
  • Added getSchemaForDefinition / getReferencedDefinitions schema filtering utilities with caching, transitive $defs bundling, and a Storybook “Schema Filter” story.
  • Added/updated Vitest tests covering schema filtering and updated graph-building expectations for empty workflows.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Updates catalog versions (SDK alpha-8, changesets/storybook bumps) and adds allof-merge.
pnpm-lock.yaml Lockfile updates reflecting the dependency bumps/additions.
packages/open-workflow-diagram-editor/tests/core/workflowSdk.integration.test.ts Updates integration test expectations for SDK behavior on empty-task workflows.
packages/open-workflow-diagram-editor/tests/core/filterSchema.test.ts Adds unit tests for schema filtering, flattening, and $defs bundling behavior.
packages/open-workflow-diagram-editor/stories/features/SchemaFilter.stories.tsx Adds a Storybook UI to interactively resolve and inspect filtered schemas.
packages/open-workflow-diagram-editor/src/core/workflowSdk.ts Switches serialization to SDK serializer with validation disabled.
packages/open-workflow-diagram-editor/src/core/schemaFilter.ts Implements schema merge/filter utilities, caching, and $defs bundling logic.
packages/open-workflow-diagram-editor/package.json Adds allof-merge dependency required by schema filtering.
.github/workflows/publish-release.yaml Updates pinned changesets/action to v2.1.0.
.github/workflows/prepare-release.yaml Updates pinned changesets/action to v2.1.0.
.github/workflows/ci_codeql.yml Updates pinned CodeQL action to v4.37.7.

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

Comment thread packages/open-workflow-diagram-editor/stories/features/SchemaFilter.stories.tsx Outdated
Comment thread packages/open-workflow-diagram-editor/src/core/schemaFilter.ts

@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.

Thanks @handreyrc 2 small comments

@handreyrc
handreyrc requested a review from fantonangeli August 27, 2026 13:00

@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.

LGTM

Signed-off-by: handreyrc <handrey.cunha@gmail.com>

# Conflicts:
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
@handreyrc
handreyrc force-pushed the bump-sdk-filter-schema branch from 4ef63f7 to 1c83b62 Compare August 27, 2026 21:05
@handreyrc

Copy link
Copy Markdown
Contributor Author

@lornakelly,

PR rebased from feature branch.
It is ready for your review.

Thanks!

Comment thread .changeset/sdk-bump-schema-filter.md Outdated
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
@handreyrc
handreyrc requested a review from lornakelly August 28, 2026 12:57
@handreyrc handreyrc changed the title feat: Bump SDK to Alpha-8 and Implement schema filter in the editor feat: Implement filter schema by definition in the editor Aug 28, 2026

@lornakelly lornakelly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@lornakelly
lornakelly merged commit 1c2f8f1 into open-workflow-specification:feature/node-editing Aug 28, 2026
9 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.

5 participants