mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
feat(registry): renaming workspace and folders shortcut (#1912)
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user