-
Notifications
You must be signed in to change notification settings - Fork 348
feat: allow validating highlighted attribute expressions when creating #1576
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
base: main
Are you sure you want to change the base?
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| luceneExpression: '', | ||
| alias: '', | ||
| }, | ||
| { shouldFocus: false }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the Lucene expression input was being focused for the newly appended field which was a bit confusing as that field is optional. This change stops any field being autofocused in the new row.
Code Review✅ Overall looks good! Clean implementation with proper error handling. Minor Issues:
Good patterns followed:
Optional improvement: Consider adding color to error message at line 291 for better UX consistency. |
E2E Test Results✅ All tests passed • 60 passed • 4 skipped • 748s
Tests ran across 4 shards in parallel. |
pulpdrew
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally, this looks great!
IMO, the button and error messages being in the middle of an attribute row makes it harder for me to determine where one attribute section begins and another ends.
I wonder if @elizabetdev has any thoughts on the placement of this button and error message?
Some ideas I have:
- Move the button to the right of the lucene expression, or make it an icon button (checkmark or X depending on validation result?) next to the trash can icon.
- Use a toast/notification to indicate error or success instead of a message for displaying the error
- Add some sort of divider between rows
Screen.Recording.2026-01-08.at.3.11.15.PM.mov
Thanks for the review! I agree that the layout feels a bit cluttered now, especially when there is an error to display. I tried a few different placements for the button and message and nothing felt 100% right. I like your 3 ideas, but will wait for Elizabet to chime in as well :) |
Closes HDX-3096
This PR adds the ability to validate an entered highlighted attribute SQL expression and alias in the sources form.
Once an expression (and an optional alias) has been entered in the source form (for a trace or log source), the "Validate expression" button can be clicked to check that the expression is valid. If the expression is invalid, the error will be displayed under the button. Validation results are cached by react-query via the useExplainQuery hook.
Untitled.mov