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(web): adds gesture 'traces' for warning/error logging #13360

Open
wants to merge 1 commit into
base: chore/web/remove-dead-osk-code
Choose a base branch
from

Conversation

jahorton
Copy link
Contributor

@jahorton jahorton commented Feb 27, 2025

To facilitate debugging cases where gestures don't work as intended, this adds sanitized logging for keystrokes resulting for gestures. These are only to be output when a relevant error or warning is emitted. They're also pretty handy for obtaining an overview of a gesture's history during code inspection.

This is primarily being added to facilitate investigation of #13344. An example log that could result for this, though for a properly working state:

Context state 31's keystroke:
  touch:10 - initial-tap @ 21596.70 ms
Context state 27's keystroke:
  touch:9 - modipress-multitap-start @ 19390.00 ms
  touch:8 - modipress-multitap-end @ 19271.00 ms
  touch:8 - modipress-multitap-start @ 19271.00 ms
  <empty> - modipress-end-multitap-transition 
  touch:7 - modipress-start @ 19128.00 ms
Context state 23's keystroke:
  touch:7 - modipress-start @ 19128.00 ms
Context state 25's keystroke:
  touch:8 - modipress-multitap-start @ 19271.00 ms
  <empty> - modipress-end-multitap-transition 
  touch:7 - modipress-start @ 19128.00 ms
Context state 21's keystroke:
  touch:6 - subkey-select from 14934.90 ms - 16142.50 ms
  touch:6 - longpress from 14934.90 ms - 15197.50 ms
Context state 17's keystroke:
  touch:5 - subkey-select from 12169.20 ms - 12863.70 ms
  touch:5 - longpress from 12169.20 ms - 12670.10 ms
Context state 13's keystroke:
  touch:4 - initial-tap @ 11465.00 ms
Context state 11's keystroke:
  touch:3 - subkey-select from 8288.10 ms - 10396.00 ms
  touch:3 - longpress from 8288.10 ms - 8507.20 ms
Context state 7's keystroke:
  touch:2 - initial-tap from 7235.80 ms - 7255.50 ms
Context state 5's keystroke:
  touch:1 - initial-tap @ 6288.20 ms

This log is ordered from "newest" to "oldest" context, with the gesture components for each ordered similarly. Note that "state 23" appears before "state 25" - they're both part of the same multitap, and "state 27" reapplied "state 23" as part of its operation (undoing "state 25", which it invalidated).

@keymanapp-test-bot skip

To facilitate debugging cases where gestures don't work as intended, this adds sanitized logging for keystrokes resulting for gestures.  These are only to be output when a relevant error or warning is emitted.

This is primarily being added to facilitate investigation of #13344.
@keymanapp-test-bot keymanapp-test-bot bot added this to the B18S2 milestone Feb 27, 2025
return undefined;
}

const timestamps = this.sources.map((entry => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const timestamps = this.sources.map((entry => {
const timestamps = this.sources.map(entry => {

start: entry.path.stats.initialSample.t,
end: entry.path.stats.lastTimestamp
}
}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}));
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants