Merge pull request #27384 from overleaf/dp-drag-file-tree-outline

Allow file tree and outline to be expandable and collapsible by dragging

GitOrigin-RevId: e25f0d263b1446537cdb42ef52fe1c486e855773
This commit is contained in:
David
2025-08-06 08:05:09 +00:00
committed by Copybot
parent 203e2e914b
commit 075e18c7c8
5 changed files with 79 additions and 14 deletions
@@ -4,11 +4,18 @@ import { useRef } from 'react'
import { ImperativePanelHandle } from 'react-resizable-panels'
export const useOutlinePane = () => {
const { canShowOutline, outlineExpanded } = useOutlineContext()
const { canShowOutline, outlineExpanded, expandOutline, collapseOutline } =
useOutlineContext()
const outlinePanelRef = useRef<ImperativePanelHandle>(null)
const outlineEnabled = canShowOutline && outlineExpanded
useCollapsiblePanel(outlineEnabled, outlinePanelRef)
return { outlineEnabled, outlinePanelRef }
return {
outlineEnabled,
canShowOutline,
outlinePanelRef,
expandOutline,
collapseOutline,
}
}