From a51ceeb4094b89307ccb88dc622199ba4d6e676b Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Thu, 26 Feb 2026 12:25:43 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A9(frontend)=20add=20Analytics=20feat?= =?UTF-8?q?ure=20flag=20on=20Blocknote=20AI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want to have a fine grained control over the Blocknote AI feature. By adding the feature Analytics feature flag, we can enable or disable this feature for specific users or groups without deploying new code. This allows us to test the feature in a controlled environment and gather feedback before a full rollout. --- CHANGELOG.md | 1 + .../features/docs/doc-editor/components/BlockNoteEditor.tsx | 4 ++++ .../apps/impress/src/features/docs/doc-editor/conf.ts | 1 + 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b27dabe12..5e5c21bbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to - ✨(backend) allow the duplication of subpages #1893 - ✨(backend) Onboarding docs for new users #1891 - 🩺(trivy) add trivyignore file and add minimatch CVE #1915 +- 🚩 Add feature flags for the AI feature #1922 ### Changed diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx index 36f701144..061ba14cc 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx @@ -24,7 +24,9 @@ import { useConfig } from '@/core'; import { useCunninghamTheme } from '@/cunningham'; import { Doc, useProviderStore } from '@/docs/doc-management'; import { avatarUrlFromName, useAuth } from '@/features/auth'; +import { useAnalytics } from '@/libs/Analytics'; +import { AI_FEATURE_FLAG } from '../conf'; import { useHeadings, useSaveDoc, @@ -105,9 +107,11 @@ export const BlockNoteEditor = ({ doc, provider }: BlockNoteEditorProps) => { const { uploadFile, errorAttachment } = useUploadFile(doc.id); const conf = useConfig().data; + const { isFeatureFlagActivated } = useAnalytics(); const aiBlockNoteAllowed = !!( conf?.AI_FEATURE_ENABLED && conf?.AI_FEATURE_BLOCKNOTE_ENABLED && + isFeatureFlagActivated(AI_FEATURE_FLAG) && doc.abilities?.ai_proxy ); const aiExtension = useAI?.(doc.id, aiBlockNoteAllowed); diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/conf.ts b/src/frontend/apps/impress/src/features/docs/doc-editor/conf.ts index f78c10892..0901888c0 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/conf.ts +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/conf.ts @@ -1 +1,2 @@ export const ANALYZE_URL = 'media-check'; +export const AI_FEATURE_FLAG = 'ai_blocknote';