-
+ {/if}
{:else}
@@ -119,6 +132,6 @@
{/each}
{/snippet}
-
+
{@render nodes(tree)}
diff --git a/web/src/lib/components/repo/DiffView.svelte b/web/src/lib/components/repo/DiffView.svelte
index f9a228e7b..7711307e4 100644
--- a/web/src/lib/components/repo/DiffView.svelte
+++ b/web/src/lib/components/repo/DiffView.svelte
@@ -13,7 +13,7 @@
import UnfoldVertical from "$icon/unfold-vertical";
import { prefersReducedMotion } from "svelte/motion";
import { RAIL_DURATION, railEasing } from "$lib/motion/spring";
- import { revealWidth } from "$lib/motion/revealWidth";
+ import { revealWidth } from "$lib/motion/reveal";
import Button, { buttonIcon } from "$lib/components/ui/Button.svelte";
import EmptyState from "$lib/components/ui/EmptyState.svelte";
import Segment from "$lib/components/ui/Segment.svelte";
diff --git a/web/src/lib/motion/reveal.ts b/web/src/lib/motion/reveal.ts
new file mode 100644
index 000000000..af268d5ce
--- /dev/null
+++ b/web/src/lib/motion/reveal.ts
@@ -0,0 +1,30 @@
+import type { TransitionConfig } from "svelte/transition";
+
+interface RevealParams {
+ duration: number;
+ easing: (t: number) => number;
+}
+
+export const revealWidth = (
+ node: Element,
+ { duration, easing }: RevealParams
+): TransitionConfig => {
+ const width = node.getBoundingClientRect().width;
+ return {
+ duration,
+ easing,
+ css: (t) => `overflow: clip; width: ${t * width}px; min-width: 0`
+ };
+};
+
+export const revealHeight = (
+ node: Element,
+ { duration, easing }: RevealParams
+): TransitionConfig => {
+ const height = node.getBoundingClientRect().height;
+ return {
+ duration,
+ easing,
+ css: (t) => `overflow: clip; height: ${t * height}px; min-height: 0; opacity: ${t}`
+ };
+};
diff --git a/web/src/lib/motion/revealWidth.ts b/web/src/lib/motion/revealWidth.ts
deleted file mode 100644
index ed617da43..000000000
--- a/web/src/lib/motion/revealWidth.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import type { TransitionConfig } from "svelte/transition";
-
-export const revealWidth = (
- node: Element,
- { duration, easing }: { duration: number; easing: (t: number) => number }
-): TransitionConfig => {
- const width = node.getBoundingClientRect().width;
- return {
- duration,
- easing,
- css: (t) => `overflow: clip; width: ${t * width}px; min-width: 0`
- };
-};
diff --git a/web/src/routes/[handle]/[repo]/pulls/[rkey]/[version]/[[range]]/PullViewPage.svelte b/web/src/routes/[handle]/[repo]/pulls/[rkey]/[version]/[[range]]/PullViewPage.svelte
index 749fb5988..1bd1c7f7b 100644
--- a/web/src/routes/[handle]/[repo]/pulls/[rkey]/[version]/[[range]]/PullViewPage.svelte
+++ b/web/src/routes/[handle]/[repo]/pulls/[rkey]/[version]/[[range]]/PullViewPage.svelte
@@ -83,7 +83,7 @@
RAIL_EASING,
railEasing
} from "$lib/motion/spring";
- import { revealWidth } from "$lib/motion/revealWidth";
+ import { revealWidth } from "$lib/motion/reveal";
import { plural } from "$lib/format";
type PullViewData = PageData &