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

Veracity

Developer
Staff member
It took a couple months, but the newly improved version of this has been finally merged.

Ctrl-K (or CMD-K on a Mac) pops up a little menu that gives you an AutoFilterText field to help you select from a variety of "places to go".
(which is to say, start typing and it filters out things that don't match.)
Find/select what you want, click OK (or hit Enter) and boom! there you go.

This can include KoLmafia frames (Graphical CLI, Preferences), recently run scripts, or "bookmarks" that you can configure in Preferences/Bookmarks.

Bookmarks can be CLI commands (with arguments), scripts (with arguments) as you'd invoke in the CLI, chat commands starting with "/" (as you'd type in the CLI), or scripts that you find via a File Picker. You can create them and then give them the shorthand name of your choice.

Also, if you run with the scriptMRUList (which will remember the N-most-recently-used scripts you ave run, these will also be available to select.

You may notice that the Scripts menu no longer has an incredibly unwieldy list of every script in your file system. You can use a File Picker to find them - and if you run with the scriptMRUList, a smaller, easier to use list of only the scripts you used recently will be there.

We look forward to feedback (suggestions and bug reports) after you've tried it out for a while.
 

MCroft

Developer
Staff member
Two things.

I think it's interesting, but I already did this by adding my daily use scripts to the Daily Deeds panel (Veracity Meat Farm and Autoscend).

I'd love to see the two concepts integrated (like a "make this script a daily deed" button in the bookmarks UI, or some other way to use that interface with this backend, as it were).

Second, I'm seeing console output I wasn't seeing before related to keyboard use.


Rich (BB code):
Build main-31211b2-M 17.0.3 (Eclipse Adoptium 17.0.3+7) Mac OS X x86_64 13.0

Currently Running on Mac OS X
Local Directory is /Users/mcroft/Library/Application Support/KoLmafia
Using Java 17.0.3

Located char match from search: item 'Preferences�' in menu 'KoLmafia' with match penalty 2
Choosing result from list: item 'Preferences�' in menu 'KoLmafia' with match penalty 2
Marking command key cache valid

The first two lines showed up after I pressed CMD-, to open the preferences. The 3rd line showed up when I pressed CMD-K.

I can't find any of that in the source, so I don't know where it's coming from.
 
Last edited:

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I'd love scripts installed from git/svn to be able to define "entrypoints" in some sort of manifest that can automatically add to the Ctrl-K menu.

For example, a farming script could insert into your Ctrl-K menu descriptive actions like "FarmScript: Run farming" "FarmScript: Show me lifetime farming statistics" etc.

This is a really exciting feature!
 

matt.chugg

Moderator
FWIW, I absolutely love this feature, I've always been a keyboard over mouse user, and spotlight/winkey/katapult style navigation makes so much more sense to me than anything else.

Thank you
 
Top