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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user