From 5b027f798653569c39a0d8206bf67625ab22f457 Mon Sep 17 00:00:00 2001 From: L-Sun Date: Thu, 10 Jul 2025 13:08:53 +0800 Subject: [PATCH] fix(core): disable comment in local workspace (#13124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close AF-2731 #### PR Dependency Tree * **PR #13124** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) ## Summary by CodeRabbit * **New Features** * Comment functionality is now available only for cloud workspaces and is disabled for local or shared modes. * **Bug Fixes** * Improved accuracy in enabling comments based on workspace type and configuration. --- .../core/src/blocksuite/block-suite-editor/lit-adaper.tsx | 2 +- .../src/desktop/pages/workspace/detail-page/detail-page.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/frontend/core/src/blocksuite/block-suite-editor/lit-adaper.tsx b/packages/frontend/core/src/blocksuite/block-suite-editor/lit-adaper.tsx index 1ffe661558..9ff4622c92 100644 --- a/packages/frontend/core/src/blocksuite/block-suite-editor/lit-adaper.tsx +++ b/packages/frontend/core/src/blocksuite/block-suite-editor/lit-adaper.tsx @@ -87,7 +87,7 @@ const usePatchSpecs = (mode: DocMode, shared?: boolean) => { // comment may not be supported by the server const enableComment = - serverConfig.features.includes(ServerFeature.Comment) && !shared; + isCloud && serverConfig.features.includes(ServerFeature.Comment) && !shared; const patchedSpecs = useMemo(() => { const manager = getViewManager() diff --git a/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page.tsx b/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page.tsx index c7b8bdba9a..532da13295 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page.tsx @@ -119,7 +119,9 @@ const DetailPageImpl = memo(function DetailPageImpl() { const serverConfig = useLiveData(serverService.server.config$); // comment may not be supported by the server - const enableComment = serverConfig.features.includes(ServerFeature.Comment); + const enableComment = + workspace.flavour !== 'local' && + serverConfig.features.includes(ServerFeature.Comment); useEffect(() => { if (isActiveView) {