Skip to content

Commit

Permalink
First user experience - highlight the need to configure models
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Jan 6, 2024
1 parent fb5b349 commit 4a8a2b9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/common/layout/optima/DesktopNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import Router from 'next/router';
import { Box, IconButton, styled, Tooltip } from '@mui/joy';
import MenuIcon from '@mui/icons-material/Menu';

import { useModelsStore } from '~/modules/llms/store-llms';

import { AgiSquircleIcon } from '~/common/components/icons/AgiSquircleIcon';
import { NavItemApp, navItems } from '~/common/app.nav';
import { themeZIndexDesktopNav } from '~/common/app.theme';
import { cssRainbowColorKeyframes, themeZIndexDesktopNav } from '~/common/app.theme';

import { InvertedBar, InvertedBarCornerItem } from './components/InvertedBar';
import { useOptimaDrawers } from './useOptimaDrawers';
Expand Down Expand Up @@ -41,6 +43,7 @@ const DesktopNavGroupButton = styled(Box)({
const navItemClasses = {
active: 'NavButton-active',
paneOpen: 'NavButton-paneOpen',
attractive: 'NavButton-attractive',
};

const DesktopNavItem = styled(IconButton)(({ theme }) => ({
Expand Down Expand Up @@ -76,6 +79,12 @@ const DesktopNavItem = styled(IconButton)(({ theme }) => ({
paddingRight: 0,
},

// attractive: attract the user to click on this element
[`&.${navItemClasses.attractive}`]: {
animation: `${cssRainbowColorKeyframes} 5s infinite`,
transform: 'scale(1.4)',
},

}));


Expand All @@ -89,6 +98,7 @@ export function DesktopNav(props: { currentApp?: NavItemApp }) {
showPreferencesTab, openPreferencesTab,
showModelsSetup, openModelsSetup,
} = useOptimaLayout();
const noLLMs = useModelsStore(state => !state.llms.length);


// show/hide the pane when clicking on the logo
Expand Down Expand Up @@ -153,19 +163,22 @@ export function DesktopNav(props: { currentApp?: NavItemApp }) {
};
const { isActive, showModal } = stateActionMap[item.overlayId] ?? stateActionMap[0];

// attract the attention to the models configuration when no LLMs are available (a bit hardcoded here)
const isAttractive = noLLMs && item.overlayId === 'models';

return (
<Tooltip followCursor key={'n-m-' + item.overlayId} title={item.name}>
<Tooltip followCursor key={'n-m-' + item.overlayId} title={isAttractive ? 'Add Language Models - REQUIRED' : item.name}>
<DesktopNavItem
variant={isActive ? 'soft' : undefined}
onClick={showModal}
className={`${isActive ? navItemClasses.active : ''}`}
className={`${isActive ? navItemClasses.active : ''} ${isAttractive ? navItemClasses.attractive : ''}`}
>
<item.icon />
</DesktopNavItem>
</Tooltip>
);
});
}, [openModelsSetup, openPreferencesTab, showModelsSetup, showPreferencesTab]);
}, [noLLMs, openModelsSetup, openPreferencesTab, showModelsSetup, showPreferencesTab]);


return (
Expand Down

1 comment on commit 4a8a2b9

@vercel
Copy link

@vercel vercel bot commented on 4a8a2b9 Jan 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

big-agi – ./

get.big-agi.com
big-agi-git-main-stable-enricoros.vercel.app
big-agi-enricoros.vercel.app

Please sign in to comment.