Ckan: [Bug] letters aren't in the typing order in the search box

Created on 19 Jul 2020  路  11Comments  路  Source: KSP-CKAN/CKAN

Background

  • Operating System: Ubuntu 20.04
  • CKAN Version: 1.28.0

Problem

As I type in the search textbox ckan starts filtering mods, for some reason letters ends in a different order than how I typed them. Example, if I type quickly "kerbal", in the search box I see "kbelra". If there are no mods because none match the filter then additional input doesn't end mixed up.
I have to type one letter at a time and wait for the list of mods to update before writing the next letter for get what I want.

This is an issue I been having for a while in previous versions as well, is not particular to 1.28.0 and probably is not noticeable in fast computers.

Steps to reproduce

  • type any word qucikly in the search box
  • check if the text in the search box is correct.
Bug GUI Linux

All 11 comments

I've seen this as well, and I think it may be related to the reason these fields run on a timer on Mac:

https://github.com/KSP-CKAN/CKAN/blob/7482dc081d2aa542561dfbb5f049dbfb05616914/GUI/Controls/EditModSearch.cs#L205-L247

(Note to self, test this with the All filter, the number of rows in the grid may affect it.)

Suddenly I'm not able to reproduce it anymore. Regardless of filter, sort order, what I type, etc., the characters appear in the right order and the correct mods are found.

@m4v, what version of Mono do you have installed? I have 6.12.0.90, maybe older versions of Mono have bugs here?

Chiming in to see that I see the same behavior.

Would be nice if there was an option to "disable auto-updating of mods list" or something like that, so it doesn't search/filter until you hit enter.

probably is not noticeable in fast computers

Out of curiosity, just how non-fast is your system?

Chiming in to see that I see the same behavior.

Same questions, what version of Mono do you have?

Would be nice if there was an option to "disable auto-updating of mods list" or something like that, so it doesn't search/filter until you hit enter.

I think we'd probably want to just make it work better. Even though I don't currently see mis-ordered letters, there is some ugly flickering that could certainly stand to be improved.

mono --version for me gives Mono JIT compiler version 6.8.0.123 (tarball Tue May 12 15:11:57 UTC 2020)

My computer is pretty fast. i7 7820X with 128 GB of RAM.

My computer is pretty fast. i7 7820X with 128 GB of RAM.

That's good, mine's less powerful, so if you can reproduce it, that rules out system speed as a factor. I may have to try downgrading to Mono 6.8, but I'd rather avoid that kind of pain if possible...

I tried pre-computing the search in a background thread and then applying it in the GUI thread (currently the GUI thread does it all), and that accomplished approximately nothing. Apparently it's the grid itself that's slow, not CKAN's search/filtering logic, and the single threaded nature of WinForms means there's no way to we offload that processing to another thread.

However, we can try extending the timer-based workaround to all Mono clients. @m4v and @tj-murphy, would you mind taking this build for a test drive?

I reduced the timer interval from 700ms to 500ms since that seemed a little long, and based on the above feedback I also tweaked the Enter keybind to execute the search immediately instead of setting focus to the grid. If this seems to help with the issue then we can look at doing this in the main releases.

I'm not sure what the timer thing you're talking about is, but the new functionality where it waits for an enter works perfectly for me!

In addition to fixing the typing glitches, it also made everything much faster, since it wasn't refreshing the mod list with every single character I type.

As far as I'm concerned that version you put in above works perfectly.

I'm not sure what the timer thing you're talking about is

Oh, the CKAN GUI on Mac already works kind of like you saw: Instead of refreshing immediately after a keystroke, it waits 700 milliseconds and _then_ updates, and if there are more keystrokes in the meantime, it resets the timer after each one. So you can type as much as you like without interruption as long as your keystrokes are fast enough. With that test build the delay is 500 milliseconds instead and it's enabled on Linux as well, but otherwise it works the same way.

Thanks for trying it out!

@HebaruSan That change also fixed the issue for me. Just for completeness I'll add that my mono version is 6.8.0.123

Was this page helpful?
0 / 5 - 0 ratings