Skip to content

change(web): floating tablet key-previews 🐵#10102

Merged
jahorton merged 6 commits intofeature-gesturesfrom
change/web/floating-tablet-preview
Dec 8, 2023
Merged

change(web): floating tablet key-previews 🐵#10102
jahorton merged 6 commits intofeature-gesturesfrom
change/web/floating-tablet-preview

Conversation

@jahorton
Copy link
Copy Markdown
Contributor

In order to facilitate good, well-behaved key-previews for multitaps, it's necessary to change the tablet preview pattern to use an element that floats over the keyboard, similar to the phone-oriented key tip. This PR implements the changes needed for this, while a followup will use them to facilitate multitap previews.

This also may fix the last dregs regarding #9187, as I discovered that keyboards which do not include files for widely-distributed fonts (such as Arial) were not having that font-spec respected by key previews - neither for the phone-style or this new tablet style.

As it's best to get the full body of work all at once...
@keymanapp-test-bot skip

@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Nov 30, 2023

User Test Results

Test specification and instructions

User tests are not required

@keymanapp-test-bot keymanapp-test-bot bot changed the title change(web): floating tablet key-previews change(web): floating tablet key-previews 🐵 Nov 30, 2023
@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S27 milestone Nov 30, 2023
@github-actions github-actions bot added the web/ label Nov 30, 2023
const DEFAULT_TIP_ORIENTATION = 'top';
const DEFAULT_TIP_ORIENTATION: PhoneKeyTipOrientation = 'top';

export type PhoneKeyTipOrientation = 'top' | 'bottom';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be above line 8, even though it seems to build okay, just for clarity.

Copy link
Copy Markdown
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only nits, LGTM

Comment on lines +156 to +158
public clearHint() {
this.hintLabel.classList.add('hint-clear');
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does clearHint() / hint-clear do? It sounds like it is removing the hint but doing so by adding a class feels a bit strange. How is hint-clear removed again?

Also, it should be kmw-hint-clear for consistency and namespace protection

Copy link
Copy Markdown
Contributor Author

@jahorton jahorton Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a key-preview state (somehow) supports both flicks and multitaps, clearHint will hide the multitap hint once a flick starts, as the start of a flick locks out the ability to multitap. Granted, I don't think such a state may occur due to the order of events.

As a new GesturePreview instance is built for future gestures... hint-clear isn't ever removed. There's no gesture life-cycle where undoing it makes sense... assuming that the preview instance is replaced when starting gestures.

So... replacing the instance is the "removal", so to speak?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ... then doesn't it make more sense to destroy it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right. For posterity, since it didn't seem to get stated otherwise - this allows fading the hints via CSS transition. That'd be the reason not to outright destroy it.

@mcdurdin mcdurdin modified the milestones: A17S27, A17S28 Dec 8, 2023
@jahorton jahorton merged commit ddb7988 into feature-gestures Dec 8, 2023
@jahorton jahorton deleted the change/web/floating-tablet-preview branch December 8, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants