From 2ee3d6ecf92d58c137885cbe2c97621ecbaa2274 Mon Sep 17 00:00:00 2001 From: Sergey Kozyrenko Date: Tue, 30 Jun 2026 21:47:36 +0700 Subject: [PATCH] fix(knowledges): make the Plain/Visual toggle reachable on a new document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Plain/Visual DropdownMenuItem sat inside the `canShowActions` (!isNew) block, and the dropdown trigger itself was gated the same way, so a brand-new knowledge doc was locked to the visual editor until first save — inconsistent with templates, where the toggle is outside that gate. Move the toggle out of `canShowActions` (Rename/Delete still require a saved doc) and show the trigger whenever a toggle handler is supplied. Co-Authored-By: Claude Opus 4.8 --- .../features/knowledges/knowledge-header.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/frontend/src/features/knowledges/knowledge-header.tsx b/frontend/src/features/knowledges/knowledge-header.tsx index aa5aa6b4..cf7dea42 100644 --- a/frontend/src/features/knowledges/knowledge-header.tsx +++ b/frontend/src/features/knowledges/knowledge-header.tsx @@ -214,7 +214,7 @@ export function KnowledgeHeader({ /> )} {saveButton} - {(canShowActions || (isMobile && canAnonymize)) && ( + {(canShowActions || (isMobile && canAnonymize) || !!onToggleViewMode) && (