({
node,
depth,
folder,
vaultSettings,
isFolderActive,
collapsed,
toggleCollapse,
setView,
onContextMenu,
showNotes,
selectedPath,
vaultRoot,
onSelectNote,
onOpenAsset,
onNoteContextMenu,
onAssetContextMenu,
sortComparator,
onDropOnFolder,
selectedKeys,
onSelectItem,
dragPayloadForItem,
idxCounter,
vimCursor,
sidebarFocused,
groupByKind,
showSidebarChevrons,
}: { node: TreeNode; depth: number } & TreeRenderProps)
| 4300 | } |
| 4301 | |
| 4302 | function SubTree({ |
| 4303 | node, |
| 4304 | depth, |
| 4305 | folder, |
| 4306 | vaultSettings, |
| 4307 | isFolderActive, |
| 4308 | collapsed, |
| 4309 | toggleCollapse, |
| 4310 | setView, |
| 4311 | onContextMenu, |
| 4312 | showNotes, |
| 4313 | selectedPath, |
| 4314 | vaultRoot, |
| 4315 | onSelectNote, |
| 4316 | onOpenAsset, |
| 4317 | onNoteContextMenu, |
| 4318 | onAssetContextMenu, |
| 4319 | sortComparator, |
| 4320 | onDropOnFolder, |
| 4321 | selectedKeys, |
| 4322 | onSelectItem, |
| 4323 | dragPayloadForItem, |
| 4324 | idxCounter, |
| 4325 | vimCursor, |
| 4326 | sidebarFocused, |
| 4327 | groupByKind, |
| 4328 | showSidebarChevrons, |
| 4329 | }: { node: TreeNode; depth: number } & TreeRenderProps): JSX.Element { |
| 4330 | const key = `${folder}:${node.subpath}`; |
| 4331 | const isCollapsed = collapsed.has(key); |
| 4332 | const iconOption = resolveFolderIconOption( |
| 4333 | folder, |
| 4334 | node.subpath, |
| 4335 | vaultSettings.folderIcons, |
| 4336 | ); |
| 4337 | const folderColorClass = |
| 4338 | resolveFolderColorGlyphClass(folder, node.subpath, vaultSettings.folderColors) ?? |
| 4339 | undefined; |
| 4340 | // A `<Name>.base` folder is a database: render it with a database icon and a |
| 4341 | // title without the suffix; clicking the row opens the grid, while the |
| 4342 | // chevron still expands to reveal its record-page notes. (#185) |
| 4343 | const isDatabase = isFormDirName(node.name); |
| 4344 | const entries = useMemo( |
| 4345 | () => getTreeRenderEntries(node, showNotes, sortComparator, groupByKind), |
| 4346 | [node, showNotes, sortComparator, groupByKind], |
| 4347 | ); |
| 4348 | const progressiveEligible = shouldProgressivelyRenderEntries(entries); |
| 4349 | const progressive = progressiveEligible && !sidebarFocused; |
| 4350 | const [visibleEntryLimit, progressiveSentinelRef] = useProgressiveEntryLimit( |
| 4351 | entries.length, |
| 4352 | progressive, |
| 4353 | ); |
| 4354 | const selectedEntryIndex = useMemo( |
| 4355 | () => |
| 4356 | selectedPath |
| 4357 | ? entries.findIndex((entry) => treeRenderEntryPath(entry) === selectedPath) |
| 4358 | : -1, |
| 4359 | [entries, selectedPath], |
nothing calls this directly
no test coverage detected