Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvui: Implemented and tested hint autocomplete suggestions #3537

Open
wants to merge 1 commit into
base: kvui_autocomplete_hint
Choose a base branch
from

Conversation

MatthewMarinets
Copy link
Contributor

@MatthewMarinets MatthewMarinets commented Jun 15, 2024

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:

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
Copy link
Contributor Author

Wheeeeee
demo_hint_scroll

@MatthewMarinets
Copy link
Contributor Author

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 MatthewMarinets force-pushed the mm/autocomplete_hint_updates branch from a6bf738 to d84e76e Compare June 16, 2024 19:55
@Exempt-Medic Exempt-Medic added is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. affects: core Issues/PRs that touch core and may need additional validation. labels Jun 19, 2024
@ScipioWright ScipioWright added the waiting-on: author Issue/PR is waiting for feedback or changes from its author. label Jul 9, 2024
@Exempt-Medic Exempt-Medic removed the waiting-on: author Issue/PR is waiting for feedback or changes from its author. label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants