Skip to content
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

feat: Improve Schema Error Diplay with Glyphs #562

Merged
merged 19 commits into from Feb 16, 2024
Merged

Conversation

Kevin101Zhang
Copy link
Contributor

@Kevin101Zhang Kevin101Zhang commented Feb 15, 2024

Accidentally overwrote some changes here - #555.
Checkout a branch a resolved the latest changes for removing glyphsuccess color from green to transparent and removing trycatch.

Glyphs margins to showcase a better error message to the user. The Glyph is either red or green. Green indicating it has not caught an errors and red indicating it has found an error. When an error is found it will come with a hoverable error message as well as the line it was caught on.

Procedure:
Onload of the schema page the glyphs will mount and check if there is an error based off the users previously written schema or their locally stored code.

If the user has an error: It will highlight the line the error was caught on with a red glyph and a hoverable message.
If the user does not have an error it will remain on line 1 with a green glyph. Onhover it will tell the user there are no errors.

If the user navigates away from the schema tab with an error it will prompt the user with a Alert that there was an error and to please return back to the schema tab and correct the schema.

The Glyph functionality with run on a debounced event of 500ms based off the users onChange typing activity on the schema page. When triggered it will prettify the users schema and will attempt to generate types in a try/catch. If it hits the error then it will relay the line number the error was caught on and the err message which the glyph will represent.

The Glyph only takes place on schema.sql as for indexLogic we have monaco's support for intellisense/catching errors in the JS env.

In the case in the video where the glyph is on line one and hovering over the glyph showcases an error message with a line number - this is when prettier is throwing an error and can be added through string matching to correctly display the glyph location

https://www.loom.com/share/78d0c6435115470597b9e8448976fda4?sid=fba10322-2ded-4b14-8178-8a5b51143148

@Kevin101Zhang Kevin101Zhang requested a review from a team as a code owner February 15, 2024 00:21
Copy link
Collaborator

@darunrs darunrs left a comment

Choose a reason for hiding this comment

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

LGTM! Copy over the description from the previous PR, and do a squash and merge.

@darunrs
Copy link
Collaborator

darunrs commented Feb 16, 2024

Name the PR something like: feat: Improve Schema Error Diplay with Glyphs or something too.

@Kevin101Zhang Kevin101Zhang changed the title Parsing ddl error 2 feat: Improve Schema Error Diplay with Glyphs Feb 16, 2024
@Kevin101Zhang Kevin101Zhang merged commit e45a263 into main Feb 16, 2024
@Kevin101Zhang Kevin101Zhang deleted the parsing-ddl-error-2 branch February 16, 2024 19:41
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.

None yet

2 participants