MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
133 stars 171 forks source link

[0.50.01-2024-10-05] Input lag in find parts search window #5016

Open WeaverThree opened 4 weeks ago

WeaverThree commented 4 weeks ago

Prerequisites and Pre-Issue Checklist

Severity *

Low (Minor/Nuisance): Minor glitches or cosmetic issues that don’t affect gameplay and occur rarely.

Brief Description *

When you type in the find parts search dialog, there is a large lag before your keypresses start being registered. It's very appearant when typing inferno quickly. For met it lags and then the whole word appears. Presumably this is it finding all items conatining an i before considering further input.

I'd suggest adding a 50-100ms delay before the search happens if it's possible, so that if a user is typing quickly the search doesn't activate before their continued keypresses. It'd probably be good practice for all search fields, but this is the one that lags.

This window, to be clear:

2024-10-09_153413

Steps to Reproduce

  1. Get into a campaign
  2. Go to find parts
  3. Type rapidly into the search field

Operating System *

Linux

Java Version *

17.0.12

MekHQ Suite Version *

Free Text (type manually)

Custom MekHQ Version

v0.50.01-SNAPSHOT 2024-10-05

Attach Files

mekhq.MekHQ.initializeLogging(MekHQ.java:306) - Starting MekHQ v0.50.1-SNAPSHOT Build Date: 2024-10-06T03:25:24.214306127 Today: 2024-10-09 Origin Project: MekHQ Java Vendor: Eclipse Adoptium Java Version: 17.0.12 Platform: Linux 6.11.2-202.fsync.fc40.x86_64 (amd64) System Locale: en_US Total memory available to MekHQ: 8 GB MM Code Revision: 82fc89ceba5bfdb40670ba90bdc3e3ca1027a07b MML Code Revision: 446bd8d9c7e28bfdf49d35f312d838c44e16941a MHQ Code Revision: 976204bfa54b995b2d45159b080d13dba8a16ee5

Final Checklist

repligator commented 3 weeks ago

In other (not sure what the correct term is here) 'instant search systems' I've seen, it won't actually search until you type in a certain number of characters. In the case of MHQ, I think not searching until at least two characters are entered would be worth looking into.