Archipelago icon indicating copy to clipboard operation
Archipelago copied to clipboard

kvui: Implemented and tested hint autocomplete suggestions

Open MatthewMarinets opened this issue 1 year ago • 2 comments
trafficstars

What is this fixing or adding?

Replacing changes with multiple commits, and trying to get some better code quality out of them. Currently ported changes:

  • Dropdown text is left-aligned and displays nicely when the text is too wide for the window

image image

Old changes:

  • I've archived the branch locally so can bring these changes back up on request, or you can look at the archived branch here: https://github.com/MatthewMarinets/Archipelago/tree/mm/archive/autocomplete_hint_updates

Various fixes and improvements for PR #3535:

  • Focus remains on the hint text box after selecting something, so the user doesn't have to click it before hitting enter
  • Text in the dropdown is now left-aligned
  • The dropdown is now navigable with up/down keys
  • Fixed a mypy issue

How was this tested?

Played around with it on the sc2 client:

  • Tested clicking a dropdown option put it in the textbox, with focus on the textbox
  • Tested up/down keys navigate the dropdown
  • Tested pressing enter while a dropdown option is highlighted pastes the dropdown option's item name in the text box
  • Tested pressing enter while no dropdown option is highlighted immediately tries to hint the contents of the textbox
  • Tested selecting an option with the mouse while a dropdown option is highlighted behaves the same as clicking an option without keyboard dropdown highlight
  • Tested focus remains on the textbox after a hint command is sent out

Remaining issues

  • There was some slowdown holding delete when the list item name matches is large (noticed with "Progressive" in the sc2 item pool)
  • ~~Navigating down with arrow keys doesn't scroll the dropdown when selection goes off-screen~~
  • Narrowing the window causes search result text to squish onto multiple lines in a bit of a mess rather than truncating
  • Fuzzy search could be better
  • Search results don't include item groups
  • Decision point: should the textbox be cleared when a hint is sent out?

If this makes graphical changes, please attach screenshots.

Navigating with arrow keys, deleting, then navigating to "Marine" with arrow keys and selecting "Laser Targeting System" with the mouse: hint_search_demo

MatthewMarinets avatar Jun 15 '24 02:06 MatthewMarinets

Wheeeeee demo_hint_scroll

MatthewMarinets avatar Jun 15 '24 02:06 MatthewMarinets

It's still possible to get undefined focus if you type something, go down on the list with arrow keys, then click the text input again. Not sure what's going on there.

MatthewMarinets avatar Jun 15 '24 02:06 MatthewMarinets