Giter VIP home page Giter VIP logo

Comments (5)

CrossR avatar CrossR commented on May 22, 2024

I've started to have a look into this and integrating my library in now, and the first issue I've hit is that it looks like the full list isn't being passed into the sort?

That is, I've added some logic inside of Filter.re and the sorting wasn't changing, nor does it seem to change with the existing filter logic.

If I throw in a Console.log(List.length(items)) in there, it seems to vary every time I open the menu, which implies that the streaming of the results could be the issue?

image

In the image I'm opening the menu 5 times and searching for R and getting different list lengths every time. It doesn't seem to change if I wait for a second or so either.

I think this would be why @bryphe was seeing the list not changing since only part of it is being updated.

EDIT: Actually, if I log the QuickOpen.re file, I can see what is happening and only the final streaming bit is sorted:

image

from oni2.

akinsho avatar akinsho commented on May 22, 2024

@CrossR each time you add a letter in the quick open you will be filtering against a potentially ongoing streaming in of results

ripgrep_results

The screenshot shows the incremental accumulation of results, regarding the results not changing, I haven't been able to reproduce this locally but the current mechanism is very fussy i.e. it expects an exact match i.e. if you want to match on Filter.re you have to type that string in exactly it cant be Fltr that will get no results.

from oni2.

akinsho avatar akinsho commented on May 22, 2024

As you say I wouldn't expect a consistent number when re-opening the list as it could be some arbitrary amount being streamed in at a time.

The filter is being passed a command type which is a record

type command = {
 name: string,
 command: unit => unit,
 icons: option(string)
}

so you have to filter on name.

I don't think it should matter what state the streaming is at, since ideally the strategy ought to take a list of commands of any length and a query and filter it

from oni2.

akinsho avatar akinsho commented on May 22, 2024

One thing to note @CrossR is that the sequence of events is

  • type a key -> MenuQuery(userQueryString) -> Filter.menu(queryAtTheTime, CommandsAtTheTime)

  • Meanwhile open quickOpen -> stream begins -> intermittently calls -> MenuUpdate(newCommands)

the above flows are separate i.e. the filter is currently only called when a user hits a key not when the content of the list changes (I didn't forsee us using a streaming pattern), it might be that in the reducer in Menu.re when an update comes in you should also check if String.length(query) > 0 if so append the commands but also, re-run Filter.menu(existingQuery, newlyUpdatedCommands)

from oni2.

CrossR avatar CrossR commented on May 22, 2024

I think we can close this out, and make any follow up issues if we hit any performance issues or scoring issues.

Implemented over in #204.

from oni2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.