keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
398 stars 111 forks source link

chore(web): tweak banner display of 'autoaccept' suggestion #12312

Open mcdurdin opened 2 months ago

mcdurdin commented 2 months ago

When the banner highlights an auto-accepting correction, it shows it with grey background and white text. It also shows the same styling when the current word is recognized as a word and will be selected unchanged. This is a little misleading, because it suggests that the word will be changed. It might be better to either not highlight where there are no changes, or highlight differently.

Screenshot_20240829_091321_Google.jpg

Secondary issue, the white-on-grey color contrast level is probably not an accessible combination.

jahorton commented 2 months ago

It may be wise to not highlight the suggestion in this case.

Some things worth note toward fixing this:

The function responsible for doing highlighting:

https://github.com/keymanapp/keyman/blob/0ae160c74f69f02348996e5e85670d93ab9e9b78/web/src/engine/osk/src/banner/suggestionBanner.ts#L326-L334

Here's where auto-selected suggestions are told to highlight:

https://github.com/keymanapp/keyman/blob/0ae160c74f69f02348996e5e85670d93ab9e9b78/web/src/engine/osk/src/banner/suggestionBanner.ts#L611-L621

This may also be mildly relevant:

https://github.com/keymanapp/keyman/blob/0ae160c74f69f02348996e5e85670d93ab9e9b78/web/src/engine/osk/src/banner/suggestionBanner.ts#L531-L532


My initial thoughts toward a solution: