Skip to content

Add editor placeholder support and handle empty schema validation gracefully#150

Open
riya-kaurav wants to merge 5 commits into
ioflux-org:mainfrom
riya-kaurav:add-placeholder-branch
Open

Add editor placeholder support and handle empty schema validation gracefully#150
riya-kaurav wants to merge 5 commits into
ioflux-org:mainfrom
riya-kaurav:add-placeholder-branch

Conversation

@riya-kaurav

Copy link
Copy Markdown

Summary

This PR improves the editor user experience by:

  • Adding placeholder support using Monaco's built-in placeholder option.
  • Preventing schema validation from running when the editor content is empty.
  • Clearing compiled schema state when the editor is empty to avoid unnecessary validation errors.

Previously, when the editor was empty, validation logic could still attempt to parse the schema, which resulted in an error message being displayed. Additionally, placeholder behavior was not implemented using Monaco’s native support.

This update ensures cleaner UX and better behavior across both light and dark themes.


What kind of change does this PR introduce

  • Enhancement (UX improvement)
  • Bug fix (prevents validation error when editor is empty)

Issue Number

Closes #149


Screenshots/Video

Light Theme

image

Dark Theme

WhatsApp Image 2026-03-03 at 4 26 01 PM


Does this PR introduce a breaking change?

No.


If relevant, did you update the documentation?

No documentation update was required.


Testing

  • Verified placeholder appears correctly when the editor is empty.
  • Confirmed placeholder works in both light and dark themes.
  • Confirmed no validation error appears when editor content is empty.
  • Confirmed schema validation works correctly when valid JSON Schema is provided.

Does this PR introduce a breaking change?

No.


If relevant, did you update the documentation?

No documentation update was required.


Testing

  • Verified placeholder appears correctly when the editor is empty.
  • Confirmed placeholder works in both light and dark themes.
  • Confirmed no validation error appears when editor content is empty.
  • Confirmed schema validation works correctly when valid JSON Schema is provided.

@itvi-1234

Copy link
Copy Markdown
Contributor

Kindly bump the correct version as per -

image

@riya-kaurav

Copy link
Copy Markdown
Author

Version bumped as suggested.

@itvi-1234

Copy link
Copy Markdown
Contributor

It should be 0.5.7-beta

@riya-kaurav

Copy link
Copy Markdown
Author

Version bumped to 0.5.7-beta as suggested.

Comment thread src/components/MonacoEditor.tsx Outdated
onMount={handleEditorDidMount}
/>
<Editor
height="90%"

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.

Spacing and indentation can be improved

@riya-kaurav

Copy link
Copy Markdown
Author

i have completed all the suggested improvements. If there’s anything else that needs to be updated, please let me know

Comment thread src/components/MonacoEditor.tsx Outdated
Comment thread src/components/MonacoEditor.tsx Outdated
status: "success",
message: VALIDATION_UI["success"].message,
}
status: "success",

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.

same

@riya-kaurav

Copy link
Copy Markdown
Author

I've reverted the unintended formatting changes in the validation block. Only the placeholder addition remains.

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.

Add placeholder support to editor and handle empty schema validation gracefully

2 participants