-
- {items.map((item) => (
-
-
-
-
- {item.icon && }
- {item.title}
- {!!item.items?.length && (
-
- )}
-
-
-
-
- {item.items?.map((subItem) => (
-
-
-
- {subItem.title}
-
-
-
- ))}
-
-
-
-
- ))}
-
-
- )
-}
diff --git a/ee/tabby-ui/components/nav-projects.tsx b/ee/tabby-ui/components/nav-projects.tsx
deleted file mode 100644
index f50b20de15c4..000000000000
--- a/ee/tabby-ui/components/nav-projects.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-"use client"
-
-import {
- Folder,
- Forward,
- MoreHorizontal,
- Trash2,
- type LucideIcon,
-} from "lucide-react"
-
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
-import {
- SidebarGroup,
- SidebarGroupLabel,
- SidebarMenu,
- SidebarMenuAction,
- SidebarMenuButton,
- SidebarMenuItem,
- useSidebar,
-} from "@/components/ui/sidebar"
-
-export function NavProjects({
- projects,
-}: {
- projects: {
- name: string
- url: string
- icon: LucideIcon
- }[]
-}) {
- const { isMobile } = useSidebar()
-
- return (
-
- Projects
-
- {projects.map((item) => (
-
-
-
-
- {item.name}
-
-
-
-
-
-
- More
-
-
-
-
-
- View Project
-
-
-
- Share Project
-
-
-
-
- Delete Project
-
-
-
-
- ))}
-
-
-
- More
-
-
-
-
- )
-}
diff --git a/ee/tabby-ui/components/nav-user.tsx b/ee/tabby-ui/components/nav-user.tsx
deleted file mode 100644
index d12ef780c278..000000000000
--- a/ee/tabby-ui/components/nav-user.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-"use client"
-
-import {
- BadgeCheck,
- Bell,
- ChevronsUpDown,
- CreditCard,
- LogOut,
- Sparkles,
-} from "lucide-react"
-
-import {
- Avatar,
- AvatarFallback,
- AvatarImage,
-} from "@/components/ui/avatar"
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
-import {
- SidebarMenu,
- SidebarMenuButton,
- SidebarMenuItem,
- useSidebar,
-} from "@/components/ui/sidebar"
-
-export function NavUser({
- user,
-}: {
- user: {
- name: string
- email: string
- avatar: string
- }
-}) {
- const { isMobile } = useSidebar()
-
- return (
-
-
-
-
-
-
-
- CN
-
-
- {user.name}
- {user.email}
-
-
-
-
-
-
-
-
-
- CN
-
-
- {user.name}
- {user.email}
-
-
-
-
-
-
-
- Upgrade to Pro
-
-
-
-
-
-
- Account
-
-
-
- Billing
-
-
-
- Notifications
-
-
-
-
-
- Log out
-
-
-
-
-
- )
-}
diff --git a/ee/tabby-ui/components/team-switcher.tsx b/ee/tabby-ui/components/team-switcher.tsx
deleted file mode 100644
index 2808e0a4f1c8..000000000000
--- a/ee/tabby-ui/components/team-switcher.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-"use client"
-
-import * as React from "react"
-import { ChevronsUpDown, Plus } from "lucide-react"
-
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuSeparator,
- DropdownMenuShortcut,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
-import {
- SidebarMenu,
- SidebarMenuButton,
- SidebarMenuItem,
- useSidebar,
-} from "@/components/ui/sidebar"
-
-export function TeamSwitcher({
- teams,
-}: {
- teams: {
- name: string
- logo: React.ElementType
- plan: string
- }[]
-}) {
- const { isMobile } = useSidebar()
- const [activeTeam, setActiveTeam] = React.useState(teams[0])
-
- return (
-
-
-
-
-
-
-
-
- {activeTeam.name}
-
- {activeTeam.plan}
-
-
-
-
-
-
- Teams
-
- {teams.map((team, index) => (
- setActiveTeam(team)}
- className="gap-2 p-2"
- >
-
-
-
- {team.name}
- ⌘{index + 1}
-
- ))}
-
-
-
- Add team
-
-
-
-
-
- )
-}
diff --git a/ee/tabby-ui/components/ui/breadcrumb.tsx b/ee/tabby-ui/components/ui/breadcrumb.tsx
index 60e6c96f72f0..78dba9c0a19a 100644
--- a/ee/tabby-ui/components/ui/breadcrumb.tsx
+++ b/ee/tabby-ui/components/ui/breadcrumb.tsx
@@ -1,108 +1,108 @@
-import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
-import { ChevronRight, MoreHorizontal } from "lucide-react"
+import * as React from 'react'
+import { Slot } from '@radix-ui/react-slot'
+import { ChevronRight, MoreHorizontal } from 'lucide-react'
-import { cn } from "@/lib/utils"
+import { cn } from '@/lib/utils'
const Breadcrumb = React.forwardRef<
HTMLElement,
- React.ComponentPropsWithoutRef<"nav"> & {
+ React.ComponentPropsWithoutRef<'nav'> & {
separator?: React.ReactNode
}
>(({ ...props }, ref) =>
)
-Breadcrumb.displayName = "Breadcrumb"
+Breadcrumb.displayName = 'Breadcrumb'
const BreadcrumbList = React.forwardRef<
HTMLOListElement,
- React.ComponentPropsWithoutRef<"ol">
+ React.ComponentPropsWithoutRef<'ol'>
>(({ className, ...props }, ref) => (
))
-BreadcrumbList.displayName = "BreadcrumbList"
+BreadcrumbList.displayName = 'BreadcrumbList'
const BreadcrumbItem = React.forwardRef<
HTMLLIElement,
- React.ComponentPropsWithoutRef<"li">
+ React.ComponentPropsWithoutRef<'li'>
>(({ className, ...props }, ref) => (
))
-BreadcrumbItem.displayName = "BreadcrumbItem"
+BreadcrumbItem.displayName = 'BreadcrumbItem'
const BreadcrumbLink = React.forwardRef<
HTMLAnchorElement,
- React.ComponentPropsWithoutRef<"a"> & {
+ React.ComponentPropsWithoutRef<'a'> & {
asChild?: boolean
}
>(({ asChild, className, ...props }, ref) => {
- const Comp = asChild ? Slot : "a"
+ const Comp = asChild ? Slot : 'a'
return (
)
})
-BreadcrumbLink.displayName = "BreadcrumbLink"
+BreadcrumbLink.displayName = 'BreadcrumbLink'
const BreadcrumbPage = React.forwardRef<
HTMLSpanElement,
- React.ComponentPropsWithoutRef<"span">
+ React.ComponentPropsWithoutRef<'span'>
>(({ className, ...props }, ref) => (
))
-BreadcrumbPage.displayName = "BreadcrumbPage"
+BreadcrumbPage.displayName = 'BreadcrumbPage'
const BreadcrumbSeparator = ({
children,
className,
...props
-}: React.ComponentProps<"li">) => (
+}: React.ComponentProps<'li'>) => (
svg]:w-3.5 [&>svg]:h-3.5", className)}
+ className={cn('[&>svg]:w-3.5 [&>svg]:h-3.5', className)}
{...props}
>
{children ?? }
)
-BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
+BreadcrumbSeparator.displayName = 'BreadcrumbSeparator'
const BreadcrumbEllipsis = ({
className,
...props
-}: React.ComponentProps<"span">) => (
+}: React.ComponentProps<'span'>) => (
More
)
-BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
+BreadcrumbEllipsis.displayName = 'BreadcrumbElipssis'
export {
Breadcrumb,
@@ -111,5 +111,5 @@ export {
BreadcrumbLink,
BreadcrumbPage,
BreadcrumbSeparator,
- BreadcrumbEllipsis,
+ BreadcrumbEllipsis
}
diff --git a/ee/tabby-ui/components/ui/icons.tsx b/ee/tabby-ui/components/ui/icons.tsx
index c6184d7c4127..4c11d7d4b36b 100644
--- a/ee/tabby-ui/components/ui/icons.tsx
+++ b/ee/tabby-ui/components/ui/icons.tsx
@@ -27,6 +27,7 @@ import {
ListFilter,
Mail,
MessagesSquare,
+ PanelLeft,
Regex,
Search,
Share2,
@@ -35,8 +36,7 @@ import {
Star,
Tag,
WrapText,
- X,
- PanelLeft
+ X
} from 'lucide-react'
import { cn } from '@/lib/utils'
diff --git a/ee/tabby-ui/components/ui/sidebar.tsx b/ee/tabby-ui/components/ui/sidebar.tsx
index ed42e72ecbf1..19bb07ad1896 100644
--- a/ee/tabby-ui/components/ui/sidebar.tsx
+++ b/ee/tabby-ui/components/ui/sidebar.tsx
@@ -1,33 +1,34 @@
-"use client"
-
-import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
-import { VariantProps, cva } from "class-variance-authority"
-
-import { useIsMobile } from "@/hooks/use-mobile"
-import { cn } from "@/lib/utils"
-import { Button } from "@/components/ui/button"
-import { Input } from "@/components/ui/input"
-import { Separator } from "@/components/ui/separator"
-import { Sheet, SheetContent } from "@/components/ui/sheet"
-import { Skeleton } from "@/components/ui/skeleton"
+'use client'
+
+import * as React from 'react'
+import { Slot } from '@radix-ui/react-slot'
+import { cva, VariantProps } from 'class-variance-authority'
+
+import { cn } from '@/lib/utils'
+import { useIsMobile } from '@/hooks/use-mobile'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Separator } from '@/components/ui/separator'
+import { Sheet, SheetContent } from '@/components/ui/sheet'
+import { Skeleton } from '@/components/ui/skeleton'
import {
Tooltip,
TooltipContent,
TooltipProvider,
- TooltipTrigger,
-} from "@/components/ui/tooltip"
-import { IconPanelLeft } from "./icons"
+ TooltipTrigger
+} from '@/components/ui/tooltip'
-const SIDEBAR_COOKIE_NAME = "sidebar:state"
+import { IconPanelLeft } from './icons'
+
+const SIDEBAR_COOKIE_NAME = 'sidebar:state'
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
-const SIDEBAR_WIDTH = "16rem"
-const SIDEBAR_WIDTH_MOBILE = "18rem"
-const SIDEBAR_WIDTH_ICON = "3rem"
-const SIDEBAR_KEYBOARD_SHORTCUT = "b"
+const SIDEBAR_WIDTH = '16rem'
+const SIDEBAR_WIDTH_MOBILE = '18rem'
+const SIDEBAR_WIDTH_ICON = '3rem'
+const SIDEBAR_KEYBOARD_SHORTCUT = 'b'
type SidebarContext = {
- state: "expanded" | "collapsed"
+ state: 'expanded' | 'collapsed'
open: boolean
setOpen: (open: boolean) => void
openMobile: boolean
@@ -41,7 +42,7 @@ const SidebarContext = React.createContext
(null)
function useSidebar() {
const context = React.useContext(SidebarContext)
if (!context) {
- throw new Error("useSidebar must be used within a SidebarProvider.")
+ throw new Error('useSidebar must be used within a SidebarProvider.')
}
return context
@@ -49,7 +50,7 @@ function useSidebar() {
const SidebarProvider = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"div"> & {
+ React.ComponentProps<'div'> & {
defaultOpen?: boolean
open?: boolean
onOpenChange?: (open: boolean) => void
@@ -76,7 +77,7 @@ const SidebarProvider = React.forwardRef<
const open = openProp ?? _open
const setOpen = React.useCallback(
(value: boolean | ((value: boolean) => boolean)) => {
- const openState = typeof value === "function" ? value(open) : value
+ const openState = typeof value === 'function' ? value(open) : value
if (setOpenProp) {
setOpenProp(openState)
} else {
@@ -91,9 +92,7 @@ const SidebarProvider = React.forwardRef<
// Helper to toggle the sidebar.
const toggleSidebar = React.useCallback(() => {
- return isMobile
- ? setOpenMobile((open) => !open)
- : setOpen((open) => !open)
+ return isMobile ? setOpenMobile(open => !open) : setOpen(open => !open)
}, [isMobile, setOpen, setOpenMobile])
// Adds a keyboard shortcut to toggle the sidebar.
@@ -108,13 +107,13 @@ const SidebarProvider = React.forwardRef<
}
}
- window.addEventListener("keydown", handleKeyDown)
- return () => window.removeEventListener("keydown", handleKeyDown)
+ window.addEventListener('keydown', handleKeyDown)
+ return () => window.removeEventListener('keydown', handleKeyDown)
}, [toggleSidebar])
// We add a state so that we can do data-state="expanded" or "collapsed".
// This makes it easier to style the sidebar with Tailwind classes.
- const state = open ? "expanded" : "collapsed"
+ const state = open ? 'expanded' : 'collapsed'
const contextValue = React.useMemo(
() => ({
@@ -124,7 +123,7 @@ const SidebarProvider = React.forwardRef<
isMobile,
openMobile,
setOpenMobile,
- toggleSidebar,
+ toggleSidebar
}),
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
)
@@ -135,13 +134,13 @@ const SidebarProvider = React.forwardRef<
& {
- side?: "left" | "right"
- variant?: "sidebar" | "floating" | "inset"
- collapsible?: "offcanvas" | "icon" | "none"
+ React.ComponentProps<'div'> & {
+ side?: 'left' | 'right'
+ variant?: 'sidebar' | 'floating' | 'inset'
+ collapsible?: 'offcanvas' | 'icon' | 'none'
}
>(
(
{
- side = "left",
- variant = "sidebar",
- collapsible = "offcanvas",
+ side = 'left',
+ variant = 'sidebar',
+ collapsible = 'offcanvas',
className,
children,
...props
@@ -177,11 +176,11 @@ const Sidebar = React.forwardRef<
) => {
const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
- if (collapsible === "none") {
+ if (collapsible === 'none') {
return (
{/* This is what handles the sidebar gap on desktop */}
,
@@ -272,23 +270,23 @@ const SidebarTrigger = React.forwardRef<
data-sidebar="trigger"
variant="ghost"
size="icon"
- className={cn("h-7 w-7", className)}
- onClick={(event) => {
+ className={cn('h-7 w-7', className)}
+ onClick={event => {
onClick?.(event)
toggleSidebar()
}}
{...props}
>
-
+
Toggle Sidebar
)
})
-SidebarTrigger.displayName = "SidebarTrigger"
+SidebarTrigger.displayName = 'SidebarTrigger'
const SidebarRail = React.forwardRef<
HTMLButtonElement,
- React.ComponentProps<"button">
+ React.ComponentProps<'button'>
>(({ className, ...props }, ref) => {
const { toggleSidebar } = useSidebar()
@@ -301,37 +299,37 @@ const SidebarRail = React.forwardRef<
onClick={toggleSidebar}
title="Toggle Sidebar"
className={cn(
- "absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
- "[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
- "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
- "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
- "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
- "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
+ 'absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex',
+ '[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize',
+ '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
+ 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar',
+ '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
+ '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
className
)}
{...props}
/>
)
})
-SidebarRail.displayName = "SidebarRail"
+SidebarRail.displayName = 'SidebarRail'
const SidebarInset = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"main">
+ React.ComponentProps<'main'>
>(({ className, ...props }, ref) => {
return (
)
})
-SidebarInset.displayName = "SidebarInset"
+SidebarInset.displayName = 'SidebarInset'
const SidebarInput = React.forwardRef<
React.ElementRef
,
@@ -342,44 +340,44 @@ const SidebarInput = React.forwardRef<
ref={ref}
data-sidebar="input"
className={cn(
- "h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
+ 'h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring',
className
)}
{...props}
/>
)
})
-SidebarInput.displayName = "SidebarInput"
+SidebarInput.displayName = 'SidebarInput'
const SidebarHeader = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"div">
+ React.ComponentProps<'div'>
>(({ className, ...props }, ref) => {
return (
)
})
-SidebarHeader.displayName = "SidebarHeader"
+SidebarHeader.displayName = 'SidebarHeader'
const SidebarFooter = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"div">
+ React.ComponentProps<'div'>
>(({ className, ...props }, ref) => {
return (
)
})
-SidebarFooter.displayName = "SidebarFooter"
+SidebarFooter.displayName = 'SidebarFooter'
const SidebarSeparator = React.forwardRef<
React.ElementRef,
@@ -389,154 +387,154 @@ const SidebarSeparator = React.forwardRef<
)
})
-SidebarSeparator.displayName = "SidebarSeparator"
+SidebarSeparator.displayName = 'SidebarSeparator'
const SidebarContent = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"div">
+ React.ComponentProps<'div'>
>(({ className, ...props }, ref) => {
return (
)
})
-SidebarContent.displayName = "SidebarContent"
+SidebarContent.displayName = 'SidebarContent'
const SidebarGroup = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"div">
+ React.ComponentProps<'div'>
>(({ className, ...props }, ref) => {
return (
)
})
-SidebarGroup.displayName = "SidebarGroup"
+SidebarGroup.displayName = 'SidebarGroup'
const SidebarGroupLabel = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"div"> & { asChild?: boolean }
+ React.ComponentPropsWithoutRef<'div'> & { asChild?: boolean }
>(({ className, asChild = false, ...props }, ref) => {
- const Comp = asChild ? Slot : "div"
+ const Comp = asChild ? Slot : 'div'
return (
svg]:size-4 [&>svg]:shrink-0",
- "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
+ 'duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
+ 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',
className
)}
{...props}
/>
)
})
-SidebarGroupLabel.displayName = "SidebarGroupLabel"
+SidebarGroupLabel.displayName = 'SidebarGroupLabel'
const SidebarGroupAction = React.forwardRef<
HTMLButtonElement,
- React.ComponentProps<"button"> & { asChild?: boolean }
+ React.ComponentPropsWithoutRef<'button'> & { asChild?: boolean }
>(({ className, asChild = false, ...props }, ref) => {
- const Comp = asChild ? Slot : "button"
+ const Comp = asChild ? Slot : 'button'
return (
svg]:size-4 [&>svg]:shrink-0",
+ 'absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
// Increases the hit area of the button on mobile.
- "after:absolute after:-inset-2 after:md:hidden",
- "group-data-[collapsible=icon]:hidden",
+ 'after:absolute after:-inset-2 after:md:hidden',
+ 'group-data-[collapsible=icon]:hidden',
className
)}
{...props}
/>
)
})
-SidebarGroupAction.displayName = "SidebarGroupAction"
+SidebarGroupAction.displayName = 'SidebarGroupAction'
const SidebarGroupContent = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"div">
+ React.ComponentProps<'div'>
>(({ className, ...props }, ref) => (
))
-SidebarGroupContent.displayName = "SidebarGroupContent"
+SidebarGroupContent.displayName = 'SidebarGroupContent'
const SidebarMenu = React.forwardRef<
HTMLUListElement,
- React.ComponentProps<"ul">
+ React.ComponentProps<'ul'>
>(({ className, ...props }, ref) => (
))
-SidebarMenu.displayName = "SidebarMenu"
+SidebarMenu.displayName = 'SidebarMenu'
const SidebarMenuItem = React.forwardRef<
HTMLLIElement,
- React.ComponentProps<"li">
+ React.ComponentProps<'li'>
>(({ className, ...props }, ref) => (
))
-SidebarMenuItem.displayName = "SidebarMenuItem"
+SidebarMenuItem.displayName = 'SidebarMenuItem'
const sidebarMenuButtonVariants = cva(
- "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
+ 'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
{
variants: {
variant: {
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
+ default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
outline:
- "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
+ 'bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]'
},
size: {
- default: "h-8 text-sm",
- sm: "h-7 text-xs",
- lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0",
- },
+ default: 'text-sm',
+ sm: 'text-xs',
+ lg: 'text-sm group-data-[collapsible=icon]:!p-0'
+ }
},
defaultVariants: {
- variant: "default",
- size: "default",
- },
+ variant: 'default',
+ size: 'default'
+ }
}
)
const SidebarMenuButton = React.forwardRef<
HTMLButtonElement,
- React.ComponentProps<"button"> & {
+ React.ComponentPropsWithoutRef<'button'> & {
asChild?: boolean
isActive?: boolean
tooltip?: string | React.ComponentProps
@@ -546,15 +544,15 @@ const SidebarMenuButton = React.forwardRef<
{
asChild = false,
isActive = false,
- variant = "default",
- size = "default",
+ variant = 'default',
+ size = 'default',
tooltip,
className,
...props
},
ref
) => {
- const Comp = asChild ? Slot : "button"
+ const Comp = asChild ? Slot : 'button'
const { isMobile, state } = useSidebar()
const button = (
@@ -572,9 +570,9 @@ const SidebarMenuButton = React.forwardRef<
return button
}
- if (typeof tooltip === "string") {
+ if (typeof tooltip === 'string') {
tooltip = {
- children: tooltip,
+ children: tooltip
}
}
@@ -584,70 +582,70 @@ const SidebarMenuButton = React.forwardRef<
)
}
)
-SidebarMenuButton.displayName = "SidebarMenuButton"
+SidebarMenuButton.displayName = 'SidebarMenuButton'
const SidebarMenuAction = React.forwardRef<
HTMLButtonElement,
- React.ComponentProps<"button"> & {
+ React.ComponentPropsWithoutRef<'button'> & {
asChild?: boolean
showOnHover?: boolean
}
>(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
- const Comp = asChild ? Slot : "button"
+ const Comp = asChild ? Slot : 'button'
return (
svg]:size-4 [&>svg]:shrink-0",
+ 'absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0',
// Increases the hit area of the button on mobile.
- "after:absolute after:-inset-2 after:md:hidden",
- "peer-data-[size=sm]/menu-button:top-1",
- "peer-data-[size=default]/menu-button:top-1.5",
- "peer-data-[size=lg]/menu-button:top-2.5",
- "group-data-[collapsible=icon]:hidden",
+ 'after:absolute after:-inset-2 after:md:hidden',
+ 'peer-data-[size=sm]/menu-button:top-1',
+ 'peer-data-[size=default]/menu-button:top-1.5',
+ 'peer-data-[size=lg]/menu-button:top-2.5',
+ 'group-data-[collapsible=icon]:hidden',
showOnHover &&
- "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",
+ 'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0',
className
)}
{...props}
/>
)
})
-SidebarMenuAction.displayName = "SidebarMenuAction"
+SidebarMenuAction.displayName = 'SidebarMenuAction'
const SidebarMenuBadge = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"div">
+ React.ComponentProps<'div'>
>(({ className, ...props }, ref) => (
))
-SidebarMenuBadge.displayName = "SidebarMenuBadge"
+SidebarMenuBadge.displayName = 'SidebarMenuBadge'
const SidebarMenuSkeleton = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<"div"> & {
+ React.ComponentProps<'div'> & {
showIcon?: boolean
}
>(({ className, showIcon = false, ...props }, ref) => {
@@ -660,7 +658,7 @@ const SidebarMenuSkeleton = React.forwardRef<
{showIcon && (
@@ -674,47 +672,47 @@ const SidebarMenuSkeleton = React.forwardRef<
data-sidebar="menu-skeleton-text"
style={
{
- "--skeleton-width": width,
+ '--skeleton-width': width
} as React.CSSProperties
}
/>
)
})
-SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton"
+SidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton'
const SidebarMenuSub = React.forwardRef<
HTMLUListElement,
- React.ComponentProps<"ul">
+ React.ComponentProps<'ul'>
>(({ className, ...props }, ref) => (
))
-SidebarMenuSub.displayName = "SidebarMenuSub"
+SidebarMenuSub.displayName = 'SidebarMenuSub'
const SidebarMenuSubItem = React.forwardRef<
HTMLLIElement,
- React.ComponentProps<"li">
+ React.ComponentProps<'li'>
>(({ ...props }, ref) => )
-SidebarMenuSubItem.displayName = "SidebarMenuSubItem"
+SidebarMenuSubItem.displayName = 'SidebarMenuSubItem'
const SidebarMenuSubButton = React.forwardRef<
HTMLAnchorElement,
- React.ComponentProps<"a"> & {
+ React.ComponentPropsWithoutRef<'a'> & {
asChild?: boolean
- size?: "sm" | "md"
+ size?: 'sm' | 'md'
isActive?: boolean
}
->(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
- const Comp = asChild ? Slot : "a"
+>(({ asChild = false, size = 'md', isActive, className, ...props }, ref) => {
+ const Comp = asChild ? Slot : 'a'
return (
span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
- "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
- size === "sm" && "text-xs",
- size === "md" && "text-sm",
- "group-data-[collapsible=icon]:hidden",
+ 'flex min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 py-1.5 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',
+ 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',
+ size === 'sm' && 'text-xs',
+ size === 'md' && 'text-sm',
+ 'group-data-[collapsible=icon]:hidden',
className
)}
{...props}
/>
)
})
-SidebarMenuSubButton.displayName = "SidebarMenuSubButton"
+SidebarMenuSubButton.displayName = 'SidebarMenuSubButton'
export {
Sidebar,
@@ -760,5 +758,5 @@ export {
SidebarRail,
SidebarSeparator,
SidebarTrigger,
- useSidebar,
+ useSidebar
}
diff --git a/ee/tabby-ui/lib/hooks/use-server-info.ts b/ee/tabby-ui/lib/hooks/use-server-info.ts
index cde9e4f9751d..a54a6a3bc0e9 100644
--- a/ee/tabby-ui/lib/hooks/use-server-info.ts
+++ b/ee/tabby-ui/lib/hooks/use-server-info.ts
@@ -36,8 +36,7 @@ const useAllowSelfSignup = () => {
}
const useIsDemoMode = () => {
- return true
- // return useServerInfo()?.isDemoMode
+ return useServerInfo()?.isDemoMode
}
export {
diff --git a/ee/tabby-ui/tailwind.config.js b/ee/tabby-ui/tailwind.config.js
index aebaca81980e..0fd7401d4a6c 100644
--- a/ee/tabby-ui/tailwind.config.js
+++ b/ee/tabby-ui/tailwind.config.js
@@ -56,14 +56,14 @@ module.exports = {
foreground: 'hsl(var(--card-foreground))'
},
sidebar: {
- DEFAULT: 'hsl(var(--sidebar-background))',
- foreground: 'hsl(var(--sidebar-foreground))',
- primary: 'hsl(var(--sidebar-primary))',
- 'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
- accent: 'hsl(var(--sidebar-accent))',
- 'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
- border: 'hsl(var(--sidebar-border))',
- ring: 'hsl(var(--sidebar-ring))'
+ DEFAULT: 'hsl(var(--background))',
+ foreground: 'hsl(var(--foreground))',
+ primary: 'hsl(var(--primary))',
+ 'primary-foreground': 'hsl(var(--primary-foreground))',
+ accent: 'hsl(var(--accent))',
+ 'accent-foreground': 'hsl(var(--accent-foreground))',
+ border: 'hsl(var(--border))',
+ ring: 'hsl(var(--ring))'
}
},
borderRadius: {
From 8e25dea4184767884a2b66c3f50e7dc716c2f484 Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Mon, 11 Nov 2024 17:09:19 +0000
Subject: [PATCH 03/10] [autofix.ci] apply automated fixes
---
.../app/(dashboard)/components/sidebar.tsx | 6 ++---
ee/tabby-ui/app/(home)/page.tsx | 2 +-
ee/tabby-ui/components/ui/breadcrumb.tsx | 2 +-
ee/tabby-ui/components/ui/sidebar.tsx | 26 +++++++++----------
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/ee/tabby-ui/app/(dashboard)/components/sidebar.tsx b/ee/tabby-ui/app/(dashboard)/components/sidebar.tsx
index 86a01a745404..3f48aa48e0cb 100644
--- a/ee/tabby-ui/app/(dashboard)/components/sidebar.tsx
+++ b/ee/tabby-ui/app/(dashboard)/components/sidebar.tsx
@@ -146,7 +146,7 @@ export default function AppSidebar() {
<>
-
+
{menus.map(menu => {
if (isAdmin || menu.allowUser) {
@@ -195,7 +195,7 @@ export default function AppSidebar() {
className="w-[theme(space.48)]"
key={menu.title}
>
-
+
{menu.title}
diff --git a/ee/tabby-ui/app/(home)/page.tsx b/ee/tabby-ui/app/(home)/page.tsx
index fa0ef87ee7b3..acb306876ea2 100644
--- a/ee/tabby-ui/app/(home)/page.tsx
+++ b/ee/tabby-ui/app/(home)/page.tsx
@@ -96,7 +96,7 @@ function MainPanel() {
return (
svg]:w-3.5 [&>svg]:h-3.5', className)}
+ className={cn('[&>svg]:h-3.5 [&>svg]:w-3.5', className)}
{...props}
>
{children ?? }
diff --git a/ee/tabby-ui/components/ui/sidebar.tsx b/ee/tabby-ui/components/ui/sidebar.tsx
index 19bb07ad1896..713e4dc68061 100644
--- a/ee/tabby-ui/components/ui/sidebar.tsx
+++ b/ee/tabby-ui/components/ui/sidebar.tsx
@@ -140,7 +140,7 @@ const SidebarProvider = React.forwardRef<
} as React.CSSProperties
}
className={cn(
- 'group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar',
+ 'group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex w-full',
className
)}
ref={ref}
@@ -214,7 +214,7 @@ const Sidebar = React.forwardRef<
return (
-
+
Toggle Sidebar
)
@@ -438,7 +438,7 @@ const SidebarGroupLabel = React.forwardRef<
ref={ref}
data-sidebar="group-label"
className={cn(
- 'duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
+ '[&>svg]:size-4 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:shrink-0',
'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',
className
)}
@@ -459,7 +459,7 @@ const SidebarGroupAction = React.forwardRef<
ref={ref}
data-sidebar="group-action"
className={cn(
- 'absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
+ '[&>svg]:size-4 absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:shrink-0',
// Increases the hit area of the button on mobile.
'after:absolute after:-inset-2 after:md:hidden',
'group-data-[collapsible=icon]:hidden',
@@ -511,7 +511,7 @@ const SidebarMenuItem = React.forwardRef<
SidebarMenuItem.displayName = 'SidebarMenuItem'
const sidebarMenuButtonVariants = cva(
- 'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
+ 'peer/menu-button group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[collapsible=icon]:!size-8 [&>svg]:size-4 flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:shrink-0',
{
variants: {
variant: {
@@ -605,7 +605,7 @@ const SidebarMenuAction = React.forwardRef<
ref={ref}
data-sidebar="menu-action"
className={cn(
- 'absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0',
+ '[&>svg]:size-4 absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:shrink-0',
// Increases the hit area of the button on mobile.
'after:absolute after:-inset-2 after:md:hidden',
'peer-data-[size=sm]/menu-button:top-1',
@@ -630,7 +630,7 @@ const SidebarMenuBadge = React.forwardRef<
ref={ref}
data-sidebar="menu-badge"
className={cn(
- 'absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none',
+ 'min-w-5 pointer-events-none absolute right-1 flex h-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground',
'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',
'peer-data-[size=sm]/menu-button:top-1',
'peer-data-[size=default]/menu-button:top-1.5',
@@ -658,7 +658,7 @@ const SidebarMenuSkeleton = React.forwardRef<
{showIcon && (
@@ -668,7 +668,7 @@ const SidebarMenuSkeleton = React.forwardRef<
/>
)}
span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',
+ '[&>svg]:size-4 flex min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 py-1.5 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',
'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',
size === 'sm' && 'text-xs',
size === 'md' && 'text-sm',
From c00a459b5701bbf3a54bcfafb7653e48b5732eb2 Mon Sep 17 00:00:00 2001
From: liangfung
Date: Tue, 12 Nov 2024 01:16:46 +0700
Subject: [PATCH 04/10] remove breadcrumb
---
ee/tabby-ui/components/ui/breadcrumb.tsx | 115 -----------------------
1 file changed, 115 deletions(-)
delete mode 100644 ee/tabby-ui/components/ui/breadcrumb.tsx
diff --git a/ee/tabby-ui/components/ui/breadcrumb.tsx b/ee/tabby-ui/components/ui/breadcrumb.tsx
deleted file mode 100644
index 6c3b830d37a8..000000000000
--- a/ee/tabby-ui/components/ui/breadcrumb.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-import * as React from 'react'
-import { Slot } from '@radix-ui/react-slot'
-import { ChevronRight, MoreHorizontal } from 'lucide-react'
-
-import { cn } from '@/lib/utils'
-
-const Breadcrumb = React.forwardRef<
- HTMLElement,
- React.ComponentPropsWithoutRef<'nav'> & {
- separator?: React.ReactNode
- }
->(({ ...props }, ref) => )
-Breadcrumb.displayName = 'Breadcrumb'
-
-const BreadcrumbList = React.forwardRef<
- HTMLOListElement,
- React.ComponentPropsWithoutRef<'ol'>
->(({ className, ...props }, ref) => (
-
-))
-BreadcrumbList.displayName = 'BreadcrumbList'
-
-const BreadcrumbItem = React.forwardRef<
- HTMLLIElement,
- React.ComponentPropsWithoutRef<'li'>
->(({ className, ...props }, ref) => (
-
-))
-BreadcrumbItem.displayName = 'BreadcrumbItem'
-
-const BreadcrumbLink = React.forwardRef<
- HTMLAnchorElement,
- React.ComponentPropsWithoutRef<'a'> & {
- asChild?: boolean
- }
->(({ asChild, className, ...props }, ref) => {
- const Comp = asChild ? Slot : 'a'
-
- return (
-
- )
-})
-BreadcrumbLink.displayName = 'BreadcrumbLink'
-
-const BreadcrumbPage = React.forwardRef<
- HTMLSpanElement,
- React.ComponentPropsWithoutRef<'span'>
->(({ className, ...props }, ref) => (
-
-))
-BreadcrumbPage.displayName = 'BreadcrumbPage'
-
-const BreadcrumbSeparator = ({
- children,
- className,
- ...props
-}: React.ComponentProps<'li'>) => (
- svg]:h-3.5 [&>svg]:w-3.5', className)}
- {...props}
- >
- {children ?? }
-
-)
-BreadcrumbSeparator.displayName = 'BreadcrumbSeparator'
-
-const BreadcrumbEllipsis = ({
- className,
- ...props
-}: React.ComponentProps<'span'>) => (
-
-
- More
-
-)
-BreadcrumbEllipsis.displayName = 'BreadcrumbElipssis'
-
-export {
- Breadcrumb,
- BreadcrumbList,
- BreadcrumbItem,
- BreadcrumbLink,
- BreadcrumbPage,
- BreadcrumbSeparator,
- BreadcrumbEllipsis
-}
From d23a0e2decc7162f768e2ac058edc0b5cc6f82bf Mon Sep 17 00:00:00 2001
From: liangfung
Date: Tue, 12 Nov 2024 15:27:40 +0700
Subject: [PATCH 05/10] update
---
.../activities/components/activity.tsx | 4 ++--
.../app/(dashboard)/components/main-content.tsx | 17 ++++++++++++++---
.../(dashboard)/reports/components/report.tsx | 2 +-
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/ee/tabby-ui/app/(dashboard)/activities/components/activity.tsx b/ee/tabby-ui/app/(dashboard)/activities/components/activity.tsx
index 33a03bd83036..961bc53dcc63 100644
--- a/ee/tabby-ui/app/(dashboard)/activities/components/activity.tsx
+++ b/ee/tabby-ui/app/(dashboard)/activities/components/activity.tsx
@@ -144,9 +144,9 @@ export default function Activity() {
return (
<>
-
+
-
+
{`View raw events generated by team members' activities while interacting with Tabby.`}
{members.length > 0 && (
diff --git a/ee/tabby-ui/app/(dashboard)/components/main-content.tsx b/ee/tabby-ui/app/(dashboard)/components/main-content.tsx
index 665c9341e5b8..16ec9275b139 100644
--- a/ee/tabby-ui/app/(dashboard)/components/main-content.tsx
+++ b/ee/tabby-ui/app/(dashboard)/components/main-content.tsx
@@ -1,5 +1,8 @@
'use client'
+import { useEffect, useRef } from 'react'
+import { usePathname } from 'next/navigation'
+
import { ScrollArea } from '@/components/ui/scroll-area'
import { SidebarInset } from '@/components/ui/sidebar'
import { BANNER_HEIGHT, useShowDemoBanner } from '@/components/demo-banner'
@@ -11,6 +14,8 @@ export default function MainContent({
}: {
children: React.ReactNode
}) {
+ const pathname = usePathname()
+ const scroller = useRef
(null)
const [isShowDemoBanner] = useShowDemoBanner()
const [isShowLicenseBanner] = useShowLicenseBanner()
const style =
@@ -22,11 +27,17 @@ export default function MainContent({
}
: { height: '100vh' }
+ useEffect(() => {
+ if (pathname && scroller.current) {
+ scroller.current.scrollTop = 0
+ }
+ }, [pathname])
+
return (
<>
- {/* Wraps right hand side into ScrollArea, making scroll bar consistent across all browsers */}
-
-
+
+ {/* Wraps right hand side into ScrollArea, making scroll bar consistent across all browsers */}
+
{children}
diff --git a/ee/tabby-ui/app/(dashboard)/reports/components/report.tsx b/ee/tabby-ui/app/(dashboard)/reports/components/report.tsx
index 5b7339e9b119..a384e9869155 100644
--- a/ee/tabby-ui/app/(dashboard)/reports/components/report.tsx
+++ b/ee/tabby-ui/app/(dashboard)/reports/components/report.tsx
@@ -218,7 +218,7 @@ export function Report() {
}
+ fallback={}
>