From bf4a03d3839ca18e8b52eb7d16dd2e1b9532eee9 Mon Sep 17 00:00:00 2001 From: Francesco Sansalvadore Date: Fri, 29 Aug 2025 09:22:38 +0200 Subject: [PATCH] rename filename with double-click or Enter --- .../StorageExplorer/FileExplorerRow.tsx | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerRow.tsx b/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerRow.tsx index d3998ae9591..50d90aad0c9 100644 --- a/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerRow.tsx +++ b/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerRow.tsx @@ -167,6 +167,12 @@ const FileExplorerRow: ItemRenderer = ({ setSelectedFilePreview(undefined) } + const onDoubleClickName = () => { + if (canUpdateFiles && item.type !== STORAGE_ROW_TYPES.BUCKET) { + setSelectedItemToRename(itemWithColumnIndex) + } + } + // Drag and drop handlers const onDragStart = (event: React.DragEvent) => { if (item.type === STORAGE_ROW_TYPES.FILE && canUpdateFiles) { @@ -483,7 +489,19 @@ const FileExplorerRow: ItemRenderer = ({ }} /> -

+

{ + if (event.key === 'Enter' || event.key === ' ') { + event.preventDefault() + onDoubleClickName() + } + }} + tabIndex={canUpdateFiles && item.type !== STORAGE_ROW_TYPES.BUCKET ? 0 : -1} + > {item.name}

{item.isCorrupted && (