From b9e1c1107f675a7d051549561a1305767a4a997f Mon Sep 17 00:00:00 2001 From: L-Sun Date: Fri, 8 Nov 2024 11:06:14 +0000 Subject: [PATCH] chore(mobile): disable reference popup on mobile (#8743) This PR disable reference node popup on mobile. Close [BS-1730](https://linear.app/affine-design/issue/BS-1730/%E7%A6%81%E7%94%A8-block-yuan%E7%B4%A0%E7%9A%84-toolbar) --- .../specs/custom/spec-patchers.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx index 7bfe35ca90382..e9dfc77b44655 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx @@ -40,6 +40,7 @@ import type { PeekOptions, PeekViewService as BSPeekViewService, QuickSearchResult, + ReferenceNodeConfig, RootBlockConfig, RootService, } from '@blocksuite/affine/blocks'; @@ -57,6 +58,7 @@ import { PeekViewExtension, QuickSearchExtension, ReferenceNodeConfigExtension, + ReferenceNodeConfigIdentifier, } from '@blocksuite/affine/blocks'; import { type BlockSnapshot, Text } from '@blocksuite/affine/store'; import { @@ -567,6 +569,17 @@ export function patchForMobile() { }); } + // Hide reference popup on mobile. + { + const prev = di.getFactory(ReferenceNodeConfigIdentifier); + di.override(ReferenceNodeConfigIdentifier, provider => { + return { + ...prev?.(provider), + hidePopup: true, + } satisfies ReferenceNodeConfig; + }); + } + // Disable some toolbar widgets for mobile. { di.override(WidgetViewMapIdentifier('affine:page'), () => {