Skip to content

Commit e6912ce

Browse files
deepshekhardassamejr
andcommitted
fix(webapp): animated resizable panel pattern for route components
Squashed rebase of pr-3319-fix onto official/main. Co-authored-by: James Ritchie <james@trigger.dev>
1 parent e5fca6b commit e6912ce

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@trigger.dev/core": patch
3+
"@trigger.dev/sdk": patch
4+
---
5+
6+
Feat(webapp): animated resizable panel
7+
8+
Adds animated open/close transitions to Resizable panels using react-window-splitter built-in animation hooks. Includes new exports: RESIZABLE_PANEL_ANIMATION, collapsibleHandleClassName(), and useFrozenValue(). Converts inspector/detail side panels from conditionally-mounted to always-mounted collapsible panels across multiple routes (batches, runs, schedules, deployments, logs, waitpoints, bulk-actions).

apps/webapp/app/components/primitives/Resizable.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import React, { useRef } from "react";
4-
import { PanelGroup, Panel, PanelResizer } from "@window-splitter/react";
4+
import { PanelGroup, Panel, PanelResizer } from "react-window-splitter";
55
import { cn } from "~/utils/cn";
66

77
const ResizablePanelGroup = ({ className, ...props }: React.ComponentProps<typeof PanelGroup>) => (
@@ -69,14 +69,10 @@ const ResizableHandle = ({
6969
</PanelResizer>
7070
);
7171

72-
// react-window-splitter drives the collapse animation through @react-spring/rafz,
73-
// which has timing/interaction issues with Firefox that produce visual glitches
74-
// (alternating frames, panels stuck at min, panelHasSpace invariant violations).
75-
// Disable the animation on Firefox; it works correctly in Chromium and Safari.
76-
const RESIZABLE_PANEL_ANIMATION =
77-
typeof navigator !== "undefined" && /firefox/i.test(navigator.userAgent)
78-
? undefined
79-
: ({ easing: "ease-in-out", duration: 300 } as const);
72+
const RESIZABLE_PANEL_ANIMATION = {
73+
easing: "ease-in-out" as const,
74+
duration: 200,
75+
};
8076

8177
const COLLAPSIBLE_HANDLE_CLASSNAME = "transition-opacity duration-200";
8278

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.logs/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ function LogsList({
413413
const frozenLogId = useFrozenValue(selectedLogId);
414414
const frozenLog = useFrozenValue(selectedLog);
415415
const displayLogId = selectedLogId ?? frozenLogId;
416-
const displayLog = selectedLog ?? frozenLog ?? undefined;
416+
const displayLog = selectedLog ?? frozenLog;
417417

418418
const updateUrlWithLog = useCallback((logId: string | undefined) => {
419419
const url = new URL(window.location.href);

0 commit comments

Comments
 (0)