From 12c99471308d95a7d1832b23d530e9d3d2b15f1c Mon Sep 17 00:00:00 2001 From: ssdfasd <2156608475@qq.com> Date: Wed, 18 Mar 2026 20:22:39 +0800 Subject: [PATCH] fix: only show docs with depth < 3 in tree, hide nested leaf docs --- src/components/ApiDocViewer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ApiDocViewer.tsx b/src/components/ApiDocViewer.tsx index 73b7940..77379e6 100644 --- a/src/components/ApiDocViewer.tsx +++ b/src/components/ApiDocViewer.tsx @@ -71,7 +71,9 @@ export const ApiDocViewer = ({ onDocsPathChange, showAddModal, onCloseAddModal } setExternalDocs(docs) - const fileList = docs.map(d => d.relativePath) + const fileList = docs + .filter(doc => doc.relativePath.split('/').length < 3) + .map(d => d.relativePath) const tree = buildFileTree(fileList, '/') setFileTree(tree)