Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

feat(editor): add block meta feature flag (#10548)

Saul-Mironefdde818ddda8
diff --git a/blocksuite/affine/shared/src/services/feature-flag-service.ts b/blocksuite/affine/shared/src/services/feature-flag-service.ts
index 7f94643bce..75abd0ddbf 100644
--- a/blocksuite/affine/shared/src/services/feature-flag-service.ts
+++ b/blocksuite/affine/shared/src/services/feature-flag-service.ts
@@ -16,6 +16,7 @@ export interface BlockSuiteFlags {
enable_shape_shadow_blur: boolean;
enable_mobile_keyboard_toolbar: boolean;
enable_mobile_linked_doc_menu: boolean;
+ enable_block_meta: boolean;
}
export class FeatureFlagService extends StoreExtension {
@@ -36,6 +37,7 @@ export class FeatureFlagService extends StoreExtension {
enable_shape_shadow_blur: false,
enable_mobile_keyboard_toolbar: false,
enable_mobile_linked_doc_menu: false,
+ enable_block_meta: false,
});
setFlag(key: keyof BlockSuiteFlags, value: boolean) {
diff --git a/packages/frontend/core/src/modules/feature-flag/constant.ts b/packages/frontend/core/src/modules/feature-flag/constant.ts
index 1563fa1119..c2cd3c99db 100644
--- a/packages/frontend/core/src/modules/feature-flag/constant.ts
+++ b/packages/frontend/core/src/modules/feature-flag/constant.ts
@@ -103,6 +103,16 @@ export const AFFINE_FLAGS = {
configurable: false,
defaultState: true,
},
+ enable_block_meta: {
+ category: 'blocksuite',
+ bsFlag: 'enable_block_meta',
+ displayName:
+ 'com.affine.settings.workspace.experimental-features.enable-block-meta.name',
+ description:
+ 'com.affine.settings.workspace.experimental-features.enable-block-meta.description',
+ configurable: isCanaryBuild,
+ defaultState: false,
+ },
enable_emoji_folder_icon: {
category: 'affine',
displayName:
diff --git a/packages/frontend/i18n/src/i18n.gen.ts b/packages/frontend/i18n/src/i18n.gen.ts
index 98a582eb6f..c5f3f9c65d 100644
--- a/packages/frontend/i18n/src/i18n.gen.ts
+++ b/packages/frontend/i18n/src/i18n.gen.ts
@@ -208,11 +208,11 @@ export function useAFFiNEI18N(): {
*/
["Export Description"](): string;
/**
- * `You can export the entire Workspace data for backup, and the exported data can be re-imported, but you are offline now which will cause the exported data not up to date.`
+ * `You can export the entire Workspace data for backup, and the exported data can be re-imported. But you are offline now which will cause the exported data not up to date.`
*/
["Export Description(Offline)"](): string;
/**
- * `You can export the entire Workspace data for backup, and the exported data can be re-imported, but you must sync all cloud data first to keep your exported data up to date.`
+ * `You can export the entire Workspace data for backup, and the exported data can be re-imported. But you must sync all cloud data first to keep your exported data up to date.`
*/
["Full Sync Description"](): string;
/**
@@ -5361,6 +5361,14 @@ export function useAFFiNEI18N(): {
* `Enables mind map import.`
*/
["com.affine.settings.workspace.experimental-features.enable-mind-map-import.description"](): string;
+ /**
+ * `Block Meta`
+ */
+ ["com.affine.settings.workspace.experimental-features.enable-block-meta.name"](): string;
+ /**
+ * `Once enabled, all blocks will have created time, updated time, created by and updated by.`
+ */
+ ["com.affine.settings.workspace.experimental-features.enable-block-meta.description"](): string;
/**
* `Emoji Folder Icon`
*/
diff --git a/packages/frontend/i18n/src/resources/en.json b/packages/frontend/i18n/src/resources/en.json
index fa7aaae22e..71964ad560 100644
--- a/packages/frontend/i18n/src/resources/en.json
+++ b/packages/frontend/i18n/src/resources/en.json
@@ -1338,6 +1338,8 @@
"com.affine.settings.workspace.experimental-features.enable-ai-onboarding.description": "Enables AI onboarding.",
"com.affine.settings.workspace.experimental-features.enable-mind-map-import.name": "Mind Map Import",
"com.affine.settings.workspace.experimental-features.enable-mind-map-import.description": "Enables mind map import.",
+ "com.affine.settings.workspace.experimental-features.enable-block-meta.name": "Block Meta",
+ "com.affine.settings.workspace.experimental-features.enable-block-meta.description": "Once enabled, all blocks will have created time, updated time, created by and updated by.",
"com.affine.settings.workspace.experimental-features.enable-emoji-folder-icon.name": "Emoji Folder Icon",
"com.affine.settings.workspace.experimental-features.enable-emoji-folder-icon.description": "Once enabled, you can use an emoji as the folder icon. When the first character of the folder name is an emoji, it will be extracted and used as its icon.",
"com.affine.settings.workspace.experimental-features.enable-emoji-doc-icon.name": "Emoji Doc Icon",