From 171317e55868e0e575159fcfe681eb6b79552e7a Mon Sep 17 00:00:00 2001 From: cuisailong Date: Mon, 18 Aug 2025 17:19:32 +0800 Subject: [PATCH] fix(UI):Fixed bugs related to tree component folder expansion and route jump --- .../CodeView/BlobView/CodeContent.tsx | 8 +- .../CodeView/TableWithLoading/index.tsx | 2 +- .../CodeView/TreeView/BreadCrumb.tsx | 4 +- .../CodeView/TreeView/CustomLabel.tsx | 36 + .../CodeView/TreeView/CustomTreeItem.tsx | 97 +++ .../components/CodeView/TreeView/RepoTree.tsx | 695 ++---------------- .../components/CodeView/TreeView/TreeUtils.ts | 313 ++++++++ .../CodeView/TreeView/codeTreeAtom.ts | 7 + .../web/pages/[org]/code/blob/[...path].tsx | 41 +- .../pages/[org]/code/tree/[...path]/index.tsx | 62 +- 10 files changed, 581 insertions(+), 684 deletions(-) create mode 100644 moon/apps/web/components/CodeView/TreeView/CustomLabel.tsx create mode 100644 moon/apps/web/components/CodeView/TreeView/CustomTreeItem.tsx create mode 100644 moon/apps/web/components/CodeView/TreeView/TreeUtils.ts create mode 100644 moon/apps/web/components/CodeView/TreeView/codeTreeAtom.ts diff --git a/moon/apps/web/components/CodeView/BlobView/CodeContent.tsx b/moon/apps/web/components/CodeView/BlobView/CodeContent.tsx index 7467270a9..62bd46bea 100644 --- a/moon/apps/web/components/CodeView/BlobView/CodeContent.tsx +++ b/moon/apps/web/components/CodeView/BlobView/CodeContent.tsx @@ -202,9 +202,11 @@ const CodeContent = ({ fileContent, path }: { fileContent: string; path?: string backgroundColor: '#fff', padding: '16px', paddingTop: '30px', - userSelect: 'text' + userSelect: 'text', + whiteSpace: 'pre-wrap', + wordBreak: 'break-all' }} - className='overflow-x-auto whitespace-pre rounded-lg p-4 text-sm' + className='overflow-x-auto rounded-lg p-4 text-sm' > {/*