Skip to content

Telemetry: enable dom events#1309

Merged
waltjones merged 3 commits into
masterfrom
waltjones/enable-dom-events
Sep 17, 2025
Merged

Telemetry: enable dom events#1309
waltjones merged 3 commits into
masterfrom
waltjones/enable-dom-events

Conversation

@waltjones

@waltjones waltjones commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

Description of the change

Enables telemetry events for DOM events

  • Input
  • Click
  • Focus
  • Resize

And updates the connectivity event.

Type of change

  • New feature (non-breaking change that adds functionality)

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

@waltjones waltjones marked this pull request as draft September 16, 2025 21:32
@waltjones waltjones marked this pull request as ready for review September 17, 2025 16:06

@matux matux left a comment

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.

This looks great!!! Complex made simple!

Some comments, but won't block on them.

Comment thread src/browser/telemetry.js
}[name].call(this, evt);
} catch (exc) {
// TODO: Not sure what to do here
console.log(`${name} handler error`, evt, exc, exc.stack);

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.

The cool thing about having a type-theoretic system, this state would become flat-out unrepresentable.

Comment thread src/browser/telemetry.js Outdated
kinds = [];
mediaTypes = [];
const objs = [...evt.dataTransfer.files, ...evt.dataTransfer.items];
//const objs = Array.from(evt.dataTransfer.files) || Array.from(evt.dataTransfer.items);

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.

leftover?

Comment thread src/browser/telemetry.js Outdated

handleFocus(evt) {
const type = evt.type;
const element = evt.target.window ? 'window' : domUtil.elementString(evt.target);

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.

Suggested change
const element = evt.target.window ? 'window' : domUtil.elementString(evt.target);
const element = evt.target?.window ? 'window' : domUtil.elementString(evt.target);

IFF there is a chance evt.target could be null.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't think so, but doesn't hurt to add it.

Comment thread src/browser/telemetry.js Outdated
handleForm(evt) {
// TODO: implement form event handling
const type = evt.type;
const elementString = evt.target.window ? 'window' : domUtil.elementString(evt.target);

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.

Suggested change
const elementString = evt.target.window ? 'window' : domUtil.elementString(evt.target);
const elementString = evt.target?.window ? 'window' : domUtil.elementString(evt.target);

Same as above.

@waltjones waltjones merged commit 907669e into master Sep 17, 2025
4 checks passed
@waltjones waltjones deleted the waltjones/enable-dom-events branch September 17, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants