Skip to content

feat YAML required fields indicator - #581

Merged
lornakelly merged 1 commit into
open-workflow-specification:mainfrom
lornakelly:235/required-fields
Dec 2, 2026
Merged

lornakelly merged 1 commit into
open-workflow-specification:mainfrom
lornakelly:235/required-fields

Conversation

@lornakelly

@lornakelly lornakelly commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Enhances autocomplete UX by prioritising required fields and cleaning up YAML completions. Required fields now appear first in completion lists, clearly marked with "(required)" labels. YAML completions no longer insert unnecessary blank lines between fields (listen and fork).

Main Changes

  • Required fields prioritisation: Missing required fields now appear first in completion lists, marked "(required)"
  • Smart detection: Uses schema validation diagnostics to identify required fields dynamically
  • Context-aware: Skips marking when multiple schema options exist (task type selection, run options)
  • Blank line removal: YAML completions no longer insert blank lines after object/list values
  • New utility: cursor-owner.ts - Identifies which object key owns the cursor position in YAML
  • Cancellation support: Skips expensive validation when completion request is cancelled

Before:

Screen.Recording.2026-12-02.at.10.51.32.mov

After:

Screen.Recording.2026-12-02.at.10.53.38.mov

Before - extra line added
Screenshot 2026-12-02 at 11 15 25

Copilot AI balanced review requested due to automatic review settings December 2, 2026 11:13
@netlify

netlify Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for openworkflow-editor ready!

Built without sensitive environment variables

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

🟡 Changes recommended

Required-field detection still skips root-level completions and produces invalid validation YAML for explicit null values, requiring fixes and root-level regression tests.

2 open issues
1 file not reviewed
  • pnpm-lock.yaml: Generated file
What changed in this PR

Improves YAML autocomplete by highlighting missing required fields and removing extra blank lines from inserted completions.

Changes:

  • Prioritizes required fields using validation diagnostics and cursor context.
  • Adds cancellation handling and completion regression tests.
  • Updates runtime dependencies and release notes.
File Description
pnpm-lock.yaml Records the runtime dependency move.
packages/​language-service/​vite.config.ts Externalizes the text-document dependency.
packages/​language-service/​tests/​volar/​yaml/​schema.test.ts Expects required-field labels.
packages/​language-service/​tests/​volar/​yaml/​implied-types.test.ts Matches completions independently of display labels.
packages/​language-service/​tests/​volar/​completions/​task-types-first.test.ts Allows required-field prioritization.
packages/​language-service/​tests/​volar/​completions/​required-fields.test.ts Tests required-field completion behavior.
packages/​language-service/​tests/​volar/​completions/​no-blank-lines.test.ts Tests compact completion snippets.
packages/​language-service/​src/​volar/​yaml/​schema.ts Integrates the completion transforms.
packages/​language-service/​src/​volar/​cursor-owner.ts Identifies the cursor’s owning YAML key.
packages/​language-service/​src/​volar/​completions/​transform-completions.ts Passes cancellation tokens to transforms.
packages/​language-service/​src/​volar/​completions/​task-types-first.ts Exports task-type detection.
packages/​language-service/​src/​volar/​completions/​required-fields.ts Labels and prioritizes missing required fields.
packages/​language-service/​src/​volar/​completions/​no-blank-lines.ts Removes blank lines from completion text.
packages/​language-service/​package.json Moves text-document support to runtime dependencies.
.changeset/​required-fields-first.md Documents the autocomplete improvements.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 11:52
@changeset-bot

changeset-bot Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 807b064

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

🟡 Changes recommended

Required-field detection still mishandles empty anchored values and multiline explicit nulls, producing invalid validation YAML or suppressing a parent’s required-field indicator.

2 open issues
2 resolved since last review
1 file not reviewed
  • pnpm-lock.yaml: Generated file

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 12:00

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.

🟡 Changes recommended

The cursor-owner heuristic misclassifies a later blank line after a completed multiline scalar, causing required-field validation to miss the parent’s required endpoint.

1 open issue
2 resolved since last review
1 file not reviewed
  • pnpm-lock.yaml: Generated file

Review effort: Balanced

Signed-off-by: lornakelly <lornakelly88@gmail.com>
Copilot AI balanced review requested due to automatic review settings December 2, 2026 12:08

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.

🟢 Approval recommended

No active review issues remain for the YAML autocomplete changes.

No open issues 🎉

1 resolved since last review
1 file not reviewed
  • pnpm-lock.yaml: Generated file

Review effort: Balanced

@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

@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

@lornakelly
lornakelly merged commit 568b86b into open-workflow-specification:main Dec 2, 2026
13 checks passed
@github-actions github-actions Bot mentioned this pull request Dec 3, 2026
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.

4 participants