mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
feat(editor): track citation events (#12664)
Closes: [BS-3551](https://linear.app/affine-design/issue/BS-3551/citation埋点) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced citation tracking across attachments, bookmarks, embedded documents, paragraphs, footnotes, rename modals, and toolbars for actions like editing, deleting, expanding, and hovering on citations. - Introduced a centralized citation service to unify citation detection and telemetry event management. - **Chores** - Updated service exports and telemetry modules to include the new citation service and citation-related event types. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -51,6 +51,7 @@ import { getSelectedModelsCommand } from '@blocksuite/affine/shared/commands';
|
||||
import { ImageSelection } from '@blocksuite/affine/shared/selection';
|
||||
import {
|
||||
ActionPlacement,
|
||||
CitationProvider,
|
||||
GenerateDocUrlProvider,
|
||||
isRemovedUserInfo,
|
||||
OpenDocExtensionIdentifier,
|
||||
@@ -462,6 +463,10 @@ function createExternalLinkableToolbarConfig(
|
||||
(_std, _component, props) => {
|
||||
ctx.store.updateBlock(model, props);
|
||||
block.requestUpdate();
|
||||
const citationService = ctx.std.get(CitationProvider);
|
||||
if (citationService.isCitationModel(model)) {
|
||||
citationService.trackEvent('Edit');
|
||||
}
|
||||
},
|
||||
abortController
|
||||
);
|
||||
@@ -805,6 +810,10 @@ const embedLinkedDocToolbarConfig = {
|
||||
(_std, _component, props) => {
|
||||
ctx.store.updateBlock(model, props);
|
||||
block.requestUpdate();
|
||||
const citationService = ctx.std.get(CitationProvider);
|
||||
if (citationService.isCitationModel(model)) {
|
||||
citationService.trackEvent('Edit');
|
||||
}
|
||||
},
|
||||
abortController
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user