nus-cs2103-AY2324S1 / pe-dev-response

0 stars 0 forks source link

Need to press `Enter` twice for command to work #3805

Open nus-se-script opened 1 year ago

nus-se-script commented 1 year ago

When typing commands like list, users have to type the Enter twice due to the autocomplete function, slowing down the user


[original: nus-cs2103-AY2324S1/pe-interim#5245] [original labels: severity.Low type.FeatureFlaw]

wxwern commented 1 year ago

Team's Response

Agreed, we could instead detect if the autocomplete suggestion is already an exact match to the given command, then immediately run the command.

Although, it is non-trivial to design such a behavior. Our considerations include:

Additionally, JavaFX seems to be really weird in terms of keystroke event captures - even autocomplete itself used a bunch of hacks and inconsistent workarounds from days of trial and error to correctly interpret keyboard events.

See workaround notes at: AutocompleteTextField.java#L103, AutocompleteTextField.java#L109, CommandBox.java#L71

Thus, further polishing of how these keystroke events are distributed (e.g., to debug and correctly pass down the ENTER keystroke to the command box) was thus not really in the scope of being done by v1.4.

Duplicate status (if any):

--