Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(developer): cleanup touch layout files on load and save 🙊 #6917

Conversation

mcdurdin
Copy link
Member

@mcdurdin mcdurdin commented Jul 9, 2022

Improves the .keyman-touch-layout clean schema and adds additional cleanup during load and save in the Touch Layout Editor.

The compiler already does transforms for the relevant fields to the formats that KeymanWeb is expecting (in particular, width, pad to string).

This is preparation for adding hint data to the format as well.

@keymanapp-test-bot skip (automated tests will cover this with compiler regression testing)

@mcdurdin mcdurdin added this to the A16S5 milestone Jul 9, 2022
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Jul 9, 2022
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Jul 9, 2022

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@mcdurdin mcdurdin modified the milestones: A16S5, A16S6 Jul 9, 2022
@mcdurdin mcdurdin changed the title feat(developer): cleanup touch layout files on load and save feat(developer): cleanup touch layout files on load and save 🙊 Jul 11, 2022
@mcdurdin mcdurdin changed the base branch from feat/developer/touch-layout-editor-flick-and-multitap to feat/developer/touch-layout-compiler-flick-and-multitap July 12, 2022 03:12
@mcdurdin mcdurdin marked this pull request as ready for review July 14, 2022 00:55
@mcdurdin mcdurdin force-pushed the feat/developer/touch-layout-schema-high-quality branch from 8182dad to 1cb0444 Compare July 14, 2022 00:56
Improves the .keyman-touch-layout clean schema and adds additional
cleanup during load and save in the Touch Layout Editor.

The compiler already does transforms for the relevant fields to the
formats that KeymanWeb is expecting (in particular, width, pad to
string).

This is preparation for adding hint data to the format as well.
@mcdurdin mcdurdin force-pushed the feat/developer/touch-layout-compiler-flick-and-multitap branch from 5bf1235 to 60dabb5 Compare July 14, 2022 00:57
@mcdurdin mcdurdin force-pushed the feat/developer/touch-layout-schema-high-quality branch from 1cb0444 to 51a94a1 Compare July 14, 2022 00:58
Comment on lines +96 to +102
"anyOf": [
{"required": ["id"]},
{"required": ["sp"]},
{"required": ["sk"]},
{"required": ["flick"]},
{"required": ["multitap"]}
],
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there cases where we may wish to support an id-less key that has subkeys, flicks, or multitaps?

Granted, I'm not super-great with schemas, but my impression of this part of the spec appears to permit such a case.

I know we permit id-less keys with sp properties - such as for a 'blank' space for row padding, so no complaints on that one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Your reading is correct.

I guess it seems unlikely but not impossible? A 'special characters' key which has no default behaviour but does have flicks or longpress -- where the keyboard author doesn't want it to be triggered by accident? Like I say, unlikely but probably no really good reason to restrict the schema.

return true;
};

let cleanupNumericField = function(obj, prop) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see a case where this can return false - only true. Granted, it is part of a boolean-logic condition chain in a different function, but it still strikes me a bit odd.

Copy link
Member Author

Choose a reason for hiding this comment

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

Given none of the cleanup* functions are returning false I could make them conceptually void functions. BUt not sure if it makes any difference? 😄

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-missing User tests have not yet been defined for the PR label Jul 22, 2022
@mcdurdin mcdurdin modified the milestones: A16S6, A16S7 Jul 24, 2022
Copy link
Contributor

@jahorton jahorton left a comment

Choose a reason for hiding this comment

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

Still feels a bit dirty to me as it is (see previous comments), but I suppose the complaints are a bit nitpicky. I can go with "good enough."

@mcdurdin mcdurdin merged commit ca47fce into feat/developer/touch-layout-compiler-flick-and-multitap Jul 25, 2022
@mcdurdin mcdurdin deleted the feat/developer/touch-layout-schema-high-quality branch July 25, 2022 09:57
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.

2 participants