chore(web): improve error logging in predictive-text worker message validation
Previously logging an error resulted in two Sentry issues to be created. This change now combines the log message and the error into one call to `console.error`, thus resulting in only one Sentry issue being created.
Previously logging an error resulted in two Sentry issues to be created.
This change now combines the log message and the error into one call to
`console.error`, thus resulting in only one Sentry issue being created.
Addresses a PR comment by mcdurdin on #13597 (at https://github.com/keymanapp/keyman/pull/13597#discussion_r2023971170) in regard to the motivation for gesture input serialization.
> I just don't understand how the problem described here can arise -- unless we are introducing deferral with promises -- but even then, if we consistently defer every incoming event with a promise, then the order would still be automatically enforced.
In particular, this aims to clarify how the macrotask queue gets involved and can interfere with the ordering of promises.
Fixes: #13620
Turns out there was actually a final-row pixel offset being applied for the OSK. I _believe_ this was something originally done for touch-oriented OSKs that ended up applied to all during 17.0's OSK refactoring efforts.
kmwosk.css does define layer-group padding above and below (1 px each) for touch keyboards already. Furthermore, things look fine when removing this extra 1px offset on the bottom from the last row. I think we're fine to just drop this minor offset and move on for now.
As identified in the analysis for #13344, held backspaces have not been cancelled when receiving new inputs. It's better and cleaner to have it act similarly to normal keystrokes - receiving a new key input autocompletes any currently-held output keys.
The current, existing behavior also has the potential to get particularly messy with multitaps, which restore the context at their start. If a backspace is held and then a multitap begins, each new tap of the multitap would undo the backspaces that triggered since the first tap of the multitap.
To facilitate debugging cases where gestures don't work as intended, this adds sanitized logging for keystrokes resulting for gestures. These are only to be output when a relevant error or warning is emitted.
This is primarily being added to facilitate investigation of #13344.
Fixes: #13278
The fallback default keyboard corresponding to an uninitialized cookie is `Keyboard_us:en`. This should only occur if the site actually registers its stub before initialization - and we weren't checking/filtering for this properly.
The error itself only occurred if there _were_ stubs pre-registered before init - if none existed, the error does not result.