Commit graph

1965 commits

Author SHA1 Message Date
Joshua Horton
a0df12247b
Merge pull request #6566 from keymanapp/change/web/touch-alias-followup
change(web): touch alias optimization followup
2022-04-26 17:08:21 -05:00
Joshua Horton
95c7cc2675
chore(web): applies code suggestion
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-04-26 06:53:49 +07:00
jahorton
782d2ae07a feat(web): adds .getKeyboard().IsRTL, .HasLoaded 2022-04-25 13:27:57 -05:00
jahorton
7990cdc1dd feat(web): caret placement fine-tuning 2022-04-25 11:53:36 -05:00
jahorton
509fbb02e8 change(web): clarifies caret positioning logic 2022-04-25 11:18:02 -05:00
jahorton
efcc4276a3 change(web): performCaretSearch now member of TouchAliasElement 2022-04-25 09:25:13 -05:00
jahorton
56b4c5ac50 fix(web): caret position when page is scrolled 2022-04-20 15:28:35 -05:00
jahorton
d3900fce47 docs(web): documents some optimizing blocks 2022-04-20 15:06:32 -05:00
jahorton
a355f2ecff chore(web): minor polish 2022-04-20 15:05:03 -05:00
jahorton
48fb1371c0 docs(web): better comments & var naming 2022-04-20 15:02:57 -05:00
jahorton
94edc5c9da fix(web): mobile device caret positioning 2022-04-20 14:52:33 -05:00
jahorton
1c394c2744 change(web): further clarifies performCaretSearch 2022-04-20 13:03:32 -05:00
jahorton
cd666d0346 fix(web): major performance boost, fixes search bound logic bug 2022-04-20 12:29:00 -05:00
Joshua Horton
1ff699d221
Merge pull request #6535 from keymanapp/fix/web/5730-keyboardchange-event-promise-wait
fix(web): keyboardchange event should defer until successful
2022-04-19 20:50:09 -05:00
jahorton
189e6a77d9 change(web): implements PR suggestions, includes test-page-UI-code move 2022-04-19 09:41:46 -05:00
Marc Durdin
2eb10663ba
chore(web): Apply suggestions from code review
Co-authored-by: Joshua Horton <joshua_horton@sil.org>
2022-04-19 06:47:31 +10:00
jahorton
d65e933d9d fix(web): keyboardchange event defers until loaded 2022-04-14 18:01:35 -05:00
Marc Durdin
d2d6b4a12d chore: address review comment 2022-04-13 08:18:54 +10:00
Marc Durdin
49eb062c65 feat(web): prediction casing follows current layer
Fixes #6455.

This involved adding an extra hint to the data passed into the lexical
model layer, being the CasingForm that the current layer wants to use.

Given there are several entry points to the lexical model layer, this
meant a few places where we needed to check the current layer.

I refactored the very long function `InputProcessor.processKeyEvent` to
extract out the `buildAlternates` function. There should be no
functional changes to the `buildAlternates` code. But it makes
`processKeyEvent` significantly easier to read.
2022-04-08 16:14:01 +10:00
Marc Durdin
e616900cad
Revert "feat(web): prediction casing follows current layer" 2022-04-08 14:50:32 +10:00
Marc Durdin
0ad1d496d3 fix(android): key tip sticky with multitap
Fixes #6489.

The issue arose in multitap scenarios, where the tip display state
became desynchronised with the actual display state as maintained in
the Android code.

The fix I applied was to reduce some of the state checks into the js
wrapper android-host.js. This is not ideal. The state machine for key
tip display is scattered across four functions in three files:

* visualKeyboard.ts: VisualKeyboard.highlightKey
* visualKeyboard.ts: VisualKeyboard.showKeyTip
* embedded/keytip.ts: KeyTip.show
* android-host.js: oskShowKeyPreview / oskClearKeyPreview

I have moved the actual re-creation check for the tip to the lowest
level functions -- those in android-host.js. But a more detailed look at
the state machine and a refactoring would certainly be worthwhile.
2022-04-07 15:27:41 +10:00
Marc Durdin
b7ce99480f feat(web): prediction casing follows current layer
Fixes #6455.

This involved adding an extra hint to the data passed into the lexical
model layer, being the CasingForm that the current layer wants to use.

Given there are several entry points to the lexical model layer, this
meant a few places where we needed to check the current layer.

I refactored the very long function `InputProcessor.processKeyEvent` to
extract out the `buildAlternates` function. There should be no
functional changes to the `buildAlternates` code. But it makes
`processKeyEvent` significantly easier to read.
2022-04-01 16:20:50 +11:00
Marc Durdin
a192803021 chore(web): address review comment 2022-03-30 16:39:49 +11:00
Marc Durdin
0cadb83383 fix(web): track load error detail
This is a follow-up for #6331. We still did not have enough detail to
be able to trace the root cause of the load errors. This adds a little
more diagnostics.
2022-03-30 06:44:03 +11:00
Marc Durdin
c0248bec1b
Merge pull request #6432 from keymanapp/fix/web/shifted-key-cap
fix(web): *Shifted* showed unshifted key cap
2022-03-29 12:36:12 +11:00
Marc Durdin
46807d7af2 fix(web): *Shifted* showed unshifted key cap
While this was done in code as a global override, probably following
Apple stylistic changes, it is better to leave this to the keyboard
developer to decide on.
2022-03-28 09:02:22 +11:00
Marc Durdin
295f25144d
Merge pull request #6383 from keymanapp/fix/web/5929-ios-popup-positioning-and-style
fix(web): ios popup positioning and style
2022-03-28 04:46:00 +11:00
Marc Durdin
b3ddf633df fix(web): adjust calc for callout height 2022-03-25 09:10:29 +11:00
Marc Durdin
3858a4c9e5 fix(web): further iOS adjustments 2022-03-24 07:35:28 +11:00
Darcy Wong
19f1d4f5a7 chore(android): Merge remote-tracking branch 'origin/beta' into fix/android/subkey-move 2022-03-23 13:05:25 +07:00
Marc Durdin
5c388d1d7e
Merge pull request #6366 from keymanapp/feat/web/6364-new-layer-old-layer-replaces-layerchanged
feat(web): `&newLayer` and `&oldLayer`
2022-03-23 16:53:34 +11:00
Marc Durdin
336ab51010
Merge pull request #6406 from keymanapp/fix/web/5942-touch-alias-element-position
fix(web): adjust touch alias element positioning
2022-03-23 11:27:35 +11:00
Marc Durdin
adf3fe28c9 fix(web): tweak iOS key preview and longpress dimensions
Adjusts the dimensions to use pixel boundaries to prevent antialiasing
for some of the key preview and longpress popups, and adjusts horizontal
positioning of key preview to center more precisely, for iOS.
2022-03-23 08:23:29 +11:00
Marc Durdin
558a742a45 fix(web): adjust callout height 2022-03-22 10:02:36 +11:00
Marc Durdin
6b1ae79c11 fix(ios): remove busy 100ms waitForFonts timer on iOS
Observed while debugging another issue on iOS. The
VisualKeyboard.waitForFonts function sets up a busy timer to wait for
font loading. This functionality is not even needed on the iOS app,
because it's really only used for the touch alias elements.

However, it was being called, potentially multiple times, leading to the
timer never being removed. On Android, the timer was correctly removed.

This aligns the iOS code path with the Android code path.
2022-03-22 09:21:17 +11:00
Marc Durdin
88ffb8bbd2 fix(web): adjust touch alias element positioning
Fixes #5942.

The touch alias element position was not consistent across all browsers,
leading to misalignment in some situations. Identified missing CSS to
make the positioning consistent, as far as I can tell, which led to the
additional benefit of reducing the per-browser special cases.
2022-03-22 08:38:12 +11:00
Marc Durdin
767d278f87
Merge pull request #6357 from keymanapp/fix/web/bounding-rect-offset
fix(web): bounding rect offset was incorrect
2022-03-19 13:13:19 +11:00
Marc Durdin
e3537e7bb7 fix(web): crash on focus before init
Fixes the following crash noted when testing on keymanweb.com, focusing
during the load process on a slow network.

```
helpers.ts:111 Uncaught TypeError: Cannot read properties of null (reading 'vkbd')
    at g.pageFocusHandler (keymanweb.ts:125:44)
    at sentryWrapped (helpers.ts:87:17)
```
2022-03-17 15:50:52 +11:00
Darcy Wong
70ec9b7096 fix(web): Don't update base key if popups displayed 2022-03-17 10:58:48 +07:00
Marc Durdin
dde56e6b90 fix(web): adjust positioning for longpress popup
Adjusts positioning calculations for longpress popups and corresponding
styles to make it consistent across all platforms, particularly iOS.
2022-03-17 10:20:19 +11:00
Marc Durdin
86b4b82661 fix(web): key preview position was inconsistent on iOS
Adjusts calculations for key preview and ensures we use box-sizing:
content-box in all circumstances, to make it consistent across all
platforms.
2022-03-17 10:19:10 +11:00
Marc Durdin
24398b4461 fix(web): key square needed vertical align top
On Safari, some keys were vertically misaligned, due to different
default vertical-align.
2022-03-17 10:17:23 +11:00
Marc Durdin
a2aef99c3e fix(web): font size on key preview
Font size adjustment needed an override for the key preview to prevent
it using the base key font size as a starting point.
2022-03-17 10:15:40 +11:00
Marc Durdin
7a5d1b964f chore(web): Merge branch 'beta' into feat/web/6364-new-layer-old-layer-replaces-layerchanged 2022-03-17 04:55:25 +11:00
Marc Durdin
d3136b8860 fix(web): ios popup positioning and style
Fixes #5929.
Fixes #6381.

This fixes four separate issues with the longpress popups and key
previews:

1. The key preview was offset by a couple of pixels (unreported issue).
2. The background 'shim' did not cover the key caps, which caused them
   to look startlingly white when the rest of the background greyed
   down (#5929).
3. The popup menu was incorrectly wrapping to two rows due to sizing
   model mismatches (#6381).
4. The popup menu would be realigned incorrectly for the in-app
   keyboard, when moving it to keep it in the keyboard area (#5929).
2022-03-16 11:24:02 +11:00
Marc Durdin
1038379c41
Merge pull request #6351 from keymanapp/fix/web/caps-state-tracking-for-touch
fix(web): caps state tracking for touch
2022-03-15 10:04:45 +11:00
Marc Durdin
4b15c4988e
Merge pull request #6340 from keymanapp/fix/web/5964-subkey-position-on-scroll-non-zero
fix(web): subkey touch position after scroll
2022-03-15 10:02:07 +11:00
Marc Durdin
45c5f8a1ea chore(web): remove 0 from store defaults 2022-03-13 08:31:15 +11:00
Marc Durdin
b23df3fbc8 feat(web): &newLayer and &oldLayer
Fixes #6364.

Removes `&layerChanged` and adds `&newLayer` and `&oldLayer` system
stores with the additional nuances around values as described in #6364.
2022-03-13 08:29:15 +11:00
Marc Durdin
ada527bd80 fix(web): bounding rect offset was incorrect
When embedding the On Screen Keyboard into a page, the calculation for
the bounding rectangle only took into account the first offsetParent,
which meant it would get the offset incorrect when there were multiple
layers of offsetParents.

Once I changed to using getAbsoluteX / getAbsoluteY, this also corrects
for scroll with window.pageOffsetY, so we can eliminate that special
case for fixed positioning.

This was observable in the Web Developer test window, where interaction
with the bottom row of the keyboard in touch mode was not working
correctly, in 15.0.210-beta.
2022-03-11 04:34:36 +11:00