From 84e5fad6eb0e270eff86a3bf99ec8f0b604f3c69 Mon Sep 17 00:00:00 2001 From: Tim Sweeney Date: Tue, 8 Oct 2024 10:06:08 -0700 Subject: [PATCH 001/169] stubbed --- .../components/FancyPage/useProjectSidebar.ts | 7 ++++ .../PagePanelComponents/Home/Browse3.tsx | 10 ++++++ .../LeaderboardPage.tsx | 35 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/LeaderboardPage.tsx diff --git a/weave-js/src/components/FancyPage/useProjectSidebar.ts b/weave-js/src/components/FancyPage/useProjectSidebar.ts index 6fcc50703f9..088b0dfddbb 100644 --- a/weave-js/src/components/FancyPage/useProjectSidebar.ts +++ b/weave-js/src/components/FancyPage/useProjectSidebar.ts @@ -130,6 +130,13 @@ export const useProjectSidebar = ( label: 'Weave', isShown: isShowAll, }, + { + type: 'button' as const, + name: 'Leaderboard', + slug: 'weave/leaderboard', + isShown: showWeaveSidebarItems || isShowAll, + iconName: IconNames.LayoutTabs, + }, { type: 'button' as const, name: 'Traces', diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx index b2c77cdab6c..66151840d25 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx @@ -82,6 +82,7 @@ import {Empty} from './Browse3/pages/common/Empty'; import {EMPTY_NO_TRACE_SERVER} from './Browse3/pages/common/EmptyContent'; import {SimplePageLayoutContext} from './Browse3/pages/common/SimplePageLayout'; import {CompareEvaluationsPage} from './Browse3/pages/CompareEvaluationsPage/CompareEvaluationsPage'; +import {LeaderboardPage} from './Browse3/pages/CompareEvaluationsPage/LeaderboardPage'; import {ObjectPage} from './Browse3/pages/ObjectPage'; import {ObjectVersionPage} from './Browse3/pages/ObjectVersionPage'; import { @@ -151,6 +152,7 @@ const tabOptions = [ 'op-versions', 'calls', 'evaluations', + 'leaderboard', 'boards', 'tables', ]; @@ -492,6 +494,9 @@ const Browse3ProjectRoot: FC<{ + + + {/* BOARDS */} { ); }; +const LeaderboardPageBinding = () => { + const {entity, project} = useParamsDecoded(); + return ; +}; + const OpsPageBinding = () => { const params = useParamsDecoded(); diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/LeaderboardPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/LeaderboardPage.tsx new file mode 100644 index 00000000000..63d24385af2 --- /dev/null +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/LeaderboardPage.tsx @@ -0,0 +1,35 @@ + +import React from 'react'; + +import {SimplePageLayout} from '../common/SimplePageLayout'; + +type LeaderboardPageProps = { + entity: string; + project: string; +}; + +export const LeaderboardPage: React.FC = props => { + return ( + + ), + }, + ]} + /> + ); +}; + +export const LeaderboardPageContent: React.FC< + LeaderboardPageProps +> = props => { + return <>Leaderboard; +}; From d563e0c9ee1cb49e93d3fc5dc4f28396cf7fb09b Mon Sep 17 00:00:00 2001 From: Tim Sweeney Date: Tue, 8 Oct 2024 10:23:12 -0700 Subject: [PATCH 002/169] First cursor implementation --- .../EditableMarkdown.tsx | 58 +++++++++++++ .../LeaderboardGrid.tsx | 84 +++++++++++++++++++ .../LeaderboardHeader.tsx | 26 ++++++ .../LeaderboardPage.tsx | 58 +++++++++++-- .../pages/CompareEvaluationsPage/fakeData.ts | 41 +++++++++ 5 files changed, 259 insertions(+), 8 deletions(-) create mode 100644 weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/EditableMarkdown.tsx create mode 100644 weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/LeaderboardGrid.tsx create mode 100644 weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/LeaderboardHeader.tsx create mode 100644 weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/fakeData.ts diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/EditableMarkdown.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/EditableMarkdown.tsx new file mode 100644 index 00000000000..895819691cb --- /dev/null +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CompareEvaluationsPage/EditableMarkdown.tsx @@ -0,0 +1,58 @@ +import React, {useState} from 'react'; +import ReactMarkdown from 'react-markdown'; +import styled from 'styled-components'; + +interface EditableMarkdownProps { + value: string; + onChange: (value: string) => void; + placeholder: string; +} + +export const EditableMarkdown: React.FC = ({ + value, + onChange, + placeholder, +}) => { + const [isEditing, setIsEditing] = useState(false); + + return ( + setIsEditing(true)}> + {isEditing ? ( +