Code Insights: Implement new "Add or remove insights" view #46538
Conversation
|
❌ Problem: the label |
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 175655d...c52e9e1. No notifications. |
|
Codenotify: Notifying subscribers in OWNERS files for diff 175655d...c52e9e1.
|
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits c52e9e1 and 175655d or learn more. Open explanation
|
leonore
left a comment
There was a problem hiding this comment.
just passing by as a code insights contributor- this looks great!
There was a problem hiding this comment.
for any curious passerby, this made me check whether we allow duplicates in the repo UI, which we do, but we must deduplicate somewhere because we still only count results for 1 repos (https://sourcegraph.sourcegraph.com/insights/aW5zaWdodF92aWV3OiIyS1MwRHgxaFJQVVVpWlV5dlh0R2h3WERYSjAi)
There was a problem hiding this comment.
@leonore prior to this PR we used deprecated repositoryScope query in each data series definition, but since all series share the same set of repositories we moved this query on the top level and there is no more need to do a uniq filtering here.
If customers somehow end up with repositories duplicates I think we should dedupe them on the backend
2ed1aa6 to
b96fdce
Compare
valerybugakov
left a comment
There was a problem hiding this comment.
LGTM! Tested locally and left a couple of optional comments.
There was a problem hiding this comment.
Is this related to CSS order in production issue?
There was a problem hiding this comment.
Oh yeah (I've had this PR before we added :where to the card styles), I think we can remove it, right?
There was a problem hiding this comment.
Curious, if we still need this eslint rule at this point?
There was a problem hiding this comment.
I think we can drop this. will do it in a separate PR
There was a problem hiding this comment.
Does that mean that the items array is updated on every render, which causes setSuggestOptions(items) inside of the MultiComboboxList, which might cause a lot of rerenders since it updates the top level object? (might not a be a problem, just double-checking)
There was a problem hiding this comment.
I see what you mean here but I think this is safe because
- In this particular example there is only one moment when we don't have connection object and fallback on empty (first time list loading phase)
- Even if we call useLayout every time in the MultiCombobox implementation I used mutable ref variable as a store so no additional react call will be triggered
There was a problem hiding this comment.
Is there a binding between this fragment and the query it assumes already fetched these fields? I wanted to find a query where this fragment is used to understand how it relates to the API request sent to the server.
There was a problem hiding this comment.
there is no strict binding, I mean we don't use this particular fragment anywhere else but here, it does rely on the cache data, we assume that at the moment when we open this modal we already loaded information about the currently opened dashboard. I added a comment about this and linked the original query on which we rely here.
There was a problem hiding this comment.
Interesting stuff! We recently discussed with @philipp-spiess how viable it would be to use usefragment_experimental to bind React components to their data needs.
There was a problem hiding this comment.
Pagination hooks still look scary :)
…he next data set)
9377176 to
5c081ae
Compare
Closes https://github.com/sourcegraph/sourcegraph/issues/46291
This PR adds new add or remove insights UI. The new UI has
Test plan
App preview:
Check out the client app preview documentation to learn more.