From 8c3a27c7f5b9265fec569815ec12cd70daac965f Mon Sep 17 00:00:00 2001 From: Daryl Lim <5508348+daryllimyt@users.noreply.github.com> Date: Sat, 25 Jan 2025 18:29:50 +0000 Subject: [PATCH] fix(ui): Fix overflow and scroll behavior in events sidebar (#798) --- .../events/events-selected-action.tsx | 101 +++++++-------- .../workbench/events/events-sidebar.tsx | 115 +++++++++++------- .../src/components/workbench/workbench.tsx | 6 +- 3 files changed, 113 insertions(+), 109 deletions(-) diff --git a/frontend/src/components/workbench/events/events-selected-action.tsx b/frontend/src/components/workbench/events/events-selected-action.tsx index 4617b349d..9c1b0dbe5 100644 --- a/frontend/src/components/workbench/events/events-selected-action.tsx +++ b/frontend/src/components/workbench/events/events-selected-action.tsx @@ -55,14 +55,16 @@ export function ActionEvent({ ) } return ( - +
+ +
) } export function ActionEventDetails({ @@ -125,18 +127,12 @@ export function ActionEventDetails({ } const actionEvent = actionEventsForRef[0] return ( -
-
- -
-
+ ) } @@ -194,10 +190,12 @@ export function JsonViewWithControls({ ? flattenObject(src as Record) : src - console.log(flattenedSrc) - console.log(src) + const tabItems = [ + { value: "flat", label: "Flat", src: flattenedSrc }, + { value: "nested", label: "Nested", src: src }, + ] return ( -
+
{title} @@ -215,44 +213,29 @@ export function JsonViewWithControls({
- - Flat - - - Nested - + {tabItems.map(({ value, label }) => ( + + {label} + + ))} - - { - console.log("COPY", node) - return node - }} - /> - - - - + {tabItems.map(({ value, src: source }) => ( + + + + ))}
) diff --git a/frontend/src/components/workbench/events/events-sidebar.tsx b/frontend/src/components/workbench/events/events-sidebar.tsx index e4b6886fe..4102609ed 100644 --- a/frontend/src/components/workbench/events/events-sidebar.tsx +++ b/frontend/src/components/workbench/events/events-sidebar.tsx @@ -11,6 +11,7 @@ import { useCompactWorkflowExecution, useManualWorkflowExecution, } from "@/lib/hooks" +import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area" import { Separator } from "@/components/ui/separator" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { CenteredSpinner } from "@/components/loading/spinner" @@ -123,54 +124,76 @@ function WorkbenchSidebarEventsList({ /> ) + const tabItems = [ + { + value: "workflow-events", + label: "Events", + icon: CalendarSearchIcon, + content: ( + <> + + + + ), + }, + { + value: "action-input", + label: "Input", + icon: FileInputIcon, + content: , + }, + { + value: "action-result", + label: "Result", + icon: ShapesIcon, + content: , + }, + ] return ( - { - if (sidebarRef.current?.setActiveTab) { - sidebarRef.current.setActiveTab(value as EventsSidebarTabs) - } - }} - className="flex size-full flex-col" - > -
-
- - - - Events - - - - Input - - - - Result - - +
+ { + if (sidebarRef.current?.setActiveTab) { + sidebarRef.current.setActiveTab(value as EventsSidebarTabs) + } + }} + className="flex size-full flex-col" + > +
+ + + {tabItems.map((tab) => ( + + + {tab.label} + + ))} + + +
- - - - - - - - - - -
- + +
+ {tabItems.map((tab) => ( + + {tab.content} + + ))} +
+ + +
+ +
) } diff --git a/frontend/src/components/workbench/workbench.tsx b/frontend/src/components/workbench/workbench.tsx index 3a151d26b..6d196c692 100644 --- a/frontend/src/components/workbench/workbench.tsx +++ b/frontend/src/components/workbench/workbench.tsx @@ -48,11 +48,9 @@ export function Workbench({ defaultLayout = [0, 68, 32] }: WorkbenchProps) { collapsible={true} minSize={20} maxSize={40} - className="flex h-full flex-col" + className="h-full" > -
- -
+