Skip to content

Feature: Add validation in visual editor yaml frontmatter #744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 9, 2025

Conversation

vezwork
Copy link
Collaborator

@vezwork vezwork commented Jun 26, 2025

Video of me showing a title: number error in the source editor and now also in the visual editor

Todo

  • use mock schema to test validation
  • use actual yaml frontmatter schema for validation
  • apply validation to yaml content on code block initialization
  • apply validation to yaml content on save on edit (and clear old underlines)
  • underline validation
  • show validation error message in popover when hovering underlined validation

Out of scope

  • figure out how to pipe existing LSP validation through to the visual editor. Instead, @cscheid came up with a shortcut to import and call the validator in the visual-editor front-end code-block code. It would probably be ideal to pipe it through (Maybe using custom LSP methods?) so we aren't calling the validator in multiple ways I ended up piping existing diagnostics through!

@vezwork
Copy link
Collaborator Author

vezwork commented Jul 8, 2025

I found it difficult to figure out how to validate on-save, so I am validating on every edit right now. This should be tested for larger yaml front-matters in case it introduces latency or other issues. It should be easy to address any issues that come up: a quick fix would be to do something like a debounce on edit validation.

@vezwork vezwork marked this pull request as ready for review July 9, 2025 15:21
Copy link
Contributor

@cscheid cscheid left a comment

Choose a reason for hiding this comment

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

Looks great!, aside from some formatting issues.

@cscheid
Copy link
Contributor

cscheid commented Jul 9, 2025

We also want an entry on apps/vscode/CHANGELOG.md.

@vezwork vezwork merged commit c800f78 into main Jul 9, 2025
1 check 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.

2 participants