Commit graph

2983 commits

Author SHA1 Message Date
Marc Durdin
3f585b06d9
Merge pull request #11808 from keymanapp/fix/developer/cherry-pick/11793-use-HISTORY-MD-for-last-commit-date
fix(developer): check HISTORY.md to get last modified date for keyboard_info and model_info 🍒 🏠
2024-06-19 11:30:28 +10:00
Marc Durdin
be65910743 chore(developer): clarify project upgrade messages about file locations
Cherry-pick-of: #11819
2024-06-19 06:26:19 +10:00
Marc Durdin
ebd2a9131f chore(developer): add msec in comment 2024-06-18 07:38:23 +10:00
Marc Durdin
e56472d9b2 fix(developer): check HISTORY.md to get last modified date for keyboard_info and model_info
This updates the calculation of the lastModifiedDate property of the
.keyboard_info and .model_info file. It now looks for the most recent
commit to HISTORY.md, and then falls back to the project folder for
.keyboard_info and .model_info.

getLastGitCommitDate now also returns UTC date (it was giving TZ=0
which is affected by daylight saving), and works for a file rather than
just for a folder, and a corresponding unit test has been added.

The date strings returned will now always include '.000' msec suffix. I
have manually verified that the import into the api.keyman.com database
copes with this, and that this change still conforms to the expected
schema for .keyboard_info and .model_info files.

Last, but important, it turned out that the unit tests for kmc were not
running. This has been resolved in kmc/build.sh.

Fixes: #11793
Cherry-pick-of: #11805
2024-06-18 07:38:04 +10:00
Marc Durdin
fbd90a1a7c test(developer): add fixture for getLastGitCommitDate unit test 2024-06-18 07:37:24 +10:00
Marc Durdin
a0628177ee
Merge pull request #11766 from keymanapp/fix/developer/cherry-pick/11646-add-platform-no-more-platforms-builder
fix(developer): show message if no more platforms to add to touch layout editor 🍒 🏠
2024-06-15 07:08:24 +10:00
Marc Durdin
a76313d725 fix(developer): show message if no more platforms to add to touch layout editor
Fixes: #11646
Fixes: KEYMAN-DEVELOPER-1X2
2024-06-13 10:01:32 +10:00
Marc Durdin
b99fc3415f feat(developer): support language reference in context help
Adds support for `<LanguageReference Name='keyword'>` in contexthelp.xml.

Cherry-pick-of: #11737
2024-06-08 07:49:00 +07:00
Marc Durdin
f13feaf620
Merge pull request #11727 from keymanapp/fix/developer/cherry-pick/11715-prevent-two-touch-layout-editors-opening-for-same-file
fix(developer): prevent two touch layout editors opening for the same file 🍒 🏠
2024-06-08 10:44:49 +10:00
Marc Durdin
af6b052f14
Merge pull request #11721 from keymanapp/fix/developer/cherry-pick/11719-handle-missing-osk-when-importing-windows-keyboard
fix(developer): handle missing OSK when importing a Windows keyboard into a touch-only project 🍒 🏠
2024-06-08 10:44:40 +10:00
Marc Durdin
80274ce537
Merge pull request #11712 from keymanapp/fix/developer/cherry-pick/11710-handle-encoding-errors-when-loading-wordlists
fix(developer): handle encoding errors when loading wordlists 🍒 🏠
2024-06-07 16:40:27 +10:00
Marc Durdin
1112830d75
Merge pull request #11709 from keymanapp/chore/developer/cherry-pick/11706-add-extra-logging-for-backspace-assertion
chore(developer): add extra logging for assertion failure when pressing backspace in debugger 🍒 🏠
2024-06-07 16:40:14 +10:00
Marc Durdin
1f1e5fba99 fix(developer): prevent two touch layout editors opening for the same file
The keyboard editor has a complex edit state machine, which has
grown a lot over time. This is a minimal patch to address one specific
edge case scenario on that state machine, without any attempt to improve
the state machine overall. The biggest change here is bubbling failure
up to the main form so that it can destroy (aka Release, which is an
asynchronous destroy) the editor window if it fails to load completely.

Fixes: #11715
Fixes: KEYMAN-DEVELOPER-1JC
2024-06-07 09:46:30 +07:00
Marc Durdin
b1374c9818 fix(developer): handle missing OSK when importing a Windows keyboard into a touch-only project
Fixes: KEYMAN-DEVELOPER-1NN
Fixes: #11719
2024-06-06 12:50:54 +07:00
Marc Durdin
b8ea8056f8 refactor(developer): rename TouchLayoutToVisualKeyboardConverter to VisualKeyboardToTouchLayoutConverter
No change in functionality. But class and unit name now match what they
actually do.
2024-06-06 12:50:53 +07:00
Marc Durdin
d1787a0645
Merge pull request #11703 from keymanapp/fix/developer/cherry-pick/11700-disable-example-edit-controls-if-no-examples
fix(developer): disable example edit controls if no examples in Package Editor 🍒 🏠
2024-06-06 12:05:12 +07:00
Marc Durdin
c01ac431db
Merge pull request #11699 from keymanapp/fix/developer/cherry-pick/11687-ignore-javascript-files-with-bad-encodings
fix(developer): treat js files with unrecognized encodings as non-keyboard files 🍒 🏠
2024-06-06 12:04:56 +07:00
Marc Durdin
5046e051e5
Merge pull request #11588 from keymanapp/fix/developer/cherry-pick/11586-handle-editor-init-after-debugger
fix(developer): handle editor initializing after debugger when setting execution point 🍒 🏠
2024-06-06 12:04:30 +07:00
Marc Durdin
8044d71d22 fix(developer): handle encoding errors when loading wordlists 🍒
Fixes: #11710
Fixes: KEYMAN-DEVELOPER-1S4
Cherry-pick-of: #11711
2024-06-06 09:23:27 +07:00
Marc Durdin
7ebccb9e62 chore(developer): add extra logging for assertion failure when pressing backspace in debugger
I have not been able to reproduce this problem, so adding some extra
debug logs in an attempt to determine what is causing the assertion
failure.

Relates to: #11706

Cherry-pick-of: #11707
2024-06-06 08:59:40 +07:00
Marc Durdin
bb2d6a360e fix(developer): disable example edit controls if no examples in Package Editor
Fixes: #11700
Fixes: KEYMAN-DEVELOPER-1FT
2024-06-06 08:15:24 +07:00
Marc Durdin
9f4f8fcda9 fix(developer): treat js files with unrecognized encodings as non-keyboard files
Fixes: KEYMAN-DEVELOPER-201
Fixes: #11687
2024-06-06 06:53:00 +07:00
Marc Durdin
1603562e72 fix(developer): support Windows and Unicode names in .ttf
The ttfmeta library is extremely rudimentary. It does next to no error
checking, and supports only a small part of the TTF spec. It did not
support NAME platforms 0 or 3 (the most common platform, Windows), and
these are encoded in UTF-16BE. This patch adds support for those
platforms and throws if an unsupported platform/encoding is encountered.

Now, the ttfmeta library is unsupported and gone (#11630). It is based
on another library, ttfinfo, last updated 11 years ago. This is not
great. But the other Node libraries that I located introduce further
dependencies or complex builds (e.g. WASM) and that's not great either,
for a function used only in one place in our build environment.

https://learn.microsoft.com/en-us/typography/opentype/spec/name

The test-font-family.ts runs a basic test against Lateef font, and has
a skipped test that can be run (with minor edits) against all fonts in
the keyboard repository. I have done this to verify that there are no
fonts that return errors, but have disabled this test for deployment for
now.

Fixes: #11625
2024-05-31 15:39:50 +07:00
Marc Durdin
3b1a641d1b fix(developer): bundle ttfmeta library internally with kmc-keyboard-info
Remove ttfmeta from package.json, and copy only the relevant files into
ttfmeta/ under kmc-keyboard-info. This is a stopgap measure as we will
probably attempt to identify an alternate library in the future.

See also #11625 which is the driver for making this change now.

Fixes: #11630
2024-05-31 15:39:48 +07:00
Marc Durdin
9c29e4f6e1
Merge pull request #11583 from keymanapp/fix/developer/cherry-pick/11581-flicks-for-default-key-hints
fix(developer): correct the inference of default hint from flicks 🍒 🏠
2024-05-31 13:07:16 +07:00
Marc Durdin
9a554ffa20
Merge pull request #11578 from keymanapp/fix/developer/cherry-pick/11574-fixup-flick-multitap-in-layer-props
fix(developer): use correct variable when fixing up flick and multitap in Layer Properties dialog 🍒 🏠
2024-05-31 13:07:00 +07:00
Marc Durdin
8b69ac256f
Merge pull request #11576 from keymanapp/fix/developer/cherry-pick/11573-save-selection-when-loading-state
fix(developer): save touch layout editor selection when loading state 🍒 🏠
2024-05-31 13:06:48 +07:00
Marc Durdin
fd117edab5
Merge pull request #11564 from keymanapp/fix/developer/cherry-pick/11562-handle-missing-data-in-kps-keyboard
fix(developer): handle missing data in .kps `<Keyboard>` 🍒 🏠
2024-05-31 13:06:41 +07:00
Marc Durdin
694837cd2d
Merge pull request #11556 from keymanapp/fix/developer/cherry-pick/11554-handle-invalid-default-project-path
fix(developer): handle invalid default project path in options 🍒 🏠
2024-05-31 13:06:25 +07:00
Marc Durdin
b79943e86a
Merge pull request #11559 from keymanapp/fix/developer/cherry-pick/11557-invalid-project-file-at-launch
fix(developer): handle invalid project file when scanning for owner project 🍒 🏠
2024-05-30 09:29:27 +07:00
Marc Durdin
ffa6f8a411
Merge pull request #11553 from keymanapp/fix/developer/cherry-pick/11551-create-folder-for-mrulist
fix(developer): ensure folder for MRU list is always created 🍒 🏠
2024-05-30 09:29:06 +07:00
Marc Durdin
634bd9b315
Merge pull request #11547 from keymanapp/fix/developer/cherry-pick/11545-nomatch-return-causes-exception
fix(developer): handle unsupported `return` statement in `match` and `nomatch` in web compiler 🍒 🏠
2024-05-30 09:28:55 +07:00
Marc Durdin
cc8d95af1d fix(developer): handle editor initializing after debugger when setting execution point
Fixes: #11586
Fixes: KEYMAN-DEVELOPER-1K7
Cherry-pick-of: #11587
2024-05-28 13:55:15 +07:00
Marc Durdin
b78a5072b9 fix(developer): correct the inference of default hint from flicks 🍒
There were two problems here:
* An undeclared variable `source`
* The `flick` parameter is an array, not an object, so indexing by
  direction is invalid

Fixes: #11581
Fixes: KEYMAN-DEVELOPER-1YW
Cherry-pick-of: #11582
2024-05-28 09:53:26 +07:00
Marc Durdin
a9dccb20c2 fix(developer): use correct variable when fixing up flick and multitap in Layer Properties dialog
Fixes: #11574
Fixes: KEYMAN-DEVELOPER-1GC
2024-05-28 06:56:19 +07:00
Marc Durdin
3d8ae26237 fix(developer): save touch layout editor selection when loading state
Key selection was left in a corrupted state in `builder.loadState()`, on
first load of the touch layout editor, because the selection was not
restored after calling `prepareLayer()`.

This only happens on first load because after first load, the selection
will have been saved to the state (which is kept in the backend,
associated with the instance of the editor), so pressing F5 to reload
the page will not reproduce the issue.

Fixes: #11573
Fixes: KEYMAN-DEVELOPER-1Z8
2024-05-28 06:51:37 +07:00
Marc Durdin
d6ac1b4d0d fix(developer): handle missing data in .kps <Keyboard>
Handles when `<Version/>`, `<Name/>`, or `<ID/>` elements are missing
from `<Keyboard>` elements in the .kps file in kmc-package. Adds a unit
test.

Fixes: #11562
Fixes: KEYMAN-DEVELOPER-1YY
2024-05-27 15:05:47 +07:00
Marc Durdin
e46a2b2331 fix(developer): handle invalid project file when scanning for owner project
Also updates the only other place where a project file is loaded like
this, in the project renderer, and handles it too (this scenario is
less likely to happen because the project file must already have been
loaded in order to be presented in the UI).

Fixes: #11557
Fixes: KEYMAN-DEVELOPER-1Z2
2024-05-27 12:48:38 +07:00
Marc Durdin
e02322d75f fix(developer): handle invalid default project path in options
If a relative or otherwise invalid path is given for `default project
path` in .keymandeveloper/options.json, then this will reset the path
to the default of `%Documents%/Keyman Developer/Projects`.

Fixes: #11554
Fixes: KEYMAN-DEVELOPER-1ZB
2024-05-27 12:17:21 +07:00
Marc Durdin
9ff69e4227 fix(developer): ensure folder for MRU list is always created
This arises if `%AppData%/Keyman/Keyman Developer` folder is missing.
It is sporadic because most times, Keyman Developer Server wins a
startup race and creates the folder before this code is ever reached.

Fixes: #11551
Fixes: KEYMAN-DEVELOPER-1MY
2024-05-27 10:53:16 +07:00
Marc Durdin
7054275fc3 fix(developer): handle unsupported return statement in match and nomatch in web compiler
The `return` statement is unsupported in the web compiler. This is
documented, but the problem here was that the `nomatch` and `match`
metarules have no corresponding `fkp` structure, so that caused a fatal
error in the compiler if these were used in combination, e.g.

    nomatch > return

Fixes: #11545
2024-05-27 09:41:29 +07:00
Marc Durdin
c23cf49b7e fix(developer): test existence of ngrok.exe before atttempting to start
Fixes the scenario where the `%AppData%\Keyman\Keyman Developer\Server\bin`
folder exists, but ngrok.exe is not in the folder, which caused Keyman
Developer Server to crash.

Fixes: #11542
Fixes: KEYMAN-DEVELOPER-1JE
2024-05-27 08:24:29 +07:00
Marc Durdin
19693199a9 fix(developer): handle KM_CORE_IT_INVALIDATE_CONTEXT in debugger
The output from Keyman Core changed in #11172 to emit a
`KM_CORE_IT_INVALIDATE_CONTEXT` action when a frame key is pressed, but
the debugger was not catering for this scenario, causing an assertion
failure.

Fixes: #11486
Fixes: KEYMAN-DEVELOPER-1Y4
2024-05-21 09:06:20 +07:00
Marc Durdin
8474372baa fix(developer): define lastSelLength variable
Fixes #11361.
2024-05-06 10:25:04 +07:00
Marc Durdin
4fc94a9e70 fix(developer): handle missing Description element for File element in package compiler
Fixes #11353.
2024-05-03 14:31:10 +07:00
Marc Durdin
78902e3891 fix(developer): handle missing Name element for File element in package compiler
Fixes #11351.
2024-05-03 14:25:35 +07:00
Marc Durdin
d019707a65
Merge pull request #11244 from keymanapp/fix/developer/11199-export-osk-without-keyman-installed
fix(developer): support export of visual keyboard when Keyman for Windows not installed
2024-04-26 17:08:58 +10:00
Dr Mark C. Sinclair
9cb29b06da chore(developer): Merge branch 'beta' into test/developer/keyboard-info-compiler-messages-unit-tests-2 2024-04-23 12:24:54 +01:00
Dr Mark C. Sinclair
e742926dba chore(developer): some further elimination of code redundancy 2024-04-23 11:58:04 +01:00
Marc Durdin
5658a177a2
Merge pull request #11276 from keymanapp/fix/developer/11274-use-strict-for-downlevel-browsers
fix(developer): "use strict" for downlevel browsers in Server
2024-04-23 18:55:33 +10:00