Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 8, 2023
1 parent c4a08c4 commit 7d66532
Show file tree
Hide file tree
Showing 40 changed files with 151 additions and 119 deletions.
7 changes: 4 additions & 3 deletions ee/tabby-ui/app/(dashboard)/components/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use client'

import UserPanel from '@/components/user-panel'
import { cn } from '@/lib/utils'
import { cva } from 'class-variance-authority'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { cva } from 'class-variance-authority'

import { cn } from '@/lib/utils'
import UserPanel from '@/components/user-panel'

export interface SidebarProps {
children: React.ReactNode
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/app/(dashboard)/components/worker-card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CardTitle, CardHeader, CardContent, Card } from '@/components/ui/card'
import { Worker, WorkerKind } from '@/lib/gql/generates/graphql'
import { cn } from '@/lib/utils'
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'

type RunnerType = WorkerKind | 'INDEX'

Expand Down
4 changes: 3 additions & 1 deletion ee/tabby-ui/app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Metadata } from 'next'
import Sidebar from './components/sidebar'

import { Header } from '@/components/header'

import Sidebar from './components/sidebar'

export const metadata: Metadata = {
title: 'Dashboard'
}
Expand Down
18 changes: 10 additions & 8 deletions ee/tabby-ui/app/(dashboard)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
'use client'

import { PropsWithChildren, useEffect, useState } from 'react'

import { graphql } from '@/lib/gql/generates'
import { WorkerKind } from '@/lib/gql/generates/graphql'
import { useHealth } from '@/lib/hooks/use-health'
import { useWorkers } from '@/lib/hooks/use-workers'
import { useSession } from '@/lib/tabby/auth'
import { useGraphQLQuery } from '@/lib/tabby/gql'
import { buttonVariants } from '@/components/ui/button'
import {
Dialog,
Expand All @@ -11,15 +19,9 @@ import {
} from '@/components/ui/dialog'
import { IconSlack } from '@/components/ui/icons'
import { Separator } from '@/components/ui/separator'
import { useHealth } from '@/lib/hooks/use-health'
import { PropsWithChildren, useEffect, useState } from 'react'
import WorkerCard from './components/worker-card'
import { useWorkers } from '@/lib/hooks/use-workers'
import { WorkerKind } from '@/lib/gql/generates/graphql'
import { CopyButton } from '@/components/copy-button'
import { graphql } from '@/lib/gql/generates'
import { useGraphQLQuery } from '@/lib/tabby/gql'
import { useSession } from '@/lib/tabby/auth'

import WorkerCard from './components/worker-card'

const COMMUNITY_DIALOG_SHOWN_KEY = 'community-dialog-shown'

Expand Down
13 changes: 6 additions & 7 deletions ee/tabby-ui/app/auth/signin/components/user-signin-form.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
'use client'

import * as React from 'react'

import { useRouter } from 'next/navigation'
import { zodResolver } from '@hookform/resolvers/zod'
import { useForm } from 'react-hook-form'
import * as z from 'zod'

import { graphql } from '@/lib/gql/generates'
import { useSignIn } from '@/lib/tabby/auth'
import { useGraphQLForm } from '@/lib/tabby/gql'
import { cn } from '@/lib/utils'
import { IconSpinner } from '@/components/ui/icons'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import {
Form,
FormControl,
Expand All @@ -18,10 +19,8 @@ import {
FormLabel,
FormMessage
} from '@/components/ui/form'
import { graphql } from '@/lib/gql/generates'
import { useGraphQLForm } from '@/lib/tabby/gql'
import { useSignIn } from '@/lib/tabby/auth'
import { useRouter } from 'next/navigation'
import { IconSpinner } from '@/components/ui/icons'
import { Input } from '@/components/ui/input'

export const tokenAuth = graphql(/* GraphQL */ `
mutation tokenAuth($email: String!, $password: String!) {
Expand Down
1 change: 1 addition & 0 deletions ee/tabby-ui/app/auth/signin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Metadata } from 'next'

import Signin from './components/signin'

export const metadata: Metadata = {
Expand Down
3 changes: 2 additions & 1 deletion ee/tabby-ui/app/auth/signup/components/signup.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use client'

import { UserAuthForm } from './user-register-form'
import { useSearchParams } from 'next/navigation'

import { UserAuthForm } from './user-register-form'

export default function Signup() {
const searchParams = useSearchParams()
const invitationCode = searchParams.get('invitationCode') || undefined
Expand Down
13 changes: 6 additions & 7 deletions ee/tabby-ui/app/auth/signup/components/user-register-form.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
'use client'

import * as React from 'react'

import { useRouter } from 'next/navigation'
import { zodResolver } from '@hookform/resolvers/zod'
import { useForm } from 'react-hook-form'
import * as z from 'zod'

import { graphql } from '@/lib/gql/generates'
import { useSignIn } from '@/lib/tabby/auth'
import { useGraphQLForm } from '@/lib/tabby/gql'
import { cn } from '@/lib/utils'
import { IconSpinner } from '@/components/ui/icons'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import {
Form,
FormControl,
Expand All @@ -18,10 +19,8 @@ import {
FormLabel,
FormMessage
} from '@/components/ui/form'
import { graphql } from '@/lib/gql/generates'
import { useGraphQLForm } from '@/lib/tabby/gql'
import { useSignIn } from '@/lib/tabby/auth'
import { useRouter } from 'next/navigation'
import { IconSpinner } from '@/components/ui/icons'
import { Input } from '@/components/ui/input'

export const registerUser = graphql(/* GraphQL */ `
mutation register(
Expand Down
1 change: 1 addition & 0 deletions ee/tabby-ui/app/auth/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Metadata } from 'next'

import Signup from './components/signup'

export const metadata: Metadata = {
Expand Down
4 changes: 2 additions & 2 deletions ee/tabby-ui/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Metadata } from 'next'

import { Toaster } from 'react-hot-toast'

import '@/app/globals.css'

import { fontMono, fontSans } from '@/lib/fonts'
import { cn } from '@/lib/utils'
import { TailwindIndicator } from '@/components/tailwind-indicator'
import { Providers } from '@/components/providers'
import { TailwindIndicator } from '@/components/tailwind-indicator'

export const metadata: Metadata = {
title: {
Expand Down
16 changes: 9 additions & 7 deletions ee/tabby-ui/app/playground/components/chat-sessions.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
'use client'

import React from 'react'
import { cn, nanoid } from '@/lib/utils'
import { useChatStore } from '@/lib/stores/chat-store'

import { useStore } from '@/lib/hooks/use-store'
import {
clearChats,
deleteChat,
setActiveChatId
} from '@/lib/stores/chat-actions'
import { useChatStore } from '@/lib/stores/chat-store'
import { cn, nanoid } from '@/lib/utils'
import { Button } from '@/components/ui/button'
import { IconPlus, IconTrash } from '@/components/ui/icons'
import { Separator } from '@/components/ui/separator'
import {
Tooltip,
TooltipContent,
TooltipTrigger
} from '@/components/ui/tooltip'
import { EditChatTitleDialog } from './edit-chat-title-dialog'
import { useStore } from '@/lib/hooks/use-store'
import { Button } from '@/components/ui/button'
import { ListSkeleton } from '@/components/skeleton'
import { Separator } from '@/components/ui/separator'
import { ClearChatsButton } from './clear-chats-button'
import UserPanel from '@/components/user-panel'

import { ClearChatsButton } from './clear-chats-button'
import { EditChatTitleDialog } from './edit-chat-title-dialog'

interface ChatSessionsProps {
className?: string
}
Expand Down
8 changes: 5 additions & 3 deletions ee/tabby-ui/app/playground/components/chats.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
'use client'

import React from 'react'
import { Chat } from '@/components/chat'
import type { Message } from 'ai'

import { useStore } from '@/lib/hooks/use-store'
import { useChatStore } from '@/lib/stores/chat-store'
import { getChatById } from '@/lib/stores/utils'
import { Chat } from '@/components/chat'

import { ChatSessions } from './chat-sessions'
import { useStore } from '@/lib/hooks/use-store'
import type { Message } from 'ai'

const emptyMessages: Message[] = []

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import React from 'react'

import { Button, ButtonProps } from '@/components/ui/button'
import { IconCheck, IconTrash } from '@/components/ui/icons'

Expand Down
14 changes: 7 additions & 7 deletions ee/tabby-ui/app/playground/components/edit-chat-title-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
'use client'

import React from 'react'

import { updateChat } from '@/lib/stores/chat-actions'
import { Button } from '@/components/ui/button'
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogDescription
DialogTitle
} from '@/components/ui/dialog'
import { IconArrowElbow, IconEdit, IconTrash } from '@/components/ui/icons'
import { Input } from '@/components/ui/input'
import {
Tooltip,
TooltipContent,
TooltipTrigger
} from '@/components/ui/tooltip'
import { IconArrowElbow, IconEdit, IconTrash } from '@/components/ui/icons'

import { Input } from '@/components/ui/input'
import { updateChat } from '@/lib/stores/chat-actions'
import { Button } from '@/components/ui/button'

interface EditChatTitleDialogProps {
initialValue: string | undefined
Expand Down
4 changes: 3 additions & 1 deletion ee/tabby-ui/app/playground/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Metadata } from 'next'
import Chats from './components/chats'

import { Header } from '@/components/header'

import Chats from './components/chats'

export const metadata: Metadata = {
title: 'Playground'
}
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/components/button-scroll-to-bottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import * as React from 'react'

import { cn } from '@/lib/utils'
import { useAtBottom } from '@/lib/hooks/use-at-bottom'
import { cn } from '@/lib/utils'
import { Button, type ButtonProps } from '@/components/ui/button'
import { IconArrowDown } from '@/components/ui/icons'

Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/components/chat-list.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type Message } from 'ai'

import { MessageActionType } from '@/lib/types'
import { Separator } from '@/components/ui/separator'
import { ChatMessage } from '@/components/chat-message'
import { MessageActionType } from '@/lib/types'

export interface ChatList {
messages: Message[]
Expand Down
4 changes: 2 additions & 2 deletions ee/tabby-ui/components/chat-message-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { type Message } from 'ai'

import { MessageActionType } from '@/lib/types'
import { cn } from '@/lib/utils'
import { Button } from '@/components/ui/button'
import { IconEdit, IconRefresh, IconTrash } from '@/components/ui/icons'
import { cn } from '@/lib/utils'
import { MessageActionType } from '@/lib/types'
import { CopyButton } from '@/components/copy-button'

interface ChatMessageActionsProps extends React.ComponentProps<'div'> {
Expand Down
6 changes: 3 additions & 3 deletions ee/tabby-ui/components/chat-message.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Inspired by Chatbot-UI and modified to fit the needs of this project
// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Chat/ChatMessage.tsx

import Image from 'next/image'
import { Message } from 'ai'
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'

import { MessageActionType } from '@/lib/types'
import { cn } from '@/lib/utils'
import { CodeBlock } from '@/components/ui/codeblock'
import { MemoizedReactMarkdown } from '@/components/markdown'
import { IconUser } from '@/components/ui/icons'
import Image from 'next/image'
import { ChatMessageActions } from '@/components/chat-message-actions'
import { MessageActionType } from '@/lib/types'
import { MemoizedReactMarkdown } from '@/components/markdown'

export interface ChatMessageProps {
message: Message
Expand Down
9 changes: 5 additions & 4 deletions ee/tabby-ui/components/chat-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react'
import type { UseChatHelpers } from 'ai/react'

import { cn } from '@/lib/utils'
import { Button } from '@/components/ui/button'
import { PromptForm, PromptFormRef } from '@/components/prompt-form'
import { ButtonScrollToBottom } from '@/components/button-scroll-to-bottom'
import { IconRefresh, IconStop } from '@/components/ui/icons'
import { ButtonScrollToBottom } from '@/components/button-scroll-to-bottom'
import { FooterText } from '@/components/footer'
import { cn } from '@/lib/utils'
import type { UseChatHelpers } from 'ai/react'
import { PromptForm, PromptFormRef } from '@/components/prompt-form'

export interface ChatPanelProps
extends Pick<
Expand Down
19 changes: 10 additions & 9 deletions ee/tabby-ui/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

import React from 'react'
import { useChat } from 'ai/react'
import { cn, nanoid, truncateText } from '@/lib/utils'
import { ChatList } from '@/components/chat-list'
import { ChatPanel } from '@/components/chat-panel'
import { EmptyScreen } from '@/components/empty-screen'
import { ChatScrollAnchor } from '@/components/chat-scroll-anchor'
import type { Message } from 'ai/react'
import { find, findIndex } from 'lodash-es'
import { toast } from 'react-hot-toast'

import { usePatchFetch } from '@/lib/hooks/use-patch-fetch'
import { addChat, updateMessages } from '@/lib/stores/chat-actions'
import { find, findIndex } from 'lodash-es'
import { useStore } from '@/lib/hooks/use-store'
import { addChat, updateMessages } from '@/lib/stores/chat-actions'
import { useChatStore } from '@/lib/stores/chat-store'
import { ListSkeleton } from '@/components/skeleton'
import type { MessageActionType } from '@/lib/types'
import type { Message } from 'ai/react'
import { cn, nanoid, truncateText } from '@/lib/utils'
import { ChatList } from '@/components/chat-list'
import { ChatPanel } from '@/components/chat-panel'
import { ChatScrollAnchor } from '@/components/chat-scroll-anchor'
import { EmptyScreen } from '@/components/empty-screen'
import { ListSkeleton } from '@/components/skeleton'

export interface ChatProps extends React.ComponentProps<'div'> {
initialMessages?: Message[]
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/components/clear-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useRouter } from 'next/navigation'
import { toast } from 'react-hot-toast'

import { ServerActionResult } from '@/lib/types'
import { Button } from '@/components/ui/button'
import {
AlertDialog,
AlertDialogAction,
Expand All @@ -17,6 +16,7 @@ import {
AlertDialogTitle,
AlertDialogTrigger
} from '@/components/ui/alert-dialog'
import { Button } from '@/components/ui/button'
import { IconSpinner } from '@/components/ui/icons'

interface ClearHistoryProps {
Expand Down
Loading

0 comments on commit 7d66532

Please sign in to comment.