Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Lens] Suggestion improvements #43688
[Lens] Suggestion improvements #43688
Changes from 66 commits
33802fd
f5c809a
55a1fe3
c159b4e
356e9b6
6aea5dc
1135b3d
2dc623f
bae8a6c
4ee8f63
218cf00
a4f8c18
59e19d9
eda40df
55b59dd
77b02a2
085210c
d00ddbb
8436275
4cbf3c8
5065a14
b11021b
d7bf71b
3d947ab
e46f935
43ffe23
981c577
7e1c550
859aa99
227d798
c85345e
7cdc774
c3beb1a
837c76c
b78a44f
e5ebcf8
400c352
8d9cab5
40b99f3
e3667ce
2c975bd
1dfa94e
30f27b5
16c3b03
d5452fd
9b3d76c
ed11229
694e845
61f3eba
3cec779
54ad77c
82a4fc8
0dfa265
355f3fc
3a6a23c
9a1ff84
7a31208
4729ae4
563205b
f35c722
25cdc68
5cbca86
d1d3647
aad9403
d69a3db
f9bf7b1
8b7a9e0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Instead of hide, should we just make this part of the filter on line 138?
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.
If we do this, the single-row table won't be re-used if you switch e.g. from a metric visualization to a table visualization. There is a point to drop the metric if you do that, but I think it's nice to carry over as much as possible.
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.
It looks to me like this could now be
undefined
if you filter out all suggestions- can you handle that case specifically?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.
That could also happen in the old version of the code (e.g. if the datasource doesn't return any suggestions) and is already handled - the return object checks whether
topSuggestion
exists before acting on it.To make this more explicit I moved the call to a separate function with an explicitly nullable return type
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.
It seems like we should not be calling
preparePreviewExpression
if previewExpression is falsy. Maybe we should move this check to the filter clause on line 126?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.
Moved, but it didn't really make things much simpler... The problem is that there are a lot of conditions that can cause the expression to become null, but getting rid of one of them is probably worth it.
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.
Time ranges + queries in suggestions LGTM!