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

[Selection input] Update error styles #28012

Merged
merged 5 commits into from
Feb 24, 2025
Merged

[Selection input] Update error styles #28012

merged 5 commits into from
Feb 24, 2025

Conversation

salazarm
Copy link
Contributor

@salazarm salazarm commented Feb 24, 2025

Summary & Motivation

Note that updating the usefulness of the error messages is outside of the scope of this PR. Currently just returning what ANTLR gives us but I think we can do better in the future.

Stop using CodeMirror's linter functionality and instead running linting ourselves in order to have control over the error tooltip rendering beyond just the class name.

How I Tested These Changes

Manual testing

Screenshot 2025-02-24 at 9 44 28 AM Screenshot 2025-02-24 at 9 59 06 AM Screenshot 2025-02-24 at 9 59 21 AM

Copy link

github-actions bot commented Feb 24, 2025

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-g8g68151d-elementl.vercel.app
https://salazarm-error-styles.core-storybook.dagster-docs.io

Built with commit 85437ad.
This pull request is being automatically deployed with vercel-action

Copy link

github-actions bot commented Feb 24, 2025

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-4uyyv423o-elementl.vercel.app
https://salazarm-error-styles.components-storybook.dagster-docs.io

Built with commit 85437ad.
This pull request is being automatically deployed with vercel-action

Copy link
Member

@hellendag hellendag left a comment

Choose a reason for hiding this comment

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

Looks like a nice visual improvement. 👍

setError(null);
}
};
document.body.addEventListener('mousemove', listener);
Copy link
Member

Choose a reason for hiding this comment

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

Worth targeting this more narrowly than document.body, perhaps just the CM instance element? Mousemove is going to be a pretty active listener.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need a global one for this unfortunately since we need to detect mousemoves outside of the container to know to hide the error.

Copy link
Member

Choose a reason for hiding this comment

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

Hm, could you use a mouseleave on the container?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh forgot to look into this. I think I could probably do that will look into that in a follow up pr

flex={{direction: 'row', gap: 4}}
color={Colors.textLight()}
>
<Icon name="run_failed" color={Colors.accentRed()} />
Copy link
Member

Choose a reason for hiding this comment

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

error_outline might look a little less loud and a little cleaner than the filled-in error icon.

return (
<Box>
Mismatched input{' '}
<MonoSmall color={Colors.textRed()}>&apos;{error.error.mismatchedInput}&apos;</MonoSmall>.
Copy link
Member

Choose a reason for hiding this comment

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

The &apos; wrappers might not be needed, the color and monospace are already good visual indicators to show the mismatched string.

@salazarm salazarm merged commit ec6d7f4 into master Feb 24, 2025
7 of 8 checks passed
@salazarm salazarm deleted the salazarm/error-styles branch February 24, 2025 20:01
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