feat(registry): renaming workspace and folders shortcut (#1912)

This commit is contained in:
Waleed
2025-11-11 20:18:58 -08:00
committed by GitHub
parent d11ee04432
commit 81411c73b7
2 changed files with 29 additions and 1 deletions

View File

@@ -131,6 +131,18 @@ export function FolderItem({ folder, level, hoverHandlers }: FolderItemProps) {
itemId: folder.id,
})
/**
* Handle double-click on folder name to enter rename mode
*/
const handleDoubleClick = useCallback(
(e: React.MouseEvent) => {
e.preventDefault()
e.stopPropagation()
handleStartEdit()
},
[handleStartEdit]
)
/**
* Handle click - toggles folder expansion
*
@@ -223,7 +235,10 @@ export function FolderItem({ folder, level, hoverHandlers }: FolderItemProps) {
spellCheck='false'
/>
) : (
<span className='truncate font-medium text-[#AEAEAE] dark:text-[#AEAEAE]'>
<span
className='truncate font-medium text-[#AEAEAE] dark:text-[#AEAEAE]'
onDoubleClick={handleDoubleClick}
>
{folder.name}
</span>
)}

View File

@@ -188,6 +188,18 @@ export function WorkflowItem({ workflow, active, level, onWorkflowClick }: Workf
itemId: workflow.id,
})
/**
* Handle double-click on workflow name to enter rename mode
*/
const handleDoubleClick = useCallback(
(e: React.MouseEvent) => {
e.preventDefault()
e.stopPropagation()
handleStartEdit()
},
[handleStartEdit]
)
/**
* Handle click - manages workflow selection with shift-key and cmd/ctrl-key support
*
@@ -271,6 +283,7 @@ export function WorkflowItem({ workflow, active, level, onWorkflowClick }: Workf
? 'text-[#E6E6E6] dark:text-[#E6E6E6]'
: 'text-[#AEAEAE] group-hover:text-[#E6E6E6] dark:text-[#AEAEAE] dark:group-hover:text-[#E6E6E6]'
)}
onDoubleClick={handleDoubleClick}
>
{workflow.name}
</div>