Update method sort order to place auto-model predictions earlier#3382
Update method sort order to place auto-model predictions earlier#3382robertbrignull merged 10 commits intomainfrom
Conversation
|
I haven't had time to manually test this yet, but I wanted to get the PR up before I finish today. I'll do more testing of this tomorrow to make sure it's all working. |
|
I've pushed changes to the sort order. There are still some slight rough edges:
|
I've looked into this now and I think it can be fixed but it'll be quite a big change and definitely not something to do lightly. In One option could be to combine the modeling store updates into one method, and then also combine the view state updates into one message. So instead of having separate Unfortunately this is quite a bit change to how we organise our webview messages. |
koesie10
left a comment
There was a problem hiding this comment.
- If you edit a negative AI prediction it'll suddenly get sorted higher with the positive AI predictions. Because it now has a modeling, and
processedByAutoModelMethodsis still set even though you edited it manually. I don't think I ever want the sort order to immediately change as a result of me changing a dropdown because then I can't find the method again. Maybe this is enough of an edge case that we can leave it for now.
I think this is actually quite common when the LLM missing something that is a genuine sink/source. However, I'm not sure how we can fix this without changing something about our data model, so perhaps we can leave this for now and try to fix it in a follow-up?
I've looked into this now and I think it can be fixed but it'll be quite a big change and definitely not something to do lightly.
I agree, and depending on how jarring it is, we should try to fix this in a follow-up. A somewhat easier change might be to delay sending postMessage calls for 1 "tick" (i.e. setTimeout(fn, 0) and adding some mechanism to receive batch messages in the webview. Then we wouldn't need to change the webview messages and could instead just rely on that logic to handle it (and React should batch those state updates as well).
I think none of these are blockers and that we can merge this as-is (I haven't run this locally yet).
That does sound like a simpler change. Theoretically it should be safe to batch messages and maybe it'll improve performance in other places too. If we merge this as it is then I can open issues the next steps of editing negative AI predictions and the flickering when adding the first modeling of a method. |
As described in the code, the intended sort order is:
Then secondarily on the number of usages and the signature, as we do currently.
This required passing a lot more information into the sorting function, which has made the code a little bit more complex.
I've also added unit tests of the sorting function. I couldn't find any existing methods, but I think we definitely needed some now.
Also includes a couple a small refactorings (done as their own commits) to make the later changes easier.
Checklist
ready-for-doc-reviewlabel there.