Fix F2 rename functionality - eliminate half-baked feature

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.
This commit is contained in:
ZacharyZcR
2025-09-21 01:30:30 +08:00
parent 2019b81254
commit 00b620cbf7

View File

@@ -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":