feat(web): previewing gestures - common phone, tablet styling + flick animations 🐵#9825
Conversation
User Test ResultsTest specification and instructions
Test Artifacts
|
3811f18 to
1715463
Compare
| if(vkbd.isEmbedded) { | ||
| safeBounds = new PaddedZoneSource(safeBounds, [topPadding * topScalar, 0, 0]); | ||
| } |
There was a problem hiding this comment.
Just caught this as an issue in testing - going off the top of the iOS or Android keyboard was terminating subkeys and flicks almost immediately. There will now be much more room before such a thing kicks in.
If we do want that to be fully, 100% disabled... using NaNs on line 183 can do the trick.
|
Possibly of note: from the filesize profiling system that's been established... The property names used to spec the gesture-model objects aren't exactly abbreviated like they are for keyboards, and there probably are parts I was a bit WET about. Gotta get the gestures correct first before optimizing their definitions, I suppose. But, should the growth in filesize be a concern, this aspect may be a valuable spot to look. There's also some definite overlap between the 'plain multitap' and 'modipress that can turn into multitap' definitions, for example. For comparison: |
common/web/gesture-recognizer/src/engine/configuration/viewportZoneSource.ts
Show resolved
Hide resolved
| // const hintLabel = this.hintLabel = document.createElement('div'); | ||
| // hintLabel.className='kmw-key-popup-icon'; | ||
| // hintLabel.textContent = keySpec == keySpec.hintSrc ? keySpec.hint : keySpec.hintSrc?.text; | ||
| // hintLabel.style.fontWeight= hintLabel.textContent == '\u2022' ? 'bold' : ''; | ||
|
|
||
| // // Default positioning puts it far too close to the flick-preview bit. | ||
| // let yAdjustment = 0; | ||
| // hintLabel.style.marginTop = `-${yAdjustment}px`; | ||
|
|
||
| // // b/c multitap's border forces position shifting | ||
| // let xAdjustment = 0; | ||
| // hintLabel.style.marginRight = `-${xAdjustment}px`; | ||
|
|
||
| // base.appendChild(hintLabel); |
There was a problem hiding this comment.
Right. I kept it around for possible use for multitap previews, should we have the time & space for that. Might have to triage it out and make an issue with reference to this block as a future 'feature request' instead, though.
…b/gesture-preview-host
…b/gesture-preview-host
…b/gesture-preview-host
Test Results
..Keyman Version ..Able to see the expected output on the screen |
In order to provide visual feedback for ongoing gestures, this PR adds a "gesture preview host" - an element that may be overlaid upon a base key (for tablets) or hosted within the keytip (for phones) in order to provide visual feedback about available & ongoing gestures.
The merged styling does have a mild side effect for tablet layouts. In my experience, the selected key's key-cap tends to move slightly up and left compared to its original position while highlighted. Personally... it actually feels kinda nice. I have looked somewhat into why it's happening and how to resolve it, but there's no obvious straightforward answer due to the differences in styling; it's not worth the effort at this stage of prototyping.
For both cases, during a flick, the preview area will scroll corresponding to the flick motion, bringing any 'destination' flick key-caps into view.
Known possible pain-point
If a flick is started during a modipress, but the modipress key is released before the flick is completed, the current settings will auto-terminate the flick. If we'd prefer, I can enable a 'sustain' mode for it that would allow the modipress-layer flick to complete instead, similar to what's already in place for longpress-key selection. This would not be subject to any sort of time-limit, though - that would likely take extra work.
User Testing
TEST_FLICKS_BASIC: Using the standard "Test unminified KeymanWeb" test page from a mobile device...
ukey.ùukey again and drag it in a northeast direction for at least a key-width before releasing it.ú(does not replace the previous output)uagain and drag north (straight up) in the same manner.û.TEST_FLICK_CORRECTION: Using the standard "Test unminified KeymanWeb" test page from a mobile device...
ukey.ùukey.ukey again.u.TEST_FLICK_ANIMATION: Using the standard "Test unminified KeymanWeb" test page from a mobile device...
ukey.ûkey in the preview area (assuming it's not blocked by your finger).ú, and eventuallyù, as you do so.ùis visible, lift your finger and end the gesture.ùis output.akey; you should see similar previews and text there. (à,â,á)TEST_FLICK_DURING_MODIPRESS: Using the standard "Test unminified KeymanWeb" test page from a mobile device...
Ukey.Ûkey in the preview area (assuming it's not blocked by your finger).Ú, and eventuallyÙ, as you do so.Ùis visible, lift your finger and end the flick gesture.Ùis output.Testing Resources
https://jahorton.github.io/#for-gesture-testing.
I have put up KMPs for the three gesture-testing keyboards I've developed for this feature branch at the link above. Be sure to check underneath the "For Gesture Testing" header.