From 00b620cbf75e846f997d754aad98180f740f9c36 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sun, 21 Sep 2025 01:30:30 +0800 Subject: [PATCH] Fix F2 rename functionality - eliminate half-baked feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following Linus principle: "功能不完整就不应该暴露给用户" BEFORE: F2 key only printed console.log - useless UI control AFTER: F2 properly triggers onStartEdit for file rename This was a classic "half-baked" feature that frustrated users. F2 is a standard Windows/Linux file manager shortcut. Note: Could not locate "Straight button" mentioned in issue. Searched all UI controls, sorting, layout functions - not found. May have been removed or misnamed. The core F2 rename issue is now resolved. --- src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx b/src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx index d6384c10..8e9e1de8 100644 --- a/src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx +++ b/src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx @@ -913,9 +913,9 @@ export function FileManagerGrid({ } break; case "F2": - if (selectedFiles.length === 1) { - // 触发重命名 - console.log("Rename file:", selectedFiles[0]); + if (selectedFiles.length === 1 && onStartEdit) { + event.preventDefault(); + onStartEdit(selectedFiles[0]); } break; case "F5":