mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 06:47:02 +08:00
feat(core): ai intelligence track (#13187)
Close [AI-335](https://linear.app/affine-design/issue/AI-335) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for an "independent mode" and document-specific context in AI chat components, allowing enhanced context handling and tracking. * Introduced new tracking options to distinguish between current document and general document actions in chat interactions. * **Improvements** * More flexible property handling for independent mode and document context across chat-related components for consistent behavior and tracking. * Enhanced tracking system to support additional event categories and methods for more granular analytics. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -442,6 +442,9 @@ interface PageEvents extends PageDivision {
|
||||
chatPanel: {
|
||||
chatPanelInput: ['addEmbeddingDoc'];
|
||||
};
|
||||
intelligence: {
|
||||
chatPanelInput: ['addEmbeddingDoc'];
|
||||
};
|
||||
commentPanel: {
|
||||
$: ['createComment', 'editComment', 'deleteComment', 'resolveComment'];
|
||||
};
|
||||
@@ -720,7 +723,7 @@ export type EventArgs = {
|
||||
addEmbeddingDoc: {
|
||||
type?: 'page' | 'edgeless';
|
||||
control: 'addButton' | 'atMenu';
|
||||
method: 'doc' | 'file' | 'tags' | 'collections' | 'suggestion';
|
||||
method: 'doc' | 'cur-doc' | 'file' | 'tags' | 'collections' | 'suggestion';
|
||||
};
|
||||
openAttachmentInFullscreen: AttachmentEventArgs;
|
||||
openAttachmentInNewTab: AttachmentEventArgs;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { enableAutoTrack, makeTracker } from './auto';
|
||||
import { type Events } from './events';
|
||||
import { type EventArgs, type Events } from './events';
|
||||
import { mixpanel } from './mixpanel';
|
||||
import { sentry } from './sentry';
|
||||
export const track = makeTracker((event, props) => {
|
||||
mixpanel.track(event, props);
|
||||
});
|
||||
|
||||
export { enableAutoTrack, type Events, mixpanel, sentry };
|
||||
export { enableAutoTrack, type EventArgs, type Events, mixpanel, sentry };
|
||||
export default track;
|
||||
|
||||
Reference in New Issue
Block a user