Skip to content

fix: don't show inline JSON editor error for empty value#487

Merged
AlekseyManetov merged 2 commits into
mainfrom
fix-json-editor-empty-value
Apr 22, 2026
Merged

fix: don't show inline JSON editor error for empty value#487
AlekseyManetov merged 2 commits into
mainfrom
fix-json-editor-empty-value

Conversation

@AlekseyManetov

@AlekseyManetov AlekseyManetov commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

Small follow-up tweak for PR #485 to prevent inline editor errors from being shown for empty values.

Before:

image

After:

image

Checklist

Ensure you provide everything we need to review your contribution:

  • Contribution meets our definition of done
  • Pull request establishes context
    • Link to related issue(s), i.e. Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}
    • Brief textual description of the changes
    • Screenshots or short videos showing UI/UX changes
    • Steps to try out, i.e. using the @bpmn-io/sr tool

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

Follow-up fix to prevent CodeMirror’s inline JSON lint errors from showing when the JsonEditor value is empty.

Changes:

  • Skip JSON parsing linter when the editor content is empty/whitespace-only.
  • Add a regression test ensuring no entry error and no inline lint markers for an empty value.

Reviewed changes

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

File Description
src/components/entries/JsonEditor.js Updates CodeMirror linter behavior to return no diagnostics for empty content.
test/spec/components/JsonEditor.spec.js Adds validation test case for empty value with no errors shown.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/entries/JsonEditor.js
Comment thread test/spec/components/JsonEditor.spec.js
Comment thread src/components/entries/JsonEditor.js

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

@AlekseyManetov Looks good - please validate if 🤖 assertions for tests hold. We want to ensure that tests are green with the fix, and red (failing) without 🙃

@AlekseyManetov AlekseyManetov force-pushed the fix-json-editor-empty-value branch from 491e7ee to c6f8c7c Compare April 22, 2026 16:45
@AlekseyManetov

Copy link
Copy Markdown
Contributor Author

@AlekseyManetov Looks good - please validate if 🤖 assertions for tests hold. We want to ensure that tests are green with the fix, and red (failing) without 🙃

@nikku Copilot is wrong on this point. This was my first try with waitFor, but then I realized that it can’t be used for this case, because waitFor polls until the callback passes without throwing. For negative assertions like expect(X).to.not.exist, it succeeds on the very first poll immediately, because the element hasn't appeared yet.

I've run the tests without my fix and they failed, so we're safe here.

@AlekseyManetov AlekseyManetov merged commit a99368a into main Apr 22, 2026
10 of 11 checks passed
@bpmn-io-tasks bpmn-io-tasks Bot removed the needs review Review pending label Apr 22, 2026
@AlekseyManetov AlekseyManetov deleted the fix-json-editor-empty-value branch April 22, 2026 17:03
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.

3 participants