feat(core): apply model tracking (#13128)

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

* **New Features**
* Added user interaction tracking for document editing and diff review
actions, including accepting, rejecting, applying, and copying changes.
* Introduced tracking for "Accept all" and "Reject all" actions in block
diff views.

* **Chores**
* Enhanced event tracking system with new event types and payloads to
support detailed analytics for editing and review actions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
德布劳外 · 贾贵
2025-07-10 17:25:05 +08:00
committed by GitHub
parent 3538c78a8b
commit 6b7d1e91e0
4 changed files with 61 additions and 8 deletions

View File

@@ -207,6 +207,16 @@ type CommentEvents =
| 'resolveComment';
// END SECTION
// SECTION: apply model
type ApplyModelEvents =
| 'acceptAll'
| 'rejectAll'
| 'accept'
| 'reject'
| 'apply'
| 'copy';
// END SECTION
type UserEvents =
| GeneralEvents
| AppEvents
@@ -231,7 +241,8 @@ type UserEvents =
| IntegrationEvents
| MeetingEvents
| MentionEvents
| WorkspaceEmbeddingEvents;
| WorkspaceEmbeddingEvents
| ApplyModelEvents;
interface PageDivision {
[page: string]: {
@@ -564,6 +575,15 @@ interface PageEvents extends PageDivision {
$: ['createDoc'];
};
};
applyModel: {
widget: {
page: ['acceptAll', 'rejectAll'];
block: ['accept', 'reject'];
};
chat: {
$: ['apply', 'accept', 'reject', 'copy'];
};
};
}
type OrganizeItemType = 'doc' | 'folder' | 'collection' | 'tag' | 'favorite';
@@ -635,6 +655,13 @@ type RecordingEventArgs = {
option?: 'Auto transcribing' | 'handle transcribing' | 'on' | 'off';
};
type ApplyModelArgs = {
/* User's complete instruction */
instruction?: string;
/* Split individual semantic change requests */
operation?: string;
};
export type EventArgs = {
createWorkspace: { flavour: string };
signIn: AuthArgs;
@@ -829,6 +856,9 @@ export type EventArgs = {
};
editComment: { type: 'root' | 'node' };
deleteComment: { type: 'root' | 'node' };
accept: ApplyModelArgs;
reject: ApplyModelArgs;
apply: ApplyModelArgs;
};
// for type checking