Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
chore: scrollbar on inside the sidebar in docs
Mish Ushakov0cd6de7b6f2e
diff --git a/apps/web/src/components/Layout.tsx b/apps/web/src/components/Layout.tsxindex 92ee0e9e8..2dedfeff6 100644--- a/apps/web/src/components/Layout.tsx+++ b/apps/web/src/components/Layout.tsx@@ -21,12 +21,18 @@ export function Layout({const isDashboard = pathname?.startsWith('/dashboard')return (- <SectionProvider sections={relativePathname ? allSections[relativePathname] ?? [] : []}>- <div className={clsx('h-[100vh] w-full', { 'lg:ml-[var(--sidebar-nav-width)]': isDocs })}>+ <SectionProvider+ sections={relativePathname ? allSections[relativePathname] ?? [] : []}+ >+ <div+ className={clsx('h-[100vh] w-full', {+ 'lg:ml-[var(--sidebar-nav-width)]': isDocs,+ })}+ >{!isDashboard && (<motion.headerlayoutScroll- className='contents lg:pointer-events-none lg:fixed lg:inset-0 lg:z-40 lg:flex lg:top-[60px]'+ className="contents lg:pointer-events-none lg:fixed lg:inset-0 lg:z-40 lg:flex lg:top-[60px]"><divid="sidebar"@@ -39,9 +45,16 @@ export function Layout({lg:w-[var(--sidebar-nav-width)]lg:overflow-y-autolg:px-4+ border-r+ border-white/10+ lg:pb-4">- {isDocs && <div className="hidden lg:block lg:mt-4"><Navigation /></div>}+ {isDocs && (+ <div className="hidden lg:block lg:mt-4">+ <Navigation />+ </div>+ )}</div></motion.header>)}@@ -60,9 +73,11 @@ export function Layout({lg:dark:border-white/10">- <main className="+ <main+ className="flex-auto- ">+ "+ >{children}</main><Footer />@@ -78,9 +93,11 @@ export function Layout({pt-14">- <main className="+ <main+ className="flex-auto- ">+ "+ >{children}</main></div>diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsxindex 9511180d0..ed670d2d4 100644--- a/apps/web/src/components/Navigation/index.tsx+++ b/apps/web/src/components/Navigation/index.tsx@@ -3,43 +3,43 @@import React, { useRef } from 'react'import { usePathname } from 'next/navigation'import clsx from 'clsx'-import {- motion,-} from 'framer-motion'+import { motion } from 'framer-motion'import { useIsInsideMobileNavigation } from '@/components/MobileBurgerMenu'import { useSectionStore } from '@/components/SectionProvider'-import {- routes,- NavGroup,- NavSubgroup,- NavLink,-} from './routes'+import { routes, NavGroup, NavSubgroup, NavLink } from './routes'import { NavigationSubgroup } from './NavigationSubgroup'import { NavigationLink } from './NavigationLink'-function useInitialValue<T>(value: T, condition = true) {const initialValue = useRef(value).currentreturn condition ? initialValue : value}-function NavigationGroup({ group, className, isLast }: { group: NavGroup; className?: string; isLast?: boolean }) {+function NavigationGroup({+ group,+ className,+ isLast,+}: {+ group: NavGroup+ className?: string+ isLast?: boolean+}) {// If this is the mobile navigation then we always render the initial// state, so that the state does not change during the close animation.// The state will still update when we re-open (re-render) the navigation.const isInsideMobileNavigation = useIsInsideMobileNavigation()const initialPathname = usePathname()const [pathname] = useInitialValue(- [initialPathname, useSectionStore(s => s.sections)],- isInsideMobileNavigation,+ [initialPathname, useSectionStore((s) => s.sections)],+ isInsideMobileNavigation)if (!pathname) {return null}return (- <li className={clsx('relative pr-2', className)}>+ <li className={clsx('relative', className)}><div className="pl-2 mb-1 flex items-center justify-start gap-1"><motion.h2layout="position"@@ -49,12 +49,9 @@ function NavigationGroup({ group, className, isLast }: { group: NavGroup; classN</motion.h2></div><div className="relative">- <ul- role="list"- className="border-l border-transparent"- >+ <ul role="list" className="border-l border-transparent"><>- {group.items?.map(item => (+ {group.items?.map((item) => (<React.Fragment key={item.title}>{(item as any).links ? (<NavigationSubgroup subgroup={item as NavSubgroup} />@@ -79,7 +76,7 @@ function NavigationGroup({ group, className, isLast }: { group: NavGroup; classNexport function Navigation(props) {return (- <nav {...props} className="border-r border-white/10 lg:pb-4">+ <nav {...props}><ul role="list">{routes.map((group, groupIndex) => (<NavigationGroup