Autocompleting entities corrupts the text you're typing when the match is not at the start #2753
Labels
No Label
backend
critical
defect
duplicate
enhancement
fixed
frontend
general
invalid
major
minor
normal
oxjs
pandora_client
python-ox
task
trivial
wontfix
worksforme
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: 0x2620/pandora#2753
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Suppose you have the following entities:
Now try to add Yanis Testerson to a time range:
This doesn't seem to happen when the match is anchored at the start of the first suggested entity's name.
Actually, this description is not quite accurate: “Yanis Testerson” is actually named “Yenis Testerson”. The difference is that when the two-character input “Te” is corrupted to “Ye”, it does actually match the first two characters of “Yenis Testerson”.
Autocomplete should probably be limited to leading matches.
I think non-leading matches are useful: anecdotally, surnames are more unique than forenames, and people expect to be able to type the surname.
Is alternativeNames consulted when auto-completing? Many of these actors do actually have unique, confusingly-named "tags" mostly derived from their surname or their common nickname. If I populated these into Pandora, and they were shown and offered as completions in the entity sidebar, then only allowing leading matches might be okay.
Also see: #1023
Attachment 0001-Autocomplete-only-replace-input-when-a-prefix-matche.patch (1714 bytes) added
I haven't tried to address #1023 at all; here's a fix for input getting mangled by the best match being a non-leading one.
Using String.toLowerCase() to match the prefix fixes the common case where you want "joh" to be recognised as a prefix of "John Smith". I'm sure one could contrive a situation where this could still mangle your input ("ß" vs "ss", maybe?) but I think it's probably fine in practice.
In 3637b70/oxjs: