Files
ComfyUI_frontend/src/constants/coreMenuCommands.ts
Dante f4ca285d07 feat: add Copy, Paste, Select All commands to Edit menu (#8954)
## Summary

- Add Copy, Paste, and Select All commands to the Edit menu for
mobile/touch users and accessibility
- Menu-based copy uses LiteGraph internal clipboard; existing Ctrl+C/V
behavior is unchanged

## Changes

- `useCoreCommands.ts`: Register three new commands (`CopySelected`,
`PasteFromClipboard`, `SelectAll`)
- `coreMenuCommands.ts`: Add menu entries under Edit (between Undo/Redo
and Clear Workflow)
- `useCoreCommands.test.ts`: Add unit tests for the new commands

### AS IS
<img width="260" height="176" alt="스크린샷 2026-02-18 오후 5 44 14"
src="https://github.com/user-attachments/assets/8c9c86e1-55cc-411b-9d42-429001e04630"
/>


### TO BE
<img width="516" height="497" alt="스크린샷 2026-02-19 오후 5 07 28"
src="https://github.com/user-attachments/assets/a2047541-582f-4520-a08f-98c6e532d29f"
/>


## Test plan

- [x] Verify Copy/Paste/Select All appear in Edit menu
- [x] Select nodes → Edit > Copy → Edit > Paste → nodes duplicated
- [x] Edit > Select All → all canvas items selected
- [x] Copy with no selection → no-op (no error)
- [x] Existing Ctrl+C/V keyboard shortcuts still work

Fixes #2892

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8954-feat-add-Copy-Paste-Select-All-commands-to-Edit-menu-30b6d73d365081ec9270ed2a562eaf0b)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 02:34:45 -08:00

51 lines
1.1 KiB
TypeScript

import { isCloud } from '@/platform/distribution/types'
export const CORE_MENU_COMMANDS = [
[[], ['Comfy.NewBlankWorkflow']],
[[], []], // Separator after New
[['File'], ['Comfy.OpenWorkflow']],
[
['File'],
[
'Comfy.SaveWorkflow',
'Comfy.SaveWorkflowAs',
'Comfy.ExportWorkflow',
'Comfy.ExportWorkflowAPI'
]
],
[['Edit'], ['Comfy.Undo', 'Comfy.Redo']],
[
['Edit'],
[
'Comfy.Canvas.CopySelected',
'Comfy.Canvas.PasteFromClipboard',
'Comfy.Canvas.SelectAll'
]
],
[['Edit'], ['Comfy.ClearWorkflow']],
[['Edit'], ['Comfy.OpenClipspace']],
[
['Edit'],
[
'Comfy.RefreshNodeDefinitions',
...(isCloud
? []
: [
'Comfy.Memory.UnloadModels',
'Comfy.Memory.UnloadModelsAndExecutionCache'
])
]
],
[['View'], []],
[
['Help'],
[
'Comfy.Help.OpenComfyUIIssues',
'Comfy.Help.OpenComfyUIDocs',
'Comfy.Help.OpenComfyOrgDiscord',
'Comfy.Help.OpenComfyUIForum'
]
],
[['Help'], ['Comfy.Help.AboutComfyUI', 'Comfy.ContactSupport']]
]