From cfb599fda00db550c92845787391121c6b46ea51 Mon Sep 17 00:00:00 2001 From: gtarpenning Date: Tue, 14 Jan 2025 11:59:12 -0800 Subject: [PATCH 1/5] refactor(ui): move objects/ops related pages into folders --- .../PagePanelComponents/Home/Browse3.tsx | 14 +++--- .../Home/Browse3/context.tsx | 4 +- .../Browse3/datasets/DatasetVersionPage.tsx | 4 +- .../LeaderboardListingPage.tsx | 2 +- .../pages/{ => ObjectsPage}/ObjectPage.tsx | 2 +- .../{ => ObjectsPage}/ObjectVersionPage.tsx | 50 +++++++++---------- .../{ => ObjectsPage}/ObjectVersionsPage.tsx | 46 ++++++++--------- .../pages/{ => ObjectsPage}/ObjectsPage.tsx | 2 +- .../{ => ObjectsPage/Tabs}/TabUseDataset.tsx | 14 +++--- .../{ => ObjectsPage/Tabs}/TabUseModel.tsx | 12 ++--- .../{ => ObjectsPage/Tabs}/TabUseObject.tsx | 10 ++-- .../{ => ObjectsPage/Tabs}/TabUsePrompt.tsx | 12 ++--- .../Browse3/pages/{ => OpsPage}/OpPage.tsx | 2 +- .../pages/{ => OpsPage}/OpVersionPage.tsx | 28 +++++------ .../pages/{ => OpsPage}/OpVersionsPage.tsx | 30 +++++------ .../Browse3/pages/{ => OpsPage}/OpsPage.tsx | 2 +- .../pages/{ => OpsPage/Tabs}/TabUseOp.tsx | 10 ++-- .../pages/ScorersPage/AnnotationsTab.tsx | 2 +- .../pages/ScorersPage/CoreScorersTab.tsx | 2 +- .../pages/ScorersPage/LLMJudgesTab.tsx | 2 +- .../Home/Browse3/pages/common/Links.tsx | 4 +- 21 files changed, 127 insertions(+), 127 deletions(-) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => ObjectsPage}/ObjectPage.tsx (91%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => ObjectsPage}/ObjectVersionPage.tsx (93%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => ObjectsPage}/ObjectVersionsPage.tsx (94%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => ObjectsPage}/ObjectsPage.tsx (88%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => ObjectsPage/Tabs}/TabUseDataset.tsx (84%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => ObjectsPage/Tabs}/TabUseModel.tsx (86%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => ObjectsPage/Tabs}/TabUseObject.tsx (77%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => ObjectsPage/Tabs}/TabUsePrompt.tsx (79%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => OpsPage}/OpPage.tsx (90%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => OpsPage}/OpVersionPage.tsx (89%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => OpsPage}/OpVersionsPage.tsx (90%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => OpsPage}/OpsPage.tsx (88%) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ => OpsPage/Tabs}/TabUseOp.tsx (76%) diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx index c0192ddbe9f6..2a498c0088fb 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx @@ -72,16 +72,16 @@ import {CompareEvaluationsPage} from './Browse3/pages/CompareEvaluationsPage/Com import {LeaderboardListingPage} from './Browse3/pages/LeaderboardPage/LeaderboardListingPage'; import {LeaderboardPage} from './Browse3/pages/LeaderboardPage/LeaderboardPage'; import {ModsPage} from './Browse3/pages/ModsPage'; -import {ObjectPage} from './Browse3/pages/ObjectPage'; -import {ObjectVersionPage} from './Browse3/pages/ObjectVersionPage'; +import {ObjectPage} from './Browse3/pages/ObjectsPage/ObjectPage'; +import {ObjectVersionPage} from './Browse3/pages/ObjectsPage/ObjectVersionPage'; import { ObjectVersionsPage, WFHighLevelObjectVersionFilter, -} from './Browse3/pages/ObjectVersionsPage'; -import {OpPage} from './Browse3/pages/OpPage'; -import {OpsPage} from './Browse3/pages/OpsPage'; -import {OpVersionPage} from './Browse3/pages/OpVersionPage'; -import {OpVersionsPage} from './Browse3/pages/OpVersionsPage'; +} from './Browse3/pages/ObjectsPage/ObjectVersionsPage'; +import {OpPage} from './Browse3/pages/OpsPage/OpPage'; +import {OpsPage} from './Browse3/pages/OpsPage/OpsPage'; +import {OpVersionPage} from './Browse3/pages/OpsPage/OpVersionPage'; +import {OpVersionsPage} from './Browse3/pages/OpsPage/OpVersionsPage'; import {PlaygroundPage} from './Browse3/pages/PlaygroundPage/PlaygroundPage'; import {ScorersPage} from './Browse3/pages/ScorersPage/ScorersPage'; import {TablePage} from './Browse3/pages/TablePage'; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/context.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/context.tsx index fc522c0a9611..b0c457314c78 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/context.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/context.tsx @@ -16,8 +16,8 @@ import React, { import {useHistory, useLocation} from 'react-router-dom'; import {WFHighLevelCallFilter} from './pages/CallsPage/callsTableFilter'; -import {WFHighLevelObjectVersionFilter} from './pages/ObjectVersionsPage'; -import {WFHighLevelOpVersionFilter} from './pages/OpVersionsPage'; +import {WFHighLevelObjectVersionFilter} from './pages/ObjectsPage/ObjectVersionsPage'; +import {WFHighLevelOpVersionFilter} from './pages/OpsPage/OpVersionsPage'; import {useURLSearchParamsDict} from './pages/util'; import { AWL_ROW_EDGE_NAME, diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/DatasetVersionPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/DatasetVersionPage.tsx index 1fd637d20d44..d6b126dbf6b9 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/DatasetVersionPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/DatasetVersionPage.tsx @@ -13,8 +13,8 @@ import { ScrollableTabContent, SimplePageLayoutWithHeader, } from '../pages/common/SimplePageLayout'; -import {DeleteObjectButtonWithModal} from '../pages/ObjectVersionPage'; -import {TabUseDataset} from '../pages/TabUseDataset'; +import {DeleteObjectButtonWithModal} from '../pages/ObjectsPage/ObjectVersionPage'; +import {TabUseDataset} from '../pages/ObjectsPage/Tabs/TabUseDataset'; import {useWFHooks} from '../pages/wfReactInterface/context'; import {objectVersionKeyToRefUri} from '../pages/wfReactInterface/utilities'; import {ObjectVersionSchema} from '../pages/wfReactInterface/wfDataModelHooksInterface'; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/LeaderboardPage/LeaderboardListingPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/LeaderboardPage/LeaderboardListingPage.tsx index 6d495ec96292..e582e2e68418 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/LeaderboardPage/LeaderboardListingPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/LeaderboardPage/LeaderboardListingPage.tsx @@ -9,7 +9,7 @@ import {useWeaveflowRouteContext} from '../../context'; import {Empty} from '../common/Empty'; import {EMPTY_PROPS_LEADERBOARDS} from '../common/EmptyContent'; import {SimplePageLayout} from '../common/SimplePageLayout'; -import {ObjectVersionsTable} from '../ObjectVersionsPage'; +import {ObjectVersionsTable} from '../ObjectsPage/ObjectVersionsPage'; import { useBaseObjectInstances, useCreateBuiltinObjectInstance, diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectPage.tsx similarity index 91% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectPage.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectPage.tsx index 67b1681dcf03..01eba7c0cddd 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectPage.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {SimplePageLayout} from './common/SimplePageLayout'; +import {SimplePageLayout} from '../common/SimplePageLayout'; import {FilterableObjectVersionsTable} from './ObjectVersionsPage'; export const ObjectPage: React.FC<{ diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectVersionPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectVersionPage.tsx similarity index 93% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectVersionPage.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectVersionPage.tsx index d1a2543a63bc..ffe439f9036f 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectVersionPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectVersionPage.tsx @@ -3,49 +3,49 @@ import {Button} from '@wandb/weave/components/Button'; import {useObjectViewEvent} from '@wandb/weave/integrations/analytics/useViewEvents'; import React, {useMemo, useState} from 'react'; -import {maybePluralizeWord} from '../../../../../core/util/string'; -import {Icon, IconName} from '../../../../Icon'; -import {LoadingDots} from '../../../../LoadingDots'; -import {Tailwind} from '../../../../Tailwind'; -import {Tooltip} from '../../../../Tooltip'; -import {useClosePeek} from '../context'; -import {DatasetVersionPage} from '../datasets/DatasetVersionPage'; -import {NotFoundPanel} from '../NotFoundPanel'; -import {CustomWeaveTypeProjectContext} from '../typeViews/CustomWeaveTypeDispatcher'; -import {WeaveCHTableSourceRefContext} from './CallPage/DataTableView'; -import {ObjectViewerSection} from './CallPage/ObjectViewerSection'; -import {WFHighLevelCallFilter} from './CallsPage/callsTableFilter'; -import {DeleteModal, useShowDeleteButton} from './common/DeleteModal'; +import {maybePluralizeWord} from '../../../../../../core/util/string'; +import {Icon, IconName} from '../../../../../Icon'; +import {LoadingDots} from '../../../../../LoadingDots'; +import {Tailwind} from '../../../../../Tailwind'; +import {Tooltip} from '../../../../../Tooltip'; +import {useClosePeek} from '../../context'; +import {DatasetVersionPage} from '../../datasets/DatasetVersionPage'; +import {NotFoundPanel} from '../../NotFoundPanel'; +import {CustomWeaveTypeProjectContext} from '../../typeViews/CustomWeaveTypeDispatcher'; +import {WeaveCHTableSourceRefContext} from '../CallPage/DataTableView'; +import {ObjectViewerSection} from '../CallPage/ObjectViewerSection'; +import {WFHighLevelCallFilter} from '../CallsPage/callsTableFilter'; +import {DeleteModal, useShowDeleteButton} from '../common/DeleteModal'; import { CallLink, CallsLink, ObjectVersionsLink, objectVersionText, OpVersionLink, -} from './common/Links'; -import {CenteredAnimatedLoader} from './common/Loader'; +} from '../common/Links'; +import {CenteredAnimatedLoader} from '../common/Loader'; import { ScrollableTabContent, SimpleKeyValueTable, SimplePageLayoutWithHeader, -} from './common/SimplePageLayout'; -import {EvaluationLeaderboardTab} from './LeaderboardTab'; -import {TabPrompt} from './TabPrompt'; -import {TabUseModel} from './TabUseModel'; -import {TabUseObject} from './TabUseObject'; -import {TabUsePrompt} from './TabUsePrompt'; -import {KNOWN_BASE_OBJECT_CLASSES} from './wfReactInterface/constants'; -import {useWFHooks} from './wfReactInterface/context'; +} from '../common/SimplePageLayout'; +import {EvaluationLeaderboardTab} from '../LeaderboardTab'; +import {TabPrompt} from '../TabPrompt'; +import {KNOWN_BASE_OBJECT_CLASSES} from '../wfReactInterface/constants'; +import {useWFHooks} from '../wfReactInterface/context'; import { isObjDeleteError, objectVersionKeyToRefUri, refUriToOpVersionKey, -} from './wfReactInterface/utilities'; +} from '../wfReactInterface/utilities'; import { CallSchema, KnownBaseObjectClassType, ObjectVersionSchema, -} from './wfReactInterface/wfDataModelHooksInterface'; +} from '../wfReactInterface/wfDataModelHooksInterface'; +import {TabUseModel} from './Tabs/TabUseModel'; +import {TabUseObject} from './Tabs/TabUseObject'; +import {TabUsePrompt} from './Tabs/TabUsePrompt'; type ObjectIconProps = { baseObjectClass: KnownBaseObjectClassType; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectVersionsPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectVersionsPage.tsx similarity index 94% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectVersionsPage.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectVersionsPage.tsx index e9fee11f3e27..14d30f576d11 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectVersionsPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectVersionsPage.tsx @@ -23,20 +23,20 @@ import _ from 'lodash'; import React, {useEffect, useMemo, useState} from 'react'; import {useHistory} from 'react-router-dom'; -import {TEAL_600} from '../../../../../common/css/color.styles'; -import {Button} from '../../../../Button'; -import {ErrorPanel} from '../../../../ErrorPanel'; -import {Loading} from '../../../../Loading'; -import {LoadingDots} from '../../../../LoadingDots'; -import {Timestamp} from '../../../../Timestamp'; +import {TEAL_600} from '../../../../../../common/css/color.styles'; +import {Button} from '../../../../../Button'; +import {ErrorPanel} from '../../../../../ErrorPanel'; +import {Loading} from '../../../../../Loading'; +import {LoadingDots} from '../../../../../LoadingDots'; +import {Timestamp} from '../../../../../Timestamp'; import { useWeaveflowCurrentRouteContext, useWeaveflowRouteContext, -} from '../context'; -import {StyledDataGrid} from '../StyledDataGrid'; -import {basicField} from './common/DataTable'; -import {DeleteModal} from './common/DeleteModal'; -import {Empty} from './common/Empty'; +} from '../../context'; +import {StyledDataGrid} from '../../StyledDataGrid'; +import {basicField} from '../common/DataTable'; +import {DeleteModal} from '../common/DeleteModal'; +import {Empty} from '../common/Empty'; import { EMPTY_PROPS_ACTION_SPECS, EMPTY_PROPS_ANNOTATIONS, @@ -46,35 +46,35 @@ import { EMPTY_PROPS_OBJECTS, EMPTY_PROPS_PROGRAMMATIC_SCORERS, EMPTY_PROPS_PROMPTS, -} from './common/EmptyContent'; +} from '../common/EmptyContent'; import { CustomLink, ObjectVersionLink, ObjectVersionsLink, objectVersionText, -} from './common/Links'; -import {FilterLayoutTemplate} from './common/SimpleFilterableDataTable'; -import {SimplePageLayout} from './common/SimplePageLayout'; +} from '../common/Links'; +import {FilterLayoutTemplate} from '../common/SimpleFilterableDataTable'; +import {SimplePageLayout} from '../common/SimplePageLayout'; import { buildDynamicColumns, prepareFlattenedDataForTable, -} from './common/tabularListViews/columnBuilder'; -import {TypeVersionCategoryChip} from './common/TypeVersionCategoryChip'; -import {useControllableState, useURLSearchParamsDict} from './util'; +} from '../common/tabularListViews/columnBuilder'; +import {TypeVersionCategoryChip} from '../common/TypeVersionCategoryChip'; +import {useControllableState, useURLSearchParamsDict} from '../util'; import { KNOWN_BASE_OBJECT_CLASSES, OBJECT_ATTR_EDGE_NAME, -} from './wfReactInterface/constants'; -import {useWFHooks} from './wfReactInterface/context'; +} from '../wfReactInterface/constants'; +import {useWFHooks} from '../wfReactInterface/context'; import { isTableRef, makeRefExpandedPayload, -} from './wfReactInterface/tsDataModelHooksCallRefExpansion'; -import {objectVersionKeyToRefUri} from './wfReactInterface/utilities'; +} from '../wfReactInterface/tsDataModelHooksCallRefExpansion'; +import {objectVersionKeyToRefUri} from '../wfReactInterface/utilities'; import { KnownBaseObjectClassType, ObjectVersionSchema, -} from './wfReactInterface/wfDataModelHooksInterface'; +} from '../wfReactInterface/wfDataModelHooksInterface'; const DATASET_BASE_OBJECT_CLASS = 'Dataset'; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectsPage.tsx similarity index 88% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectsPage.tsx index 0da05c2644d6..1a774520c0cf 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectsPage.tsx @@ -1,7 +1,7 @@ import React, {useEffect} from 'react'; import {useHistory} from 'react-router-dom'; -import {useWeaveflowCurrentRouteContext} from '../context'; +import {useWeaveflowCurrentRouteContext} from '../../context'; export const ObjectsPage: React.FC<{ entity: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseDataset.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUseDataset.tsx similarity index 84% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseDataset.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUseDataset.tsx index 861eb15f4434..41d778871b1f 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseDataset.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUseDataset.tsx @@ -1,16 +1,16 @@ import {Box} from '@mui/material'; import React from 'react'; -import {isValidVarName} from '../../../../../core/util/var'; -import {parseRef} from '../../../../../react'; -import {abbreviateRef} from '../../../../../util/refs'; -import {CopyableText} from '../../../../CopyableText'; -import {DocLink} from './common/Links'; -import {TabUseBanner} from './TabUseBanner'; +import {isValidVarName} from '../../../../../../../core/util/var'; +import {parseRef} from '../../../../../../../react'; +import {abbreviateRef} from '../../../../../../../util/refs'; +import {CopyableText} from '../../../../../../CopyableText'; +import {DocLink} from '../../common/Links'; +import {TabUseBanner} from '../../TabUseBanner'; import { OBJECT_ATTR_EDGE_NAME, TABLE_ID_EDGE_NAME, -} from './wfReactInterface/constants'; +} from '../../wfReactInterface/constants'; type TabUseDatasetProps = { name: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseModel.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUseModel.tsx similarity index 86% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseModel.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUseModel.tsx index 66be4d77390b..417e692b3738 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseModel.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUseModel.tsx @@ -1,12 +1,12 @@ import {Box} from '@mui/material'; import React from 'react'; -import {isValidVarName} from '../../../../../core/util/var'; -import {parseRef} from '../../../../../react'; -import {abbreviateRef} from '../../../../../util/refs'; -import {CopyableText} from '../../../../CopyableText'; -import {DocLink} from './common/Links'; -import {TabUseBanner} from './TabUseBanner'; +import {isValidVarName} from '../../../../../../../core/util/var'; +import {parseRef} from '../../../../../../../react'; +import {abbreviateRef} from '../../../../../../../util/refs'; +import {CopyableText} from '../../../../../../CopyableText'; +import {DocLink} from '../../common/Links'; +import {TabUseBanner} from '../../TabUseBanner'; type TabUseModelProps = { name: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseObject.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUseObject.tsx similarity index 77% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseObject.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUseObject.tsx index e81785213169..e81d84dcdee6 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseObject.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUseObject.tsx @@ -1,11 +1,11 @@ import {Box} from '@mui/material'; import React from 'react'; -import {isValidVarName} from '../../../../../core/util/var'; -import {abbreviateRef} from '../../../../../util/refs'; -import {CopyableText} from '../../../../CopyableText'; -import {DocLink} from './common/Links'; -import {TabUseBanner} from './TabUseBanner'; +import {isValidVarName} from '../../../../../../../core/util/var'; +import {abbreviateRef} from '../../../../../../../util/refs'; +import {CopyableText} from '../../../../../../CopyableText'; +import {DocLink} from '../../common/Links'; +import {TabUseBanner} from '../../TabUseBanner'; type TabUseObjectProps = { name: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUsePrompt.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUsePrompt.tsx similarity index 79% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUsePrompt.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUsePrompt.tsx index 1d3c54dba46c..04bf54cb3f52 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUsePrompt.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUsePrompt.tsx @@ -1,12 +1,12 @@ import {Box} from '@mui/material'; import React from 'react'; -import {isValidVarName} from '../../../../../core/util/var'; -import {parseRef} from '../../../../../react'; -import {abbreviateRef} from '../../../../../util/refs'; -import {Alert} from '../../../../Alert'; -import {CopyableText} from '../../../../CopyableText'; -import {DocLink} from './common/Links'; +import {isValidVarName} from '../../../../../../../core/util/var'; +import {parseRef} from '../../../../../../../react'; +import {abbreviateRef} from '../../../../../../../util/refs'; +import {Alert} from '../../../../../../Alert'; +import {CopyableText} from '../../../../../../CopyableText'; +import {DocLink} from '../../common/Links'; type Data = Record; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpPage.tsx similarity index 90% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpPage.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpPage.tsx index 621f49b60f96..d56240b9700b 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpPage.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {SimplePageLayout} from './common/SimplePageLayout'; +import {SimplePageLayout} from '../common/SimplePageLayout'; import {FilterableOpVersionsTable} from './OpVersionsPage'; export const OpPage: React.FC<{ diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpVersionPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpVersionPage.tsx similarity index 89% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpVersionPage.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpVersionPage.tsx index 6148e5a5bc48..ef7b7dc0fa51 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpVersionPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpVersionPage.tsx @@ -1,28 +1,28 @@ import {Button} from '@wandb/weave/components/Button'; import React, {useMemo, useState} from 'react'; -import {Icon} from '../../../../Icon'; -import {LoadingDots} from '../../../../LoadingDots'; -import {Tailwind} from '../../../../Tailwind'; -import {useClosePeek} from '../context'; -import {NotFoundPanel} from '../NotFoundPanel'; -import {OpCodeViewer} from '../OpCodeViewer'; -import {DeleteModal, useShowDeleteButton} from './common/DeleteModal'; +import {Icon} from '../../../../../Icon'; +import {LoadingDots} from '../../../../../LoadingDots'; +import {Tailwind} from '../../../../../Tailwind'; +import {useClosePeek} from '../../context'; +import {NotFoundPanel} from '../../NotFoundPanel'; +import {OpCodeViewer} from '../../OpCodeViewer'; +import {DeleteModal, useShowDeleteButton} from '../common/DeleteModal'; import { CallsLink, opNiceName, OpVersionsLink, opVersionText, -} from './common/Links'; -import {CenteredAnimatedLoader} from './common/Loader'; +} from '../common/Links'; +import {CenteredAnimatedLoader} from '../common/Loader'; import { ScrollableTabContent, SimplePageLayoutWithHeader, -} from './common/SimplePageLayout'; -import {TabUseOp} from './TabUseOp'; -import {useWFHooks} from './wfReactInterface/context'; -import {opVersionKeyToRefUri} from './wfReactInterface/utilities'; -import {OpVersionSchema} from './wfReactInterface/wfDataModelHooksInterface'; +} from '../common/SimplePageLayout'; +import {useWFHooks} from '../wfReactInterface/context'; +import {opVersionKeyToRefUri} from '../wfReactInterface/utilities'; +import {OpVersionSchema} from '../wfReactInterface/wfDataModelHooksInterface'; +import {TabUseOp} from './Tabs/TabUseOp'; export const OpVersionPage: React.FC<{ entity: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpVersionsPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpVersionsPage.tsx similarity index 90% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpVersionsPage.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpVersionsPage.tsx index c5272f8a8d92..05e33469291d 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpVersionsPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpVersionsPage.tsx @@ -6,26 +6,26 @@ import { } from '@mui/x-data-grid-pro'; import React, {useEffect, useMemo, useState} from 'react'; -import {TEAL_600} from '../../../../../common/css/color.styles'; -import {ErrorPanel} from '../../../../ErrorPanel'; -import {Loading} from '../../../../Loading'; -import {LoadingDots} from '../../../../LoadingDots'; -import {Timestamp} from '../../../../Timestamp'; -import {StyledDataGrid} from '../StyledDataGrid'; -import {basicField} from './common/DataTable'; -import {Empty} from './common/Empty'; -import {EMPTY_PROPS_OPERATIONS} from './common/EmptyContent'; +import {TEAL_600} from '../../../../../../common/css/color.styles'; +import {ErrorPanel} from '../../../../../ErrorPanel'; +import {Loading} from '../../../../../Loading'; +import {LoadingDots} from '../../../../../LoadingDots'; +import {Timestamp} from '../../../../../Timestamp'; +import {StyledDataGrid} from '../../StyledDataGrid'; +import {basicField} from '../common/DataTable'; +import {Empty} from '../common/Empty'; +import {EMPTY_PROPS_OPERATIONS} from '../common/EmptyContent'; import { CallsLink, opNiceName, OpVersionLink, OpVersionsLink, -} from './common/Links'; -import {SimplePageLayout} from './common/SimplePageLayout'; -import {useControllableState, useURLSearchParamsDict} from './util'; -import {useWFHooks} from './wfReactInterface/context'; -import {opVersionKeyToRefUri} from './wfReactInterface/utilities'; -import {OpVersionSchema} from './wfReactInterface/wfDataModelHooksInterface'; +} from '../common/Links'; +import {SimplePageLayout} from '../common/SimplePageLayout'; +import {useControllableState, useURLSearchParamsDict} from '../util'; +import {useWFHooks} from '../wfReactInterface/context'; +import {opVersionKeyToRefUri} from '../wfReactInterface/utilities'; +import {OpVersionSchema} from '../wfReactInterface/wfDataModelHooksInterface'; export type WFHighLevelOpVersionFilter = { opName?: string | null; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpsPage.tsx similarity index 88% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpsPage.tsx index 4a8fa42736da..570c6c72ea28 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/OpsPage.tsx @@ -1,7 +1,7 @@ import React, {useEffect} from 'react'; import {useHistory} from 'react-router-dom'; -import {useWeaveflowCurrentRouteContext} from '../context'; +import {useWeaveflowCurrentRouteContext} from '../../context'; export const OpsPage: React.FC<{ entity: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseOp.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/Tabs/TabUseOp.tsx similarity index 76% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseOp.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/Tabs/TabUseOp.tsx index 2370fac74cfe..fc70fc144068 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/TabUseOp.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/Tabs/TabUseOp.tsx @@ -1,11 +1,11 @@ import {Box} from '@mui/material'; import React from 'react'; -import {isValidVarName} from '../../../../../core/util/var'; -import {abbreviateRef} from '../../../../../util/refs'; -import {CopyableText} from '../../../../CopyableText'; -import {DocLink} from './common/Links'; -import {TabUseBanner} from './TabUseBanner'; +import {isValidVarName} from '../../../../../../../core/util/var'; +import {abbreviateRef} from '../../../../../../../util/refs'; +import {CopyableText} from '../../../../../../CopyableText'; +import {DocLink} from '../../common/Links'; +import {TabUseBanner} from '../../TabUseBanner'; type TabUseOpProps = { name: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/AnnotationsTab.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/AnnotationsTab.tsx index c514b055b608..8abc4bf9884e 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/AnnotationsTab.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/AnnotationsTab.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {FilterableObjectVersionsTable} from '../ObjectVersionsPage'; +import {FilterableObjectVersionsTable} from '../ObjectsPage/ObjectVersionsPage'; export const AnnotationsTab: React.FC<{ entity: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/CoreScorersTab.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/CoreScorersTab.tsx index f760912d47a2..a4bc815aeb4a 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/CoreScorersTab.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/CoreScorersTab.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {FilterableObjectVersionsTable} from '../ObjectVersionsPage'; +import {FilterableObjectVersionsTable} from '../ObjectsPage/ObjectVersionsPage'; export const ProgrammaticScorersTab: React.FC<{ entity: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/LLMJudgesTab.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/LLMJudgesTab.tsx index 2241ec7e7560..f5359c32f4f8 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/LLMJudgesTab.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ScorersPage/LLMJudgesTab.tsx @@ -2,7 +2,7 @@ import React from 'react'; -import {FilterableObjectVersionsTable} from '../ObjectVersionsPage'; +import {FilterableObjectVersionsTable} from '../ObjectsPage/ObjectVersionsPage'; export const LLMJudgesTab: React.FC<{ entity: string; project: string; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/common/Links.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/common/Links.tsx index 5f84121f0889..da9307558f51 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/common/Links.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/common/Links.tsx @@ -19,8 +19,8 @@ import { useWeaveflowRouteContext, } from '../../context'; import {WFHighLevelCallFilter} from '../CallsPage/callsTableFilter'; -import {WFHighLevelObjectVersionFilter} from '../ObjectVersionsPage'; -import {WFHighLevelOpVersionFilter} from '../OpVersionsPage'; +import {WFHighLevelObjectVersionFilter} from '../ObjectsPage/ObjectVersionsPage'; +import {WFHighLevelOpVersionFilter} from '../OpsPage/OpVersionsPage'; import {Id} from './Id'; type LinkVariant = 'primary' | 'secondary'; From b41794bd2a8f0fdcb540ef90a566c61b8821d6a2 Mon Sep 17 00:00:00 2001 From: gtarpenning Date: Tue, 14 Jan 2025 12:25:43 -0800 Subject: [PATCH 2/5] op page --- .../Browse3/pages/{ObjectsPage => OpsPage}/Tabs/TabUsePrompt.tsx | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename weave-js/src/components/PagePanelComponents/Home/Browse3/pages/{ObjectsPage => OpsPage}/Tabs/TabUsePrompt.tsx (100%) diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUsePrompt.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/Tabs/TabUsePrompt.tsx similarity index 100% rename from weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/Tabs/TabUsePrompt.tsx rename to weave-js/src/components/PagePanelComponents/Home/Browse3/pages/OpsPage/Tabs/TabUsePrompt.tsx From 3e44ae473374a8c7f670e7a3b06e969333cc4752 Mon Sep 17 00:00:00 2001 From: gtarpenning Date: Tue, 14 Jan 2025 12:42:21 -0800 Subject: [PATCH 3/5] extract table, types, and buttons --- .../PagePanelComponents/Home/Browse3.tsx | 6 +- .../Home/Browse3/context.tsx | 2 +- .../Browse3/datasets/DatasetVersionPage.tsx | 2 +- .../LeaderboardListingPage.tsx | 2 +- .../pages/ObjectsPage/ObjectDeleteButtons.tsx | 85 +++ .../Browse3/pages/ObjectsPage/ObjectPage.tsx | 2 +- .../pages/ObjectsPage/ObjectVersionPage.tsx | 47 +- .../pages/ObjectsPage/ObjectVersionsPage.tsx | 539 +----------------- .../pages/ObjectsPage/ObjectVersionsTable.tsx | 482 ++++++++++++++++ .../pages/ObjectsPage/objectsPageTypes.ts | 6 + .../pages/ScorersPage/AnnotationsTab.tsx | 2 +- .../pages/ScorersPage/CoreScorersTab.tsx | 2 +- .../pages/ScorersPage/LLMJudgesTab.tsx | 2 +- .../Home/Browse3/pages/common/Links.tsx | 2 +- 14 files changed, 594 insertions(+), 587 deletions(-) create mode 100644 weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectDeleteButtons.tsx create mode 100644 weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectVersionsTable.tsx create mode 100644 weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/objectsPageTypes.ts diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx index 2a498c0088fb..308b59bda119 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3.tsx @@ -73,11 +73,9 @@ import {LeaderboardListingPage} from './Browse3/pages/LeaderboardPage/Leaderboar import {LeaderboardPage} from './Browse3/pages/LeaderboardPage/LeaderboardPage'; import {ModsPage} from './Browse3/pages/ModsPage'; import {ObjectPage} from './Browse3/pages/ObjectsPage/ObjectPage'; +import {WFHighLevelObjectVersionFilter} from './Browse3/pages/ObjectsPage/objectsPageTypes'; import {ObjectVersionPage} from './Browse3/pages/ObjectsPage/ObjectVersionPage'; -import { - ObjectVersionsPage, - WFHighLevelObjectVersionFilter, -} from './Browse3/pages/ObjectsPage/ObjectVersionsPage'; +import {ObjectVersionsPage} from './Browse3/pages/ObjectsPage/ObjectVersionsPage'; import {OpPage} from './Browse3/pages/OpsPage/OpPage'; import {OpsPage} from './Browse3/pages/OpsPage/OpsPage'; import {OpVersionPage} from './Browse3/pages/OpsPage/OpVersionPage'; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/context.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/context.tsx index b0c457314c78..75eda6fcb55a 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/context.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/context.tsx @@ -16,7 +16,7 @@ import React, { import {useHistory, useLocation} from 'react-router-dom'; import {WFHighLevelCallFilter} from './pages/CallsPage/callsTableFilter'; -import {WFHighLevelObjectVersionFilter} from './pages/ObjectsPage/ObjectVersionsPage'; +import {WFHighLevelObjectVersionFilter} from './pages/ObjectsPage/objectsPageTypes'; import {WFHighLevelOpVersionFilter} from './pages/OpsPage/OpVersionsPage'; import {useURLSearchParamsDict} from './pages/util'; import { diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/DatasetVersionPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/DatasetVersionPage.tsx index d6b126dbf6b9..0952c7ccf2ae 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/DatasetVersionPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/DatasetVersionPage.tsx @@ -13,7 +13,7 @@ import { ScrollableTabContent, SimplePageLayoutWithHeader, } from '../pages/common/SimplePageLayout'; -import {DeleteObjectButtonWithModal} from '../pages/ObjectsPage/ObjectVersionPage'; +import {DeleteObjectButtonWithModal} from '../pages/ObjectsPage/ObjectDeleteButtons'; import {TabUseDataset} from '../pages/ObjectsPage/Tabs/TabUseDataset'; import {useWFHooks} from '../pages/wfReactInterface/context'; import {objectVersionKeyToRefUri} from '../pages/wfReactInterface/utilities'; diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/LeaderboardPage/LeaderboardListingPage.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/LeaderboardPage/LeaderboardListingPage.tsx index e582e2e68418..f78bc28db6ae 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/LeaderboardPage/LeaderboardListingPage.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/LeaderboardPage/LeaderboardListingPage.tsx @@ -9,7 +9,7 @@ import {useWeaveflowRouteContext} from '../../context'; import {Empty} from '../common/Empty'; import {EMPTY_PROPS_LEADERBOARDS} from '../common/EmptyContent'; import {SimplePageLayout} from '../common/SimplePageLayout'; -import {ObjectVersionsTable} from '../ObjectsPage/ObjectVersionsPage'; +import {ObjectVersionsTable} from '../ObjectsPage/ObjectVersionsTable'; import { useBaseObjectInstances, useCreateBuiltinObjectInstance, diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectDeleteButtons.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectDeleteButtons.tsx new file mode 100644 index 000000000000..7d9aaf4cee99 --- /dev/null +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/ObjectsPage/ObjectDeleteButtons.tsx @@ -0,0 +1,85 @@ +import {Button} from '@wandb/weave/components/Button'; +import {maybePluralizeWord} from '@wandb/weave/core/util/string'; +import React, {useState} from 'react'; + +import {useClosePeek} from '../../context'; +import {DeleteModal} from '../common/DeleteModal'; +import {useWFHooks} from '../wfReactInterface/context'; +import {ObjectVersionSchema} from '../wfReactInterface/wfDataModelHooksInterface'; + +export const DeleteObjectButtonWithModal: React.FC<{ + objVersionSchema: ObjectVersionSchema; + overrideDisplayStr?: string; +}> = ({objVersionSchema, overrideDisplayStr}) => { + const {useObjectDeleteFunc} = useWFHooks(); + const closePeek = useClosePeek(); + const {objectVersionsDelete} = useObjectDeleteFunc(); + const [deleteModalOpen, setDeleteModalOpen] = useState(false); + + const deleteStr = + overrideDisplayStr ?? + `${objVersionSchema.objectId}:v${objVersionSchema.versionIndex}`; + + return ( + <> +