Skip to content

fix(developer): handle errors in .keyman-touch-layout file when loading#15243

Merged
mcdurdin merged 1 commit intomasterfrom
fix/developer/15242-handle-errors-in-touch-layout-on-load
Dec 1, 2025
Merged

fix(developer): handle errors in .keyman-touch-layout file when loading#15243
mcdurdin merged 1 commit intomasterfrom
fix/developer/15242-handle-errors-in-touch-layout-on-load

Conversation

@mcdurdin
Copy link
Copy Markdown
Member

If the .keyman-touch-layout file has validation errors, Keyman Developer will now report the first validation error in the message window, rather than silently closing the whole keyboard editor. The .keyman-touch-layout file will be loaded in Code view, and once the first validation error is addressed, switching to Design view will report the next error.

For future improvement:

  • reporting multiple validation errors
  • reporting line number of error

Fixes: #15242
Test-bot: skip

If the .keyman-touch-layout file has validation errors, Keyman Developer
will now report the first validation error in the message window, rather
than silently closing the whole keyboard editor. The
.keyman-touch-layout file will be loaded in Code view, and once the
first validation error is addressed, switching to Design view will
report the next error.

For future improvement:
* reporting multiple validation errors
* reporting line number of error

Fixes: #15242
Test-bot: skip
@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Nov 27, 2025

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

  • Developer
    • Keyman Developer - build : all tests passed (no artifacts on BuildLevel "build")
    • Compiler Regression Tests - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman Developer (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
  • Keyboards
    • Test Keyboards - build : all tests passed (no artifacts on BuildLevel "build")


FTouchLayout := TTouchLayout.Create; // I3642
try
FTouchLayout.OnMessage := TouchLayoutMessage;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where does the Message string get passed in?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The message is written by TTouchLayout.DoMessage and TTouchLayout.DoError when an error is encountered, for example:

begin
DoError('Invalid JSON at offset '+IntToStr(Offset), Offset); // I4035 // I4083

Copy link
Copy Markdown
Contributor

@darcywong00 darcywong00 left a comment

Choose a reason for hiding this comment

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

lgtm

@mcdurdin mcdurdin merged commit cbccf25 into master Dec 1, 2025
10 checks passed
@mcdurdin mcdurdin deleted the fix/developer/15242-handle-errors-in-touch-layout-on-load branch December 1, 2025 13:21
@github-project-automation github-project-automation bot moved this from Todo to Done in Keyman Dec 1, 2025
@keyman-server
Copy link
Copy Markdown
Collaborator

Changes in this pull request will be available for download in Keyman version 19.0.168-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

bug(developer): attempting to open alkelang.kmn in Keyman Developer fails

3 participants