diff --git a/src/lib/components/ui/PaneStack.svelte b/src/lib/components/ui/PaneStack.svelte index 0fb138e5..0667d216 100644 --- a/src/lib/components/ui/PaneStack.svelte +++ b/src/lib/components/ui/PaneStack.svelte @@ -48,6 +48,21 @@ function isPopping(index: number): boolean { return isAnimating && animationDirection === 'pop' && index === panes.length - 1 } + + // Determine if a pane is becoming active (the one behind a popping pane) + function isBecomingActive(index: number): boolean { + return isAnimating && animationDirection === 'pop' && index === panes.length - 2 + } + + // Determine the visual depth of a pane (0 = active, 1 = one behind, 2+ = hidden) + function getDepth(index: number): number { + return panes.length - 1 - index + } + + // Panes more than 1 level deep should be hidden + function isHidden(index: number): boolean { + return getDepth(index) > 1 + }