chore(editor): add telemetry track to display mode of note (#10192)

Close [BS-2468](https://linear.app/affine-design/issue/BS-2468/analytics-for-page-block-polish)
This commit is contained in:
L-Sun
2025-02-17 03:23:55 +00:00
parent 1476ca922b
commit 85e413f8c8
3 changed files with 26 additions and 1 deletions
@@ -27,6 +27,7 @@ import {
FeatureFlagService,
NotificationProvider,
SidebarExtensionIdentifier,
TelemetryProvider,
ThemeProvider,
} from '@blocksuite/affine-shared/services';
import {
@@ -190,6 +191,7 @@ export class EdgelessChangeNoteButton extends WithDisposable(LitElement) {
}
private _setDisplayMode(note: NoteBlockModel, newMode: NoteDisplayMode) {
const oldMode = note.displayMode;
this.edgeless.std.command.exec(changeNoteDisplayMode, {
noteId: note.id,
mode: newMode,
@@ -263,6 +265,17 @@ export class EdgelessChangeNoteButton extends WithDisposable(LitElement) {
clear();
},
});
this.edgeless.std
.getOptional(TelemetryProvider)
?.track('NoteDisplayModeChanged', {
page: 'whiteboard editor',
segment: 'element toolbar',
module: 'element toolbar',
control: 'display mode',
type: 'note',
other: `from ${oldMode} to ${newMode}`,
});
}
private _setShadowType(shadowType: string) {