mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
fix(skill): remove non-functional copy menu item from file tree context menu
This commit is contained in:
@ -9,7 +9,6 @@ import {
|
||||
RiDeleteBinLine,
|
||||
RiEdit2Line,
|
||||
RiFileAddLine,
|
||||
RiFileCopyLine,
|
||||
RiFolderAddLine,
|
||||
RiFolderUploadLine,
|
||||
RiScissorsLine,
|
||||
@ -31,7 +30,6 @@ export const MENU_CONTAINER_STYLES = [
|
||||
'bg-components-panel-bg-blur p-1 shadow-lg backdrop-blur-[5px]',
|
||||
] as const
|
||||
|
||||
const KBD_COPY = ['ctrl', 'c'] as const
|
||||
const KBD_CUT = ['ctrl', 'x'] as const
|
||||
const KBD_PASTE = ['ctrl', 'v'] as const
|
||||
|
||||
@ -78,14 +76,6 @@ const NodeMenu: FC<NodeMenuProps> = ({
|
||||
|
||||
const currentNodeId = node?.data.id ?? nodeId
|
||||
|
||||
const handleCopy = useCallback(() => {
|
||||
const ids = selectedNodeIds.size > 0 ? [...selectedNodeIds] : (currentNodeId ? [currentNodeId] : [])
|
||||
if (ids.length > 0) {
|
||||
storeApi.getState().copyNodes(ids)
|
||||
onClose()
|
||||
}
|
||||
}, [currentNodeId, onClose, selectedNodeIds, storeApi])
|
||||
|
||||
const handleCut = useCallback(() => {
|
||||
const ids = selectedNodeIds.size > 0 ? [...selectedNodeIds] : (currentNodeId ? [currentNodeId] : [])
|
||||
if (ids.length > 0) {
|
||||
@ -182,13 +172,6 @@ const NodeMenu: FC<NodeMenuProps> = ({
|
||||
onClick={handleCut}
|
||||
disabled={isLoading}
|
||||
/>
|
||||
<MenuItem
|
||||
icon={RiFileCopyLine}
|
||||
label={t('skillSidebar.menu.copy')}
|
||||
kbd={KBD_COPY}
|
||||
onClick={handleCopy}
|
||||
disabled={isLoading}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user