chore(core): remove outline viewer feature flag (#7770)

This commit is contained in:
L-Sun
2024-08-07 03:46:14 +00:00
parent aee24ffb31
commit f6279ee47f
5 changed files with 11 additions and 65 deletions

View File

@@ -124,26 +124,6 @@ const SplitViewSettingRow = () => {
);
};
const OutlineViewerSettingRow = () => {
const { appSettings, updateSettings } = useAppSettingHelper();
const onToggle = useCallback(
(checked: boolean) => {
updateSettings('enableOutlineViewer', checked);
},
[updateSettings]
);
return (
<ExperimentalFeaturesItem
title="Outline Viewer"
checked={appSettings.enableOutlineViewer}
onChange={onToggle}
testId="outline-viewer-switch"
/>
);
};
// feature flag -> display name
const blocksuiteFeatureFlags: Partial<Record<keyof BlockSuiteFlags, string>> = {
enable_expand_database_block: 'Enable Expand Database Block',
@@ -198,7 +178,6 @@ const ExperimentalFeaturesMain = () => {
>
<SplitViewSettingRow />
<BlocksuiteFeatureFlagSettings />
<OutlineViewerSettingRow />
</div>
</>
);

View File

@@ -4,7 +4,6 @@ import { AIProvider } from '@affine/core/blocksuite/presets/ai';
import { AffineErrorBoundary } from '@affine/core/components/affine/affine-error-boundary';
import { BlockSuiteEditor } from '@affine/core/components/blocksuite/block-suite-editor';
import { EditorOutlineViewer } from '@affine/core/components/blocksuite/outline-viewer';
import { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper';
import { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';
import { PageNotFound } from '@affine/core/pages/404';
import { DebugLogger } from '@affine/debug';
@@ -75,7 +74,6 @@ export function DocPeekPreview({
const workbench = useService(WorkbenchService).workbench;
const peekView = useService(PeekViewService).peekView;
const [editor, setEditor] = useState<AffineEditorContainer | null>(null);
const { appSettings } = useAppSettingHelper();
const onRef = (editor: AffineEditorContainer) => {
setEditor(editor);
@@ -177,13 +175,11 @@ export function DocPeekPreview({
page={doc.blockSuiteDoc}
/>
</FrameworkScope>
{appSettings.enableOutlineViewer && (
<EditorOutlineViewer
editor={editor}
show={resolvedMode === 'page'}
openOutlinePanel={openOutlinePanel}
/>
)}
<EditorOutlineViewer
editor={editor}
show={resolvedMode === 'page'}
openOutlinePanel={openOutlinePanel}
/>
</Scrollable.Viewport>
<Scrollable.Scrollbar />

View File

@@ -270,13 +270,11 @@ const DetailPageImpl = memo(function DetailPageImpl() {
})}
/>
</Scrollable.Root>
{appSettings.enableOutlineViewer && (
<EditorOutlineViewer
editor={editor}
show={mode === 'page' && !isSideBarOpen}
openOutlinePanel={openOutlinePanel}
/>
)}
<EditorOutlineViewer
editor={editor}
show={mode === 'page' && !isSideBarOpen}
openOutlinePanel={openOutlinePanel}
/>
</AffineErrorBoundary>
{isInTrash ? <TrashPageFooter /> : null}
</div>