feat(linux): implement diagnostic report
This change allows to collect data for a diagnostic report. This can be done either from the command line through the new `km-diag-report` tool, or in `km-config` from the new `Support` tab that allows to generate the report and then copy it to the clipboard or save as a file.
The diagnostic report contains installed browsers and their versions and installation methods as well as the default browser. It checks for browsers installed through apt (Ubuntu/Debian), snap, and flatpak.
The change also has an implementation for pacman (Arch Linux) and dnf/yum (Fedora), although these have not been tested.
Fixes: #7784
docs(core): add keyhandling doc
This documents the state of `km_core_actions.emit_keystroke` for different keys pressed. Also some cleanup in other docs.
This documents the state after merging #15609 (for ldml keyboards) and NN (for kmn keyboards).
Follows: #15609
While the debugger memo internally uses CRLF, in all references, CRLF
should be converted to CR for consistent text manipulation operations.
This follows a similar fix in the kmn debugger in #13334.
Also addresses review comments from @ermshiperete.
Fixes: #15601
Relates-to: #13334
Turned on strictNullChecks to verify the file and found a few other
problems in this file. However, there are many null check errors
reported across the kmc-package source which should be addressed in a
future patch. (This is a broader problem for the entire Typescript
source of Keyman.)
Fixes: #15627
Test-bot: skip
Build-bot: skip build:developer
This documents the state of `km_core_actions.emit_keystroke` for
different keys pressed. Also some cleanup in other docs.
This documents the state after merging #15609 (for ldml keyboards) and
NN (for kmn keyboards).
Follows: #15609
Build-bot: skip
Test-bot: skip
test(core): add LDML baseline test with minimal keyboard
This replaces and enables the commented `k_000_null_keyboard` test which didn't work because keys that are not on any layer don't produce output. This instead defines a minimal keyboard with just two keys and then tests typing a key that is on the keyboard followed by a key not on the keyboard.
refactor(core): simplify loop for removing text
Instead of using an iterator to loop over the context items, incrementing a counter on each iteration, and then finally removing the calculated number of context items from the list, this change loops through the list and looks at the last context item, removing it if necessary.
Follows: #15596
fix(core): fix iterator in backspace handling
This change replaces the reverse iterator loop that holds a stale iterator across `pop_back()` calls with a pattern that directly accesses `context.back()` on each iteration. This avoids undefined behavior from iterator invalidation when mutating the list or vector.
While so far the previous code didn't show problems, it might still access released memory depending on the implementation. The documentation for `pop_back()` says "References and iterators to the erased element are invalidated", so the previous implementation was clearly wrong.
This replaces and enables the commented `k_000_null_keyboard` test which
didn't work because keys that are not on any layer don't produce output.
This instead defines a minimal keyboard with just two keys and then tests
typing a key that is on the keyboard followed by a key not on the keyboard.
Test-bot: skip
Instead of using an iterator to loop over the context items, incrementing
a counter on each iteration, and then finally removing the calculated
number of context items from the list, this change loops through the list
and looks at the last context item, removing it if necessary.
Follows: #15596
Test-bot: skip
Production code uses a list of context items, so this change modifies
the tests to also use a list instead of a vector to more closely match
production code.
Addresses code review comment.
Test-bot: skip