Feature Ctrl+K search pop-up

holatuwol

Developer
After coming back to try the game again after getting a very friendly and nostalgic email from Veracity, I noticed that I didn't know where anything was in the UI, so I added something to make it easier to find menu items.


I bound it to Ctrl+K to mimic Slack and Discord's way of quickly switching to a different channel. I've only just started playing again, though, so my view for what people would want to quickly access is pretty biased towards what a new player would want to do (basically, I'm just accessing Modifier Maximizer at the moment, because so many areas have weird stat requirements), which is only stuff I can access via menu items at the moment.

As such, my curiosity is what other things are difficult to get to in the UI that might be made easier if people could just type the name of the thing of they were trying to access?
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Welcome back hola! It's great to see you. This also reminds me of "Ctrl (or ⌘)+P" which is Command Palette in a lot of code editors. It's a great idea, we could eventually let scripts hook into it or something and add to the list of available palette commands.
 

holatuwol

Developer
Right now, it recursively checks the scripts menu (just like every other menu) and adds everything there. To make it more usable, I applied an update that uses the full script path rather than just the file name, so that two different scripts with the same file name actually show up separately.

With that being said, I don't know how well this interacts with real script folders, now that we have people who have SVN and Git folders inside of their repositories, or if the scripts menu has already been rendered unusable by that and so we should rethink the scripts menu at the same time.
 

fronobulax

Developer
Staff member
Right now, it recursively checks the scripts menu (just like every other menu) and adds everything there. To make it more usable, I applied an update that uses the full script path rather than just the file name, so that two different scripts with the same file name actually show up separately.

With that being said, I don't know how well this interacts with real script folders, now that we have people who have SVN and Git folders inside of their repositories, or if the scripts menu has already been rendered unusable by that and so we should rethink the scripts menu at the same time.

While you were idle there was a lot of discussion about scripts and some tweaks were made. There are several robust and good ideas out there but the implementation effort or the transition from "here to there" tended to reduce the enthusiasm. I'd love to have a new thread about revamping the scripts infrastructure and associated conventions with your contributions.
 

holatuwol

Developer
One idea is to merge the scripts menu, the bookmarks menu, and the gcli toolbar functionality together into the single Bookmarks menu, and then let the quick access take care of any potential usability issues with a large set of bookmarks buried in a menu, and then let the reordering serve the same functionality as pinning / MRU.


That would allow us to not have to think too hard about the infrastructure or associated conventions, removes any issues with listing too many scripts that are helper / utility function scripts that shouldn't be called directly, and allows people to name the scripts whatever they want.
 

fronobulax

Developer
Staff member
One idea is to merge the scripts menu

I'm not sure what this does for me since I don't use KoLmafia bookmarks and am not sure what what the gCLI toolbar functionality is.

people to name the scripts

The script naming is also driven by script writers who "include" scripts and want to be absolutely certain that an included script is the one they expected. A desire to use JavaScript, instead of ash, and to use standard JavaScript libraries was a driver for some of the changes.
 

fronobulax

Developer
Staff member
I'll report these here.

1) I run a script from the Script menu. Previously doing so had no effect on what mafia windows were displayed. Now running the scrip also shifts focus to the gCLI window. I prefer the old way.

2) I run a script from the Script menu. Then I run it again. Previously, because of the MRU sorting, the script I had just run would appear at the top of the listing of scripts. Now it doesn't and I have to scroll to find it again (since I almost never use a keyboard when running KoLmafia). I prefer the old way.
 

MCroft

Developer
Staff member
I still haven't done much with the concept, but I think the scripts menu has evolved into a package manager running on top of a VCS tool with some weird adaptations around the VCS paradigm.

I'd like to see scripts have a manifest file that includes a menu entry (0 or more menu entries) that allows things that shouldn't be run directly (library/helper/sub-scripts) to be installed but not displayed. We can fall back to current behavior for the scripts that haven't been (and possibly will never again be) updated.

I personally find the constant re-ordering of scripts difficult to use, so my preference is to allow both Frono and myself to be satisfied by making the entire concept of the MRU optional.

The biggest gap I know of with scripts is that there is a known but never-gonna-be-fixed issue in Github's SVN bridge code which sometimes causes invalid revisions to be constructed on-the-fly and SVN update to fail silently. No client has a good model for when a mandatory field is missing, including the client we include.

Which is where an actual git client and a smart checkout command that can tell if the URL is for SVN or GIT would be a good solution. I've got the GIT part working, but I've stalled out on mirroring (or refactoring) the current SVN tasks around getting the delta and installing it.

One of my hopes for a later, better package manager solution is that we could remove some of the special case code around "what if the script and/or another script modified my script files and the package wants to update?" issues.

I'd be happy to collaborate on that one if anyone is interested.
 

fronobulax

Developer
Staff member
the entire concept of the MRU optional

Actually the Script MRU is and has been optional since it was first implemented. A user opts in to using the MRU, derived from activity, rather than the standard list derived from the file system, by setting scriptMRULength to a positive value. The ordering and the dynamic nature of the display are both important features to my gameplay workflow.

I may be the only user who remembers that and has opted in but I remain disappointed by the implementation of the search popup.
 

fronobulax

Developer
Staff member
Full disclosure.

I did not see the MRU sorting issue on two accounts today. I confirmed it is still happening on a third account but yesterday and today there was also a debug log and it is quite possible that the change exposed a bug rather than created one.
 

Attachments

  • DEBUG_20220513.txt
    7.7 KB · Views: 3
Top