From 1eb9ad5a4c139e077d58507ed1044d44dd45657d Mon Sep 17 00:00:00 2001 From: Tim Sinaeve Date: Sun, 16 Nov 2025 11:09:21 +0100 Subject: [PATCH] Add delete button to document tree items --- components/PromptTreeItem.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/components/PromptTreeItem.tsx b/components/PromptTreeItem.tsx index 7b8af3f..8b772ef 100644 --- a/components/PromptTreeItem.tsx +++ b/components/PromptTreeItem.tsx @@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect, useLayoutEffect, useCallback } from // Fix: Correctly import the DocumentOrFolder type. import type { DocumentOrFolder, DraggedNodeTransfer } from '../types'; import IconButton from './IconButton'; -import { FileIcon, FolderIcon, FolderOpenIcon, ChevronRightIcon, ChevronDownIcon, CopyIcon, ArrowUpIcon, ArrowDownIcon, CodeIcon, LockClosedIcon, LockOpenIcon } from './Icons'; +import { FileIcon, FolderIcon, FolderOpenIcon, ChevronRightIcon, ChevronDownIcon, CopyIcon, ArrowUpIcon, ArrowDownIcon, CodeIcon, LockClosedIcon, LockOpenIcon, TrashIcon } from './Icons'; import Tooltip from './Tooltip'; import EmojiPickerOverlay from './EmojiPickerOverlay'; @@ -601,6 +601,17 @@ const DocumentTreeItem: React.FC = (props) => { )} + { + e.stopPropagation(); + onDeleteNode(node.id, e.shiftKey); + }} + size="xs" + variant="destructive" + > + + )}