chore(editor): remove page block feature flag (#10251)

This commit is contained in:
L-Sun
2025-02-18 09:25:05 +00:00
parent cedee0a1b2
commit e639f08b71
13 changed files with 30 additions and 81 deletions
@@ -3,18 +3,13 @@ import { useSharingUrl } from '@affine/core/components/hooks/affine/use-share-ur
import { WorkspaceDialogService } from '@affine/core/modules/dialogs';
import { DocService } from '@affine/core/modules/doc';
import { EditorService } from '@affine/core/modules/editor';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { useInsidePeekView } from '@affine/core/modules/peek-view/view/modal-container';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { extractEmojiIcon } from '@affine/core/utils';
import { useI18n } from '@affine/i18n';
import { track } from '@affine/track';
import { GfxControllerIdentifier } from '@blocksuite/affine/block-std/gfx';
import {
matchModels,
NoteBlockModel,
NoteDisplayMode,
} from '@blocksuite/affine/blocks';
import { type NoteBlockModel } from '@blocksuite/affine/blocks';
import { Bound } from '@blocksuite/affine/global/utils';
import {
InformationIcon,
@@ -184,19 +179,9 @@ const LinkButton = ({ note }: { note: NoteBlockModel }) => {
};
export const EdgelessNoteHeader = ({ note }: { note: NoteBlockModel }) => {
const flags = useService(FeatureFlagService).flags;
const insidePeekView = useInsidePeekView();
if (!flags.enable_page_block) return null;
const isFirstVisibleNote =
note.parent?.children.find(
child =>
matchModels(child, [NoteBlockModel]) &&
child.displayMode === NoteDisplayMode.DocAndEdgeless
) === note;
if (!isFirstVisibleNote) return null;
if (!note.isPageBlock()) return null;
return (
<div className={styles.header} data-testid="edgeless-page-block-header">
@@ -231,17 +231,6 @@ export const AFFINE_FLAGS = {
configurable: true,
defaultState: isCanaryBuild,
},
// TODO(@L-Sun): remove this flag when ready
enable_page_block: {
category: 'blocksuite',
bsFlag: 'enable_page_block',
displayName:
'com.affine.settings.workspace.experimental-features.enable-page-block-header.name',
description:
'com.affine.settings.workspace.experimental-features.enable-page-block-header.description',
configurable: isCanaryBuild,
defaultState: isCanaryBuild,
},
enable_editor_rtl: {
category: 'affine',
displayName:
-8
View File
@@ -5437,14 +5437,6 @@ export function useAFFiNEI18N(): {
* `Once enabled, you can preview PDF in embed view.`
*/
["com.affine.settings.workspace.experimental-features.enable-pdf-embed-preview.description"](): string;
/**
* `Page Block Header`
*/
["com.affine.settings.workspace.experimental-features.enable-page-block-header.name"](): string;
/**
* `Once enabled, the header of page block will be displayed.`
*/
["com.affine.settings.workspace.experimental-features.enable-page-block-header.description"](): string;
/**
* `Editor RTL`
*/
@@ -1357,8 +1357,6 @@
"com.affine.settings.workspace.experimental-features.enable-mobile-edgeless-editing.description": "Once enabled, users can edit edgeless canvas.",
"com.affine.settings.workspace.experimental-features.enable-pdf-embed-preview.name": "PDF embed preview",
"com.affine.settings.workspace.experimental-features.enable-pdf-embed-preview.description": "Once enabled, you can preview PDF in embed view.",
"com.affine.settings.workspace.experimental-features.enable-page-block-header.name": "Page Block Header",
"com.affine.settings.workspace.experimental-features.enable-page-block-header.description": "Once enabled, the header of page block will be displayed.",
"com.affine.settings.workspace.experimental-features.enable-editor-rtl.name": "Editor RTL",
"com.affine.settings.workspace.experimental-features.enable-editor-rtl.description": "Once enabled, the editor will be displayed in RTL mode.",
"com.affine.settings.workspace.not-owner": "Only an owner can edit the workspace avatar and name. Changes will be shown for everyone.",