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 and liangfung committed Jan 10, 2025
1 parent f2f635e commit 81ebc75
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 44 deletions.
2 changes: 1 addition & 1 deletion ee/tabby-ui/app/page/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function Header({ threadIdFromURL, streamingDone }: HeaderProps) {
}

return (
<header className="flex w-full h-16 items-center justify-between px-4 lg:px-10 border-b">
<header className="flex h-16 w-full items-center justify-between border-b px-4 lg:px-10">
<div className="flex items-center gap-x-6">
<Button
variant="ghost"
Expand Down
4 changes: 2 additions & 2 deletions ee/tabby-ui/app/page/components/nav-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ export const Navbar = ({ qaPairs }: Props) => {
}, [])

return (
<nav className="sticky top-0 right-0 p-4">
<nav className="sticky right-0 top-0 p-4">
<ul className="flex flex-col space-y-1">
{sections.map(section => (
<li key={section.id}>
<div
className={`text-sm truncate whitespace-nowrap ${
className={`truncate whitespace-nowrap text-sm ${
activeNavItem === section.id
? 'text-foreground'
: 'text-muted-foreground'
Expand Down
25 changes: 7 additions & 18 deletions ee/tabby-ui/app/page/components/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
useState
} from 'react'
import Link from 'next/link'
import { useRouter } from 'next/navigation'
import slugify from '@sindresorhus/slugify'
import { compact, pick, some, uniq, uniqBy } from 'lodash-es'
import { nanoid } from 'nanoid'
Expand Down Expand Up @@ -64,25 +63,15 @@ import {
} from '@/lib/utils'
import { Button, buttonVariants } from '@/components/ui/button'
import {
IconCheck,
IconClock,
IconEdit,
IconEye,
IconFileSearch,
IconInfoCircled,
IconList,
IconListFilter,
IconPlus,
IconShare,
IconSheet,
IconStop
} from '@/components/ui/icons'
import { ScrollArea } from '@/components/ui/scroll-area'
import {
Tooltip,
TooltipContent,
TooltipTrigger
} from '@/components/ui/tooltip'
import { ButtonScrollToBottom } from '@/components/button-scroll-to-bottom'
import { BANNER_HEIGHT, useShowDemoBanner } from '@/components/demo-banner'
import { MessageMarkdown } from '@/components/message-markdown'
Expand Down Expand Up @@ -790,16 +779,16 @@ export function Page() {
<Header threadIdFromURL={threadIdFromURL} streamingDone={!isLoading} />
<main className="h-[calc(100%-4rem)] pb-8 lg:pb-0">
<ScrollArea className="h-full w-full" ref={contentContainerRef}>
<div className="grid grid-cols-4 mx-auto px-4 pb-32 lg:max-w-5xl lg:px-0 gap-2">
<div className="mx-auto grid grid-cols-4 gap-2 px-4 pb-32 lg:max-w-5xl lg:px-0">
<div className="col-span-3">
{/* page title */}
<div className="mb-2 mt-4">
<h1 className="text-4xl font-semibold">
Tailwindcss in TabbyML
</h1>
<div className="flex justify-between text-muted-foreground text-sm my-4">
<div className="my-4 flex justify-between text-sm text-muted-foreground">
<div className="flex items-center gap-1">
<MyAvatar className="w-6 h-6" />
<MyAvatar className="h-6 w-6" />
<div>{meData?.me?.name}</div>
</div>
<div className="flex items-center gap-3">
Expand Down Expand Up @@ -832,7 +821,7 @@ export function Page() {
<Fragment key={pair.question.id}>
{!!pair.question && (
<SectionTitle
className="pt-8 section-title"
className="section-title pt-8"
key={pair.question.id}
message={pair.question}
/>
Expand All @@ -859,7 +848,7 @@ export function Page() {
})}
</div>
{mode === 'edit' && (
<div className="border rounded-xl p-2">
<div className="rounded-xl border p-2">
<div className="flex items-center gap-1">
<Button size="icon" variant="ghost">
<IconList />
Expand All @@ -870,7 +859,7 @@ export function Page() {
</div>
<TextAreaSearch
onSearch={onSubmitSearch}
className="min-h-[5rem] lg:max-w-5xl border-0"
className="min-h-[5rem] border-0 lg:max-w-5xl"
placeholder="What is the section about?"
isFollowup
isLoading={isLoading}
Expand All @@ -884,7 +873,7 @@ export function Page() {
</div>
)}
</div>
<div className="col-span-1 relative">
<div className="relative col-span-1">
<Navbar qaPairs={qaPairs} />
</div>
</div>
Expand Down
30 changes: 9 additions & 21 deletions ee/tabby-ui/app/page/components/section-content.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { MouseEventHandler, useContext, useMemo, useState } from 'react'
import { useContext, useMemo, useState } from 'react'
import { zodResolver } from '@hookform/resolvers/zod'
import DOMPurify from 'dompurify'
import he from 'he'
Expand Down Expand Up @@ -47,10 +47,7 @@ import {
FormMessage
} from '@/components/ui/form'
import {
IconBlocks,
IconBug,
IconCheckCircled,
IconChevronRight,
IconCircleDot,
IconEdit,
IconGitMerge,
Expand All @@ -59,37 +56,28 @@ import {
IconMore,
IconPlus,
IconRefresh,
IconSparkles,
IconSpinner,
IconTrash
IconSpinner
} from '@/components/ui/icons'
import {
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger
} from '@/components/ui/sheet'
import { Skeleton } from '@/components/ui/skeleton'
import {
Tooltip,
TooltipContent,
TooltipTrigger
} from '@/components/ui/tooltip'
import { ChatContext } from '@/components/chat/chat'
import { CopyButton } from '@/components/copy-button'
import {
ErrorMessageBlock,
MessageMarkdown
} from '@/components/message-markdown'
import { DocDetailView } from '@/components/message-markdown/doc-detail-view'
import { SiteFavicon } from '@/components/site-favicon'
import { UserAvatar } from '@/components/user-avatar'

import { ConversationMessage, PageContext, SOURCE_CARD_STYLE } from './page'
import { ConversationMessage, PageContext } from './page'

export function SectionContent({
className,
Expand Down Expand Up @@ -315,16 +303,16 @@ export function SectionContent({
{sourceLen > 0 && (
<Sheet>
<SheetTrigger asChild>
<div className="border py-1 px-2 rounded-full cursor-pointer">
<div className="cursor-pointer rounded-full border px-2 py-1">
{sourceLen} sources
</div>
</SheetTrigger>
<SheetContent className="w-[50vw] min-w-[300px] flex flex-col">
<SheetContent className="flex w-[50vw] min-w-[300px] flex-col">
<SheetHeader className="border-b">
<SheetTitle>Sources</SheetTitle>
<SheetClose />
</SheetHeader>
<div className="flex-1 overflow-y-auto space-y-3">
<div className="flex-1 space-y-3 overflow-y-auto">
{sources.map((x, index) => {
// FIXME id
return <SourceCard source={x} key={index} />
Expand Down Expand Up @@ -437,7 +425,7 @@ function SourceCard({
<div className="flex items-start gap-2">
{isEditMode && <Checkbox className="mt-2" />}
<div
className="relative flex cursor-pointer flex-col justify-between rounded-lg border bg-card text-card-foreground p-3 hover:bg-card/60"
className="relative flex cursor-pointer flex-col justify-between rounded-lg border bg-card p-3 text-card-foreground hover:bg-card/60"
onClick={() => window.open(source.link)}
>
<DocSourceCard source={source} />
Expand All @@ -447,9 +435,9 @@ function SourceCard({
}

return (
<div className="flex items-start gap-2 w-full">
<div className="flex w-full items-start gap-2">
{isEditMode && <Checkbox className="mt-2" />}
<div className="relative flex flex-1 cursor-pointer flex-col justify-between rounded-lg border bg-card text-card-foreground p-3 hover:bg-card/60">
<div className="relative flex flex-1 cursor-pointer flex-col justify-between rounded-lg border bg-card p-3 text-card-foreground hover:bg-card/60">
<div className="flex flex-1 flex-col justify-between gap-y-1">
<div className="flex flex-col gap-y-0.5">
<p className="line-clamp-1 w-full overflow-hidden text-ellipsis break-all text-xs font-semibold">
Expand Down
4 changes: 2 additions & 2 deletions ee/tabby-ui/app/page/components/section-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function SectionTitle({
const { supportsOnApplyInEditorV2 } = useContext(ChatContext)
return (
<div
className={cn('font-semibold flex items-center gap-2', className)}
className={cn('flex items-center gap-2 font-semibold', className)}
id={message.id}
{...props}
>
Expand All @@ -30,7 +30,7 @@ export function SectionTitle({
contextInfo={undefined}
supportsOnApplyInEditorV2={supportsOnApplyInEditorV2}
fetchingContextInfo={fetchingContextInfo}
className="text-3xl prose-p:mb-1 prose-p:mt-0 prose-h2:text-foreground"
className="text-3xl prose-h2:text-foreground prose-p:mb-1 prose-p:mt-0"
headline
canWrapLongLines
/>
Expand Down

0 comments on commit 81ebc75

Please sign in to comment.