feat: add event tracker for ai chat block (#7637)

[BS-940](https://linear.app/affine-design/issue/BS-940/ai-chat-block-相关埋点)

related: https://github.com/toeverything/blocksuite/pull/7733
This commit is contained in:
donteatfriedrice
2024-07-29 09:42:29 +00:00
parent ab11f09b83
commit c5cf8480fc
2 changed files with 18 additions and 0 deletions

View File

@@ -337,6 +337,15 @@ const SAVE_CHAT_TO_BLOCK_ACTION: ChatAction = {
if (!blockId) {
return false;
}
rootService.telemetryService?.track('CanvasElementAdded', {
control: 'manually save',
page: 'whiteboard editor',
module: 'ai chat panel',
segment: 'right sidebar',
type: 'chat block',
category: 'root',
});
return true;
} catch (err) {
console.error(err);

View File

@@ -204,6 +204,15 @@ export class AIChatBlockPeekView extends LitElement {
source: { id: this.parentChatBlockId },
target: { id: aiChatBlockId },
});
edgelessService.telemetryService?.track('CanvasElementAdded', {
control: 'conversation',
page: 'whiteboard editor',
module: 'canvas',
segment: 'whiteboard',
type: 'chat block',
category: 'branch',
});
};
/**