Skip to content

Commit 81411c7

Browse files
authored
feat(registry): renaming workspace and folders shortcut (#1912)
1 parent d11ee04 commit 81411c7

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components-new/workflow-list/components/folder-item/folder-item.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@ export function FolderItem({ folder, level, hoverHandlers }: FolderItemProps) {
131131
itemId: folder.id,
132132
})
133133

134+
/**
135+
* Handle double-click on folder name to enter rename mode
136+
*/
137+
const handleDoubleClick = useCallback(
138+
(e: React.MouseEvent) => {
139+
e.preventDefault()
140+
e.stopPropagation()
141+
handleStartEdit()
142+
},
143+
[handleStartEdit]
144+
)
145+
134146
/**
135147
* Handle click - toggles folder expansion
136148
*
@@ -223,7 +235,10 @@ export function FolderItem({ folder, level, hoverHandlers }: FolderItemProps) {
223235
spellCheck='false'
224236
/>
225237
) : (
226-
<span className='truncate font-medium text-[#AEAEAE] dark:text-[#AEAEAE]'>
238+
<span
239+
className='truncate font-medium text-[#AEAEAE] dark:text-[#AEAEAE]'
240+
onDoubleClick={handleDoubleClick}
241+
>
227242
{folder.name}
228243
</span>
229244
)}

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components-new/workflow-list/components/workflow-item/workflow-item.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,18 @@ export function WorkflowItem({ workflow, active, level, onWorkflowClick }: Workf
188188
itemId: workflow.id,
189189
})
190190

191+
/**
192+
* Handle double-click on workflow name to enter rename mode
193+
*/
194+
const handleDoubleClick = useCallback(
195+
(e: React.MouseEvent) => {
196+
e.preventDefault()
197+
e.stopPropagation()
198+
handleStartEdit()
199+
},
200+
[handleStartEdit]
201+
)
202+
191203
/**
192204
* Handle click - manages workflow selection with shift-key and cmd/ctrl-key support
193205
*
@@ -271,6 +283,7 @@ export function WorkflowItem({ workflow, active, level, onWorkflowClick }: Workf
271283
? 'text-[#E6E6E6] dark:text-[#E6E6E6]'
272284
: 'text-[#AEAEAE] group-hover:text-[#E6E6E6] dark:text-[#AEAEAE] dark:group-hover:text-[#E6E6E6]'
273285
)}
286+
onDoubleClick={handleDoubleClick}
274287
>
275288
{workflow.name}
276289
</div>

0 commit comments

Comments
 (0)