fix: only show docs with depth < 3 in tree, hide nested leaf docs

This commit is contained in:
2026-03-18 20:22:39 +08:00
parent 3e7ae05cfe
commit 12c9947130

View File

@@ -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)