From fd48d178c3cfb4fc5e4e1aa9f05d70e8b5b73dbb Mon Sep 17 00:00:00 2001 From: Yaroslav Boiko Date: Fri, 17 Jan 2025 11:34:13 +0100 Subject: [PATCH] [OPIK-706] simplify home page (#1063) Co-authored-by: Yaroslav Boiko --- .../pages/HomePage/EvaluationSection.tsx | 37 ++---- .../pages/HomePage/GetStartedSection.tsx | 116 +++++++----------- .../components/pages/HomePage/HomePage.tsx | 1 - .../pages/HomePage/ObservabilitySection.tsx | 37 ++---- 4 files changed, 68 insertions(+), 123 deletions(-) diff --git a/apps/opik-frontend/src/components/pages/HomePage/EvaluationSection.tsx b/apps/opik-frontend/src/components/pages/HomePage/EvaluationSection.tsx index e7a0933da4..2d66e7cf6a 100644 --- a/apps/opik-frontend/src/components/pages/HomePage/EvaluationSection.tsx +++ b/apps/opik-frontend/src/components/pages/HomePage/EvaluationSection.tsx @@ -3,7 +3,7 @@ import { keepPreviousData } from "@tanstack/react-query"; import useLocalStorageState from "use-local-storage-state"; import { ColumnPinningState } from "@tanstack/react-table"; import { Link } from "@tanstack/react-router"; -import { Book } from "lucide-react"; +import { ArrowRight } from "lucide-react"; import get from "lodash/get"; import DataTable from "@/components/shared/DataTable/DataTable"; @@ -18,7 +18,6 @@ import { COLUMN_NAME_ID, COLUMN_SELECT_ID, COLUMN_TYPE } from "@/types/shared"; import { RESOURCE_TYPE } from "@/components/shared/ResourceLink/ResourceLink"; import { Experiment } from "@/types/datasets"; import { convertColumnDataToColumn } from "@/lib/table"; -import { buildDocsUrl } from "@/lib/utils"; import { formatDate } from "@/lib/date"; const COLUMNS_WIDTH_KEY = "home-experiments-columns-width"; @@ -138,29 +137,10 @@ const EvaluationSection: React.FunctionComponent = () => { } return ( -
-
-
-

- Evaluation -

-
-
- - - - -
-
+
+

+ Evaluation +

{ } /> +
+ + + +
{ const workspaceName = useAppStore((state) => state.activeWorkspaceName); @@ -19,23 +15,19 @@ const GetStartedSection = () => { defaultValue: false, }, ); + const [isNewExperimentDialogOpened, setIsNewExperimentDialogOpened] = + useState(false); - const { data: project, isPending } = useDemoProject( - { workspaceName }, - { - enabled: !hide, - placeholderData: keepPreviousData, - }, - ); + const openNewExperimentDialog = () => setIsNewExperimentDialogOpened(true); - if (hide || isPending) return null; + if (hide) return null; return (

- Get started with Opik + Get started

@@ -49,62 +41,42 @@ const GetStartedSection = () => {
- {project && ( - - - Explore our demo project - - Browse our curated examples to draw inspiration for your own LLM - projects. - - - - - - )} - - - Log a trace - - The first step in integrating Opik with your codebase is to track - your LLM calls. - - - - - - Run an experiment - - An experiment is a single evaluation of your LLM application. - - - + +
+ +
+
Log a trace
+
+
+
+ +
+
Run an experiment
+
+ +
+ +
+
Try out playground
+ + +
-
); }; diff --git a/apps/opik-frontend/src/components/pages/HomePage/HomePage.tsx b/apps/opik-frontend/src/components/pages/HomePage/HomePage.tsx index 5db0bfb617..1e50be86c8 100644 --- a/apps/opik-frontend/src/components/pages/HomePage/HomePage.tsx +++ b/apps/opik-frontend/src/components/pages/HomePage/HomePage.tsx @@ -17,7 +17,6 @@ const HomePage = () => {
-
); diff --git a/apps/opik-frontend/src/components/pages/HomePage/ObservabilitySection.tsx b/apps/opik-frontend/src/components/pages/HomePage/ObservabilitySection.tsx index 610d75daef..90047045a0 100644 --- a/apps/opik-frontend/src/components/pages/HomePage/ObservabilitySection.tsx +++ b/apps/opik-frontend/src/components/pages/HomePage/ObservabilitySection.tsx @@ -3,7 +3,7 @@ import { keepPreviousData } from "@tanstack/react-query"; import useLocalStorageState from "use-local-storage-state"; import { ColumnPinningState } from "@tanstack/react-table"; import { Link } from "@tanstack/react-router"; -import { Book } from "lucide-react"; +import { ArrowRight } from "lucide-react"; import DataTable from "@/components/shared/DataTable/DataTable"; import DataTableNoData from "@/components/shared/DataTableNoData/DataTableNoData"; @@ -18,7 +18,6 @@ import { RESOURCE_TYPE } from "@/components/shared/ResourceLink/ResourceLink"; import { Project } from "@/types/projects"; import { formatDate } from "@/lib/date"; import { convertColumnDataToColumn } from "@/lib/table"; -import { buildDocsUrl } from "@/lib/utils"; const COLUMNS_WIDTH_KEY = "home-projects-columns-width"; @@ -111,29 +110,10 @@ const ObservabilitySection: React.FunctionComponent = () => { } return ( -
-
-
-

- Observability -

-
-
- - - - -
-
+
+

+ Observability +

{ } /> +
+ + + +