diff --git a/web/containers/CardSidebar/index.tsx b/web/containers/CardSidebar/index.tsx index a90db3790..ac564c2f2 100644 --- a/web/containers/CardSidebar/index.tsx +++ b/web/containers/CardSidebar/index.tsx @@ -1,15 +1,20 @@ import { ReactNode, useState } from 'react' +import { useAtomValue } from 'jotai' import { ChevronDownIcon, MoreVerticalIcon, FolderOpenIcon, Code2Icon, + PencilIcon, } from 'lucide-react' import { twMerge } from 'tailwind-merge' +import { useActiveModel } from '@/hooks/useActiveModel' import { useClickOutside } from '@/hooks/useClickOutside' +import { activeThreadAtom } from '@/helpers/atoms/Thread.atom' + interface Props { children: ReactNode title: string @@ -28,6 +33,8 @@ export default function CardSidebar({ const [more, setMore] = useState(false) const [menu, setMenu] = useState(null) const [toggle, setToggle] = useState(null) + const { activeModel } = useActiveModel() + const activeThread = useAtomValue(activeThreadAtom) useClickOutside(() => setMore(false), null, [menu, toggle]) @@ -77,7 +84,7 @@ export default function CardSidebar({ {more && (
- {openFolderTitle} + Show in Finder Opens thread.json. Changes affect this thread only. @@ -109,7 +116,7 @@ export default function CardSidebar({
) : ( - {openFolderTitle} + Show in Finder )} @@ -121,18 +128,33 @@ export default function CardSidebar({ setMore(false) }} > - <>
- - View as JSON + + Edit Global Defaults for{' '} + + {activeThread?.assistants[0].model.id} + - Opens {title}.json.  - Changes affect all new threads. + {title === 'Model' ? ( + <> + Opens {title}.json. +  Changes affect all new assistants and threads. + + ) : ( + <> + Opens {title}.json. +  Changes affect all new threads. + + )}
diff --git a/web/containers/Layout/Ribbon/index.tsx b/web/containers/Layout/Ribbon/index.tsx index 208bd5a43..d887da19a 100644 --- a/web/containers/Layout/Ribbon/index.tsx +++ b/web/containers/Layout/Ribbon/index.tsx @@ -1,18 +1,8 @@ -import { useState } from 'react' - import { Tooltip, TooltipContent, TooltipTrigger, TooltipArrow, - Modal, - ModalTitle, - ModalContent, - ModalHeader, - ModalFooter, - ModalDescription, - ModalClose, - Button, } from '@janhq/uikit' import { motion as m } from 'framer-motion' @@ -21,8 +11,8 @@ import { SettingsIcon, MonitorIcon, LayoutGridIcon, - // Twitter, - // Github, + Twitter, + Github, } from 'lucide-react' import { twMerge } from 'tailwind-merge' @@ -64,22 +54,22 @@ export default function RibbonNav() { }, ] - // const linksMenu = [ - // { - // name: 'Twitter', - // icon: ( - // - // ), - // link: 'https://twitter.com/janhq_', - // }, - // { - // name: 'Github', - // icon: ( - // - // ), - // link: 'https://github.com/janhq/jan', - // }, - // ] + const linksMenu = [ + { + name: 'Twitter', + icon: ( + + ), + link: 'https://twitter.com/janhq_', + }, + { + name: 'Github', + icon: ( + + ), + link: 'https://github.com/janhq/jan', + }, + ] const secondaryMenus = [ { @@ -148,8 +138,7 @@ export default function RibbonNav() {
- {/* Temporary hidden social media until we finalize design */} - {/* <> + <> {linksMenu .filter((link) => !!link) .map((link, i) => { @@ -174,7 +163,7 @@ export default function RibbonNav() {
) })} - */} + {secondaryMenus .filter((secondary) => !!secondary)