chore(editor): add telemetry for note, embed doc and linked doc (#12234)

Close [BS-3480](https://linear.app/affine-design/issue/BS-3480/event-tracking)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Added telemetry tracking to toolbar actions for embedding documents, duplicating notes, and toggling note display modes.
  - Telemetry events now track when new note blocks are created from drag-and-drop actions on the whiteboard.

- **Chores**
  - Improved event tracking for user interactions to enhance analytics and usage insights.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
L-Sun
2025-05-12 09:59:05 +00:00
parent 42ae6e6e40
commit 0464e03b92
3 changed files with 40 additions and 1 deletions

View File

@@ -1268,7 +1268,19 @@ export class DragEventWatcher {
content,
},
noteId
).catch(console.error);
)
.then(() => {
const telemetry = this.std.getOptional(TelemetryProvider);
telemetry?.track('CanvasElementAdded', {
page: 'whiteboard editor',
module: 'canvas',
segment: 'whiteboard',
control: 'canvas:drop',
type: 'note',
other: 'split-from-note',
});
})
.catch(console.error);
}
}
};