From 654a0591b8a3f224df488355ef1037db25c80361 Mon Sep 17 00:00:00 2001 From: Jamie Rasmussen Date: Wed, 27 Nov 2024 00:12:56 -0600 Subject: [PATCH] chore(ui): rearrange nav --- .../components/FancyPage/useProjectSidebar.ts | 102 ++++++++---------- 1 file changed, 44 insertions(+), 58 deletions(-) diff --git a/weave-js/src/components/FancyPage/useProjectSidebar.ts b/weave-js/src/components/FancyPage/useProjectSidebar.ts index 61fa0213b1af..99c16a18471b 100644 --- a/weave-js/src/components/FancyPage/useProjectSidebar.ts +++ b/weave-js/src/components/FancyPage/useProjectSidebar.ts @@ -41,14 +41,6 @@ export const useProjectSidebar = ( label: 'Models', isShown: isShowAll, }, - { - type: 'button' as const, - name: 'Overview', - slug: 'overview', - isShown: !isWeaveOnly, - isDisabled: false, - iconName: IconNames.Info, - }, { type: 'button' as const, name: 'Workspace', @@ -94,7 +86,7 @@ export const useProjectSidebar = ( type: 'button' as const, name: 'Reports', slug: 'reportlist', - isShown: !isWeaveOnly, + isShown: isModelsOnly, isDisabled: viewingRestricted, iconName: IconNames.Report, }, @@ -106,21 +98,26 @@ export const useProjectSidebar = ( iconName: IconNames.VersionsLayers, isDisabled: viewingRestricted, }, + { + type: 'button' as const, + name: 'Overview', + slug: 'overview', + isShown: isModelsOnly, + iconName: IconNames.Info, + }, { type: 'menuPlaceholder' as const, isShown: isShowAll, key: 'moreModels', - menu: ['charts', 'jobs', 'automations', 'sweeps', 'artifacts'], + menu: [ + 'jobs', + 'automations', + 'sweeps', + 'reportlist', + 'artifacts', + 'overview', + ], }, - // Remember to hide weave if env is not prod - // { - // type: 'button' as const, - // name: 'Weave', - // slug: 'weave', - // isShown: !showWeaveSidebarItems, - // iconName: IconNames.CodeAlt, - // isDisabled: viewingRestricted, - // }, { type: 'divider' as const, key: 'dividerModelsWeave', @@ -138,11 +135,6 @@ export const useProjectSidebar = ( isShown: showWeaveSidebarItems || isShowAll, iconName: IconNames.LayoutTabs, }, - { - type: 'divider' as const, - key: 'dividerWithinWeave-1', - isShown: isWeaveOnly, - }, { type: 'button' as const, name: 'Evals', @@ -152,56 +144,52 @@ export const useProjectSidebar = ( }, { type: 'button' as const, - name: 'Leaders', - slug: 'weave/leaderboards', - isShown: isWeaveOnly, - iconName: IconNames.BenchmarkSquare, - }, - // Hiding until we want to release - { - type: 'button' as const, - name: 'Scorers', - slug: 'weave/scorers', - isShown: isWeaveOnly, - iconName: IconNames.TypeNumberAlt, - }, - { - type: 'divider' as const, - key: 'dividerWithinWeave-2', - isShown: isWeaveOnly, + name: 'Playground', + slug: 'weave/playground', + isShown: showWeaveSidebarItems || isShowAll, + iconName: IconNames.RobotServiceMember, }, { type: 'button' as const, name: 'Prompts', slug: 'weave/prompts', - isShown: showWeaveSidebarItems || isShowAll, + isShown: showWeaveSidebarItems, iconName: IconNames.ForumChatBubble, }, { type: 'button' as const, name: 'Models', slug: 'weave/models', - isShown: showWeaveSidebarItems || isShowAll, + isShown: showWeaveSidebarItems, iconName: IconNames.Model, }, { type: 'button' as const, name: 'Datasets', slug: 'weave/datasets', - isShown: showWeaveSidebarItems || isShowAll, + isShown: showWeaveSidebarItems, iconName: IconNames.Table, }, { - type: 'divider' as const, - key: 'dividerWithinWeave-3', + type: 'button' as const, + name: 'Scorers', + slug: 'weave/scorers', isShown: isWeaveOnly, + iconName: IconNames.TypeNumberAlt, + }, + { + type: 'button' as const, + name: 'Leaders', + slug: 'weave/leaderboards', + isShown: false, // Only shown in overflow menu + iconName: IconNames.BenchmarkSquare, }, { type: 'button' as const, name: 'Ops', slug: 'weave/operations', additionalSlugs: ['weave/op-versions'], - isShown: isWeaveOnly, + isShown: false, // Only shown in overflow menu iconName: IconNames.JobProgramCode, }, { @@ -209,29 +197,27 @@ export const useProjectSidebar = ( name: 'Objects', slug: 'weave/objects', additionalSlugs: ['weave/object-versions'], - isShown: isWeaveOnly, + isShown: false, // Only shown in overflow menu iconName: IconNames.CubeContainer, }, { - type: 'button' as const, - name: 'Playground', - slug: 'weave/playground', + type: 'menuPlaceholder' as const, + key: 'moreWeaveOnly', isShown: isWeaveOnly, - iconName: IconNames.RobotServiceMember, + menu: ['weave/leaderboards', 'weave/operations', 'weave/objects'], }, { type: 'menuPlaceholder' as const, - // name: 'More', - // slug: 'moreWeave', - key: 'moreWeave', + key: 'moreWeaveBoth', isShown: isShowAll, - // iconName: IconNames.OverflowHorizontal, menu: [ - 'weave/leaderboards', + 'weave/prompts', + 'weave/models', + 'weave/datasets', 'weave/scorers', + 'weave/leaderboards', 'weave/operations', 'weave/objects', - 'weave/playground', ], }, ];