mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-24 04:27:27 +08:00
chore(core): remove outline viewer feature flag (#7770)
This commit is contained in:
@@ -33,7 +33,6 @@ export type AppSetting = {
|
|||||||
autoDownloadUpdate: boolean;
|
autoDownloadUpdate: boolean;
|
||||||
enableMultiView: boolean;
|
enableMultiView: boolean;
|
||||||
enableTelemetry: boolean;
|
enableTelemetry: boolean;
|
||||||
enableOutlineViewer: boolean;
|
|
||||||
editorFlags: Partial<Omit<BlockSuiteFlags, 'readonly'>>;
|
editorFlags: Partial<Omit<BlockSuiteFlags, 'readonly'>>;
|
||||||
};
|
};
|
||||||
export const windowFrameStyleOptions: AppSetting['windowFrameStyle'][] = [
|
export const windowFrameStyleOptions: AppSetting['windowFrameStyle'][] = [
|
||||||
@@ -75,7 +74,6 @@ const appSettingBaseAtom = atomWithStorage<AppSetting>('affine-settings', {
|
|||||||
autoDownloadUpdate: true,
|
autoDownloadUpdate: true,
|
||||||
enableTelemetry: true,
|
enableTelemetry: true,
|
||||||
enableMultiView: false,
|
enableMultiView: false,
|
||||||
enableOutlineViewer: false,
|
|
||||||
editorFlags: {},
|
editorFlags: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
-21
@@ -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
|
// feature flag -> display name
|
||||||
const blocksuiteFeatureFlags: Partial<Record<keyof BlockSuiteFlags, string>> = {
|
const blocksuiteFeatureFlags: Partial<Record<keyof BlockSuiteFlags, string>> = {
|
||||||
enable_expand_database_block: 'Enable Expand Database Block',
|
enable_expand_database_block: 'Enable Expand Database Block',
|
||||||
@@ -198,7 +178,6 @@ const ExperimentalFeaturesMain = () => {
|
|||||||
>
|
>
|
||||||
<SplitViewSettingRow />
|
<SplitViewSettingRow />
|
||||||
<BlocksuiteFeatureFlagSettings />
|
<BlocksuiteFeatureFlagSettings />
|
||||||
<OutlineViewerSettingRow />
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { AIProvider } from '@affine/core/blocksuite/presets/ai';
|
|||||||
import { AffineErrorBoundary } from '@affine/core/components/affine/affine-error-boundary';
|
import { AffineErrorBoundary } from '@affine/core/components/affine/affine-error-boundary';
|
||||||
import { BlockSuiteEditor } from '@affine/core/components/blocksuite/block-suite-editor';
|
import { BlockSuiteEditor } from '@affine/core/components/blocksuite/block-suite-editor';
|
||||||
import { EditorOutlineViewer } from '@affine/core/components/blocksuite/outline-viewer';
|
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 { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';
|
||||||
import { PageNotFound } from '@affine/core/pages/404';
|
import { PageNotFound } from '@affine/core/pages/404';
|
||||||
import { DebugLogger } from '@affine/debug';
|
import { DebugLogger } from '@affine/debug';
|
||||||
@@ -75,7 +74,6 @@ export function DocPeekPreview({
|
|||||||
const workbench = useService(WorkbenchService).workbench;
|
const workbench = useService(WorkbenchService).workbench;
|
||||||
const peekView = useService(PeekViewService).peekView;
|
const peekView = useService(PeekViewService).peekView;
|
||||||
const [editor, setEditor] = useState<AffineEditorContainer | null>(null);
|
const [editor, setEditor] = useState<AffineEditorContainer | null>(null);
|
||||||
const { appSettings } = useAppSettingHelper();
|
|
||||||
|
|
||||||
const onRef = (editor: AffineEditorContainer) => {
|
const onRef = (editor: AffineEditorContainer) => {
|
||||||
setEditor(editor);
|
setEditor(editor);
|
||||||
@@ -177,13 +175,11 @@ export function DocPeekPreview({
|
|||||||
page={doc.blockSuiteDoc}
|
page={doc.blockSuiteDoc}
|
||||||
/>
|
/>
|
||||||
</FrameworkScope>
|
</FrameworkScope>
|
||||||
{appSettings.enableOutlineViewer && (
|
<EditorOutlineViewer
|
||||||
<EditorOutlineViewer
|
editor={editor}
|
||||||
editor={editor}
|
show={resolvedMode === 'page'}
|
||||||
show={resolvedMode === 'page'}
|
openOutlinePanel={openOutlinePanel}
|
||||||
openOutlinePanel={openOutlinePanel}
|
/>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Scrollable.Viewport>
|
</Scrollable.Viewport>
|
||||||
|
|
||||||
<Scrollable.Scrollbar />
|
<Scrollable.Scrollbar />
|
||||||
|
|||||||
@@ -270,13 +270,11 @@ const DetailPageImpl = memo(function DetailPageImpl() {
|
|||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
</Scrollable.Root>
|
</Scrollable.Root>
|
||||||
{appSettings.enableOutlineViewer && (
|
<EditorOutlineViewer
|
||||||
<EditorOutlineViewer
|
editor={editor}
|
||||||
editor={editor}
|
show={mode === 'page' && !isSideBarOpen}
|
||||||
show={mode === 'page' && !isSideBarOpen}
|
openOutlinePanel={openOutlinePanel}
|
||||||
openOutlinePanel={openOutlinePanel}
|
/>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</AffineErrorBoundary>
|
</AffineErrorBoundary>
|
||||||
{isInTrash ? <TrashPageFooter /> : null}
|
{isInTrash ? <TrashPageFooter /> : null}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,36 +11,13 @@ import {
|
|||||||
waitForEditorLoad,
|
waitForEditorLoad,
|
||||||
waitForEmptyEditor,
|
waitForEmptyEditor,
|
||||||
} from '@affine-test/kit/utils/page-logic';
|
} from '@affine-test/kit/utils/page-logic';
|
||||||
import {
|
import { expect } from '@playwright/test';
|
||||||
confirmExperimentalPrompt,
|
|
||||||
openExperimentalFeaturesPanel,
|
|
||||||
openSettingModal,
|
|
||||||
} from '@affine-test/kit/utils/setting';
|
|
||||||
import { expect, type Page } from '@playwright/test';
|
|
||||||
|
|
||||||
async function enableOutlineViewer(page: Page) {
|
|
||||||
await openSettingModal(page);
|
|
||||||
await openExperimentalFeaturesPanel(page);
|
|
||||||
const prompt = page.getByTestId('experimental-prompt');
|
|
||||||
await expect(prompt).toBeVisible();
|
|
||||||
await confirmExperimentalPrompt(page);
|
|
||||||
const settings = page.getByTestId('experimental-settings');
|
|
||||||
const enableOutlineViewerSetting = settings.getByTestId(
|
|
||||||
'outline-viewer-switch'
|
|
||||||
);
|
|
||||||
await expect(enableOutlineViewerSetting).toBeVisible();
|
|
||||||
await enableOutlineViewerSetting.click();
|
|
||||||
await page.waitForTimeout(500);
|
|
||||||
await page.getByTestId('modal-close-button').click();
|
|
||||||
await page.waitForTimeout(500);
|
|
||||||
}
|
|
||||||
|
|
||||||
test('outline viewer is useable', async ({ page }) => {
|
test('outline viewer is useable', async ({ page }) => {
|
||||||
await openHomePage(page);
|
await openHomePage(page);
|
||||||
await waitForEditorLoad(page);
|
await waitForEditorLoad(page);
|
||||||
await clickNewPageButton(page);
|
await clickNewPageButton(page);
|
||||||
await waitForEditorLoad(page);
|
await waitForEditorLoad(page);
|
||||||
await enableOutlineViewer(page);
|
|
||||||
|
|
||||||
const title = getBlockSuiteEditorTitle(page);
|
const title = getBlockSuiteEditorTitle(page);
|
||||||
await title.click();
|
await title.click();
|
||||||
@@ -69,7 +46,6 @@ test('outline viewer should hide in edgeless mode', async ({ page }) => {
|
|||||||
await waitForEditorLoad(page);
|
await waitForEditorLoad(page);
|
||||||
await clickNewPageButton(page);
|
await clickNewPageButton(page);
|
||||||
await waitForEditorLoad(page);
|
await waitForEditorLoad(page);
|
||||||
await enableOutlineViewer(page);
|
|
||||||
|
|
||||||
const title = getBlockSuiteEditorTitle(page);
|
const title = getBlockSuiteEditorTitle(page);
|
||||||
await title.click();
|
await title.click();
|
||||||
@@ -94,7 +70,6 @@ test('outline viewer should be useable in doc peek preview', async ({
|
|||||||
}) => {
|
}) => {
|
||||||
await openHomePage(page);
|
await openHomePage(page);
|
||||||
await waitForEditorLoad(page);
|
await waitForEditorLoad(page);
|
||||||
await enableOutlineViewer(page);
|
|
||||||
await clickNewPageButton(page);
|
await clickNewPageButton(page);
|
||||||
await waitForEmptyEditor(page);
|
await waitForEmptyEditor(page);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user