refactor: improve heading revelation logic

Rewrite `addRevealedClasses` to use a two-pass approach that correctly
cascades revealed status from child headings to parent headings. This
ensures that if a sub-heading is revealed, its parent headings are
also treated as revealed, maintaining proper visibility hierarchy.
This commit is contained in:
2026-07-07 12:56:28 +08:00
parent ced9a4f8f2
commit 574d17f201
4 changed files with 83 additions and 43 deletions
-3
View File
@@ -61,9 +61,6 @@ const SidebarContent: Component<SidebarContentProps> = (props) => {
if (node.children?.some((child) => !isHeadingHidden(child))) return false;
return true;
};
createEffect(() => {
console.log(currentFileHeadings(), revealedHeadings());
});
return (
<div class="flex flex-col h-full">