From 65d14b86109e50b78ee1a1a8a8c3a4924efaecca Mon Sep 17 00:00:00 2001
From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com>
Date: Fri, 14 Aug 2026 15:02:55 +0800
Subject: [PATCH] update: dir tree
---
.../components/platform/TreeContextMenu.tsx | 45 +++++++++++++------
frontend/app/context/AuthContext.tsx | 2 +
.../app/features/platform/ScriptsPage.tsx | 2 +
.../platform/hooks/useEditSessionLifecycle.ts | 8 ----
.../platform/state/scriptWorkspaceStore.ts | 23 ++++++++++
frontend/app/services/api.ts | 14 ++++++
6 files changed, 73 insertions(+), 21 deletions(-)
diff --git a/frontend/app/components/platform/TreeContextMenu.tsx b/frontend/app/components/platform/TreeContextMenu.tsx
index ca99034..0e1a2ca 100644
--- a/frontend/app/components/platform/TreeContextMenu.tsx
+++ b/frontend/app/components/platform/TreeContextMenu.tsx
@@ -19,6 +19,7 @@ type TreeContextMenuProps = {
onChooseUpload: (parentPath: string) => void;
onRemoveDirectory: (path: string) => void;
onCopyResourcePath?: (jupyterPath: string) => void;
+ onRemoveResource?: (resourceId: string) => void;
onClose: () => void;
};
@@ -32,6 +33,7 @@ export function TreeContextMenu({
onChooseUpload,
onRemoveDirectory,
onCopyResourcePath,
+ onRemoveResource,
onClose,
}: TreeContextMenuProps) {
if (!contextMenu) return null;
@@ -55,19 +57,36 @@ export function TreeContextMenu({
{contextMenu.kind === "file" && contextMenu.script ? (
<>
{isDataResource ? (
-
+ <>
+
+ {onRemoveResource && (
+
+ )}
+ >
) : (
<>