chore(core): add event tracking for attachments (#9198)

Part of: [AF-1678](https://linear.app/affine-design/issue/AF-1678/添加埋点)
This commit is contained in:
fundon
2024-12-20 02:43:11 +00:00
parent 7ff24e9c1c
commit d7983c50e3
4 changed files with 74 additions and 18 deletions

View File

@@ -116,6 +116,15 @@ type PaymentEvents =
| 'confirmResumingSubscription';
// END SECTION
// SECTION: attachment
type AttachmentEvents =
| 'openAttachmentInFullscreen'
| 'openAttachmentInNewTab'
| 'openAttachmentInPeekView'
| 'openAttachmentInSplitView'
| 'openPDFRendererFail';
// END SECTION
type UserEvents =
| GeneralEvents
| AppEvents
@@ -130,7 +139,8 @@ type UserEvents =
| AuthEvents
| AccountEvents
| PaymentEvents
| DNDEvents;
| DNDEvents
| AttachmentEvents;
interface PageDivision {
[page: string]: {
[segment: string]: {
@@ -284,6 +294,15 @@ const PageEvents = {
importModal: ['open'],
snapshot: ['import', 'export'],
},
attachment: {
$: [
'openAttachmentInFullscreen',
'openAttachmentInNewTab',
'openAttachmentInPeekView',
'openAttachmentInSplitView',
'openPDFRendererFail',
],
},
},
doc: {
editor: {
@@ -353,6 +372,10 @@ type PaymentEventArgs = {
recurring: string;
};
type AttachmentEventArgs = {
type: string; // file type
};
type TabActionControlType =
| 'click'
| 'dnd'
@@ -435,6 +458,10 @@ export type EventArgs = {
linkDoc: { type: string; journal: boolean };
drop: { type: string };
dragStart: { type: string };
openAttachmentInFullscreen: AttachmentEventArgs;
openAttachmentInNewTab: AttachmentEventArgs;
openAttachmentInPeekView: AttachmentEventArgs;
openAttachmentInSplitView: AttachmentEventArgs;
};
// for type checking