Commit graph

2534 commits

Author SHA1 Message Date
Marc Durdin
10d9ed40dc chore(core): use c-compatible type for KMX_UCHAR 2022-08-11 17:51:30 +02:00
Marc Durdin
e30871f01e chore(linux): add common/include to further paths 2022-08-11 14:56:46 +02:00
Marc Durdin
dedb06e7cc chore(common): refactor shared types into km_types.h 2022-08-11 11:36:09 +02:00
Marc Durdin
422e7227a6 chore(core): move kmx_file.h to common 2022-08-11 11:34:09 +02:00
Marc Durdin
0a22acd0e4
Merge pull request #7018 from keymanapp/chore/common/builder-tweaks
chore(common): build-utils.sh minor tweaks
2022-08-03 20:19:42 +10:00
Joshua A. Horton
bac2578039 chore(web): addresses PR review comment 2022-08-02 08:10:01 +07:00
Joshua A. Horton
a8fbdcc6dd chore(web): removes accidentally-added file from feature branch 2022-08-01 14:36:02 +07:00
Joshua A. Horton
205312c451 chore(web): timeout-adapter implementation 2022-08-01 13:06:15 +07:00
Joshua A. Horton
b42a87ee5b chore(web): updates target devices for BrowserStack-based CI tests 2022-08-01 12:37:19 +07:00
Joshua A. Horton
5a7840753f chore(web): centralizes test-start timeout config logic 2022-08-01 11:39:14 +07:00
Joshua A. Horton
405a553c06 chore(web): requireable module for common CI test-config 2022-08-01 10:54:57 +07:00
Marc Durdin
683d8b9e68 chore(common): build-utils.sh minor tweaks
Fixing up a number of minor bits and pieces identified during demo:

* invalid action or :target would not be picked up if paired with a
  valid one (e.g.: build:foo should not have worked)
* colors defined in both shellHelperFunctions and build-utils were
  problematic; able to remove them from shellHelperFunctions because
  all references included both scripts
* builder_has_action and builder_report now allow both `action:target`
  and `action :target`
* keyman-version/build.sh did not have working test action...
2022-07-29 17:37:19 +10:00
Marc Durdin
c1118d908c
Merge branch 'master' into chore/common/builder-script-target-and-option-support 2022-07-29 10:37:18 +10:00
Marc Durdin
8fd3442fe2 chore(common): remove builder_init
builder_init was unnecessarily and inconsistently duplicating
builder_describe and builder_parse functionality. Removing it -- all
scripts should use builder_describe and builder_parse instead, which
gives us more flexibility and consistency into the future.
2022-07-27 15:07:12 +10:00
Marc Durdin
5895d26e64
Merge pull request #6884 from keymanapp/feat/developer/touch-layout-editor-flick-and-multitap
feat(developer): Rework Touch Layout Editor to support flick and multitap 🙊
2022-07-26 07:14:02 +10:00
Marc Durdin
ab54c0ecb9 chore(common): more bin bashes 2022-07-25 16:03:22 +10:00
Marc Durdin
767927bf16 chore(common): use /usr/bin/env bash
Fixes up scripts (except under /linux) to use `#!/usr/bin/env bash`
instead of `#!/bin/bash` or `#!/bin/sh` so that we don't end up with
the ancient version of bash supplied with macOS.

This became urgent with this PR, because of bash-4.xisms in
build-utils.sh, for example on line 572:

```
if [[ -v _builder_params[$e] ]]; then
```
2022-07-25 14:59:37 +10:00
Marc Durdin
93a03acb9f chore(common): builder script :target and --option support
Adds support for :target and --option to the builder_() functions in
build-utils.sh, along with a consistent way of describing command line
parameters in short-hand form, so we can avoid the display_usage getting
out of sync with actual command line parameters.

I opted to tweak the existing usage slightly, reversing parameter order
for `builder_report`, so that we could extend `builder_report` cleanly
to support targets.

The new builder_() functions are `builder_describe` and `builder_parse`,
which should be used in place for `builder_init` where you want to
provide more detailed command-line options (for many scripts, the
defaults provided through `builder_init` may suffice).

`builder_describe` lets you set a single-line description of the script,
along with a list of parameters: `actions`, `:targets` and `--options`.
Options may also specify a shorthand form, e.g. `--option,-o`. Each
parameter may optionally include a short description, separated by
space(s) from the parameter name.

build-utils.test.sh tests the functionality of the various functions,
and provides some examples of using them.

Defaults:
* If a target is not specified in `builder_describe`, a standard target
  of `:project` will be available.
* If the user does not pass an action on the command line, then `build`
  will be used.
* If the user does not pass a target on the command line, all targets
  will have the actions applied.

Note, it is possible to have targets which do not use all actions. These
may be still be specified, but can be ignored. For example, `test:tools`
may not be an action:target that you handle in the script. At this time,
the builder_() functions do not attempt to check for this.
2022-07-25 14:31:58 +10:00
Joshua Horton
71068abe9d
Merge pull request #6950 from keymanapp/chore/web/remove-invalid-warning
chore(web): remove invalid warning msg
2022-07-15 13:07:25 +07:00
Joshua Horton
b8fd5eea31
Merge pull request #6902 from keymanapp/fix/web/block-set-layer-on-desktop
fix(web): layer-setting ops should not trigger for hardware keystroke processing 🖇️
2022-07-15 11:07:19 +07:00
Joshua Horton
ed8c15fe6e
Merge pull request #6901 from keymanapp/fix/web/context-only-device
fix(web): postkeystroke processing should ignore key-event source🖇️
2022-07-15 11:06:39 +07:00
Joshua A. Horton
56b37fb87f chore(web): remove invalid warning msg 2022-07-15 08:53:08 +07:00
Marc Durdin
c8971a457c
chore: Apply suggestions from code review 2022-07-15 08:58:12 +10:00
Marc Durdin
6032181e18 feat(developer): rework displayHint to defaultHint
After a demo of the Touch Layout Editor @jahorton suggested using a
"default hint" model instead of the "display hint" from the design spec.
I liked this and have reworked the design accordingly. With the default
hint model, a source for the hint text can be specified, such as the
default longpress key, or a specific flick key. This can then be
overridden on a key level.

The hint input element now shows a placeholder to indicate the default
hint for the key, and if a hint has been customised for a given key, it
is shown in green on the key cap.

Changing the default hint does not impact any customised hints.
2022-07-14 10:58:59 +10:00
Marc Durdin
11d8a3ad65 feat(developer): add hint properties to touch layout schema 2022-07-14 10:58:54 +10:00
Marc Durdin
51a94a1d7d feat(developer): cleanup touch layout files on load and save
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.
2022-07-14 10:57:39 +10:00
Marc Durdin
d4c3dd89a3
Merge pull request #6918 from keymanapp/feat/developer/build-kmcomp-distributable-in-release
feat(developer): compiler regression support (build kmcomp-$version.zip during release build) 🚦
2022-07-14 10:52:45 +10:00
Joshua A. Horton
7342f7f9e6 fix(web): applies PR suggestions 2022-07-12 11:01:14 +07:00
Marc Durdin
1909d92b47 chore(common): keymansentry UNICODE for Winapi 2022-07-11 11:19:53 +10:00
Joshua Horton
be7c9c58a9
Merge pull request #6808 from keymanapp/fix/web/6792-chiral-modifier-mapping
fix(web): maps touch-layout chiral alt, ctrl to non-chiral when non-chiral keyboard is active
2022-07-11 08:12:46 +07:00
Marc Durdin
b700432583 fix(developer): kmdecomp stability tweaks
Adds kmdecomp to kmcomp-<version>.zip and fixes a couple of stability
issues:

* Increase buffer sizes (this fix very much a hack)
* Ensures that .bmp/.ico files are saved to correct output folder
* Disable loading sentry.dll when running on WINE
2022-07-11 10:42:33 +10:00
Marc Durdin
ace0cbd1d6 fix(web): ncaps rules not matching on touch
Fixes #6910.

Regression introduced in #6874 / #6849 (which themselves were improving
the Caps Lock situation).

Ensures that either `NO_CAPS` or `CAPS` is always set in the modifier
flags.
2022-07-08 16:09:28 +10:00
jahorton
648acc9273 chore(web): extra check for robustness 2022-07-08 10:14:35 +07:00
Marc Durdin
27eb1b9f19 fix(developer): add no-ops for symbol builds for components
Fixes the release build where we do `nmake symbols` for developer/src,
which was failing on calls to these two sets of components. (In
windows/src, the build structure is different due to an additional layer
of folders, so we end up with no `nmake symbols` call on the common
components).
2022-07-08 05:04:10 +10:00
Joshua Horton
620cbb54ab
chore(web): applies code suggestion
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-07-07 08:39:28 +07:00
Marc Durdin
8ba11f608d
Merge pull request #6890 from keymanapp/fix/web/improve-console-error-reporting
fix(web): improve `console.error()` reporting
2022-07-07 09:40:06 +10:00
Joshua A. Horton
a1a43f80c1 fix(web): doModifierPress layer handling 2022-07-06 13:20:14 +07:00
Joshua A. Horton
a4b32705d8 fix(web): reverts prior commit, adds related docs 2022-07-06 12:56:09 +07:00
Joshua Horton
b9a47bfaf7
chore(web): Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-07-06 12:54:06 +07:00
Joshua A. Horton
4489337cd6 change(web): disables touch OSK auto-shift on hardware shift 2022-07-06 12:25:08 +07:00
Marc Durdin
6c39bb8b0b
Merge pull request #6877 from keymanapp/feat/developer/touch-layout-flick-and-multitap
feat(developer): add flick and multitap to touch layout schema and doc 🙊
2022-07-06 15:18:32 +10:00
Marc Durdin
a4a1e269d1
Merge pull request #6856 from keymanapp/feat/developer/keyman-touch-layout-schema
feat(developer): .keyman-touch-layout schema for 15.0 🙊
2022-07-06 15:18:23 +10:00
Marc Durdin
ace3e2c6b0
chore: Apply suggestions from code review
Co-authored-by: Joshua Horton <joshua_horton@sil.org>
2022-07-06 15:15:09 +10:00
Joshua A. Horton
4c0ab7ab1a fix(web): set(layer) should not trigger for hardware keystrokes 2022-07-06 12:11:30 +07:00
Joshua A. Horton
a9d52e42d2 chore(web): unit test fix 2022-07-06 11:55:19 +07:00
Joshua A. Horton
90b7b4ce5f chore(web): reduce layer-change noise 2022-07-06 11:38:20 +07:00
Joshua A. Horton
aba150ddba fix(web): postkeystroke should use the 'context' device, not event device 2022-07-06 11:38:14 +07:00
Marc Durdin
10caf08919 fix(web): only report console errors if _enabled 2022-07-05 13:14:20 +10:00
Marc Durdin
0b64871be3 fix(web): improve console.error() reporting
The back story:

Currently Keyman for Android reports errors sent to the console via
`console.error()` into Sentry but sentry-manager itself does not. This
means that Keyman for iPhone and iPad and other users of sentry-manager
do not report these errors. Many of these errors are important.

What's worse is that Keyman for Android's error reporting here (via the
`sendKMWError()` function in Keyman Engine for Android) does not capture
stack traces, and so many of the errors we get do not have enough
information to resolve them.

Furthermore, by having `sendKMWError()` in Keyman for Android, we
capture exceptions and other program errors twice -- once on the web
side, and once on the Java side -- this adds noise to our error
reporting. Sentry also tends to lump many unrelated `sendKMWError()`
events together, so tracking resolution to the errors is painful.

The fix:

This adds a patch to sentry-manager to capture `console.error()` and
`console.warning()` events and report them through Sentry's normal error
reporting, and disables the `sendKMWError()` report (although we leave
the breadcrumb in place for when there are later, related Java errors).
There is a Sentry integration called CaptureConsole, but it does not
support capturing stack traces until v6.14
(https://github.com/getsentry/sentry-javascript/pull/4034). Updating
Sentry to 6.14 or newer is a bigger job (due to ES6 baseline req. etc.)

Note that Keyman for iOS currently has some other stubs in place
overriding the `console.*` functions. These should be removed for
release builds, so that we can use this pattern instead. I will try and
tackle this in a follow-up PR (I will build it on my mac so I can test
it).

A sample error report captured with this mechanism (no sourcemaps here
because this is a -local build):

https://sentry.io/organizations/keyman/issues/3401287467/events/c40fd2cebb7743cc8dfe72e0dd34bf65/?project=5983524

I am proposing we back-port this to 15.0-stable as we are missing a lot
of data in many of our error reports on Android.
2022-07-05 10:57:42 +10:00
Marc Durdin
b2427386f1 feat(developer): tighter spec for .keyman-touch-layout 2022-06-30 14:37:43 +10:00