Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
chore: revert back starter screen
Faisal Amira1477096a157
diff --git a/web-app/src/containers/SetupScreen.tsx b/web-app/src/containers/SetupScreen.tsxindex 1bf2e47df..1946e6155 100644--- a/web-app/src/containers/SetupScreen.tsx+++ b/web-app/src/containers/SetupScreen.tsx@@ -19,11 +19,7 @@ import { IconEye, IconSquareCheck } from '@tabler/icons-react'import { cn } from '@/lib/utils'import { useGeneralSetting } from '@/hooks/useGeneralSetting'import HeaderPage from './HeaderPage'-import { DownloadIcon, PanelLeft, ArrowRight, PlusIcon } from 'lucide-react'-import { Skeleton } from '@/components/ui/skeleton'import { useThreads } from '@/hooks/useThreads'-import { ACCENT_COLORS, type AccentColorValue, useInterfaceSettings } from '@/hooks/useInterfaceSettings'-import { useTheme } from '@/hooks/useTheme'type CacheEntry = {status: 'RED' | 'YELLOW' | 'GREEN' | 'GREY'@@ -86,74 +82,6 @@ function setCachedSupport(loadCacheFromStorage()-const TYPING_PROMPTS = [- 'Plan a 5-day trip to Taiwan',- 'Create character ideas for a novel',- 'Suggest unit tests for this function',- 'Give me startup name ideas',- 'How can I sleep better?',- 'Make a pros and cons list',- 'What assumptions does this implementation make?',-]--function SetupChatInputPreview() {- const [displayed, setDisplayed] = useState('')- const [promptIndex, setPromptIndex] = useState(0)- const [charIndex, setCharIndex] = useState(0)- const [isDeleting, setIsDeleting] = useState(false)- const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)-- useEffect(() => {- const current = TYPING_PROMPTS[promptIndex]- if (!isDeleting) {- if (charIndex < current.length) {- timeoutRef.current = setTimeout(() => {- setDisplayed(current.slice(0, charIndex + 1))- setCharIndex((c) => c + 1)- }, 45)- } else {- timeoutRef.current = setTimeout(() => setIsDeleting(true), 1800)- }- } else {- if (charIndex > 0) {- timeoutRef.current = setTimeout(() => {- setDisplayed(current.slice(0, charIndex - 1))- setCharIndex((c) => c - 1)- }, 22)- } else {- setIsDeleting(false)- setPromptIndex((i) => (i + 1) % TYPING_PROMPTS.length)- }- }- return () => { if (timeoutRef.current) clearTimeout(timeoutRef.current) }- }, [charIndex, isDeleting, promptIndex])-- return (- <div className='relative z-10 w-full max-w-lg px-6'>- <div className='relative overflow-hidden p-0.5 rounded-3xl'>- <div className='relative z-20 px-0 pb-10 border rounded-3xl border-input bg-background backdrop-blur-sm'>- <div className='pt-4 px-4 min-h-14 text-sm text-foreground/80'>- {displayed}- <span className='inline-block w-0.5 h-4 ml-0.5 bg-foreground/60 animate-pulse align-middle' />- </div>- </div>- <div className='absolute z-20 bottom-0 w-full p-2'>- <div className='flex justify-between items-center'>- <div className='px-1 flex items-center gap-1'>- <div className='p-1 rounded-full bg-secondary size-7 flex items-center justify-center opacity-50'>- <PlusIcon size={16} className='text-muted-foreground' />- </div>- </div>- <div className='rounded-full bg-primary size-7 flex items-center justify-center mr-1 mb-1 opacity-50'>- <ArrowRight size={16} className='text-primary-foreground' />- </div>- </div>- </div>- </div>- </div>- )-}-function SetupScreen() {const { t } = useTranslation()const navigate = useNavigate()@@ -174,12 +102,6 @@ function SetupScreen() {const checkedModelId = useRef<string | null>(null)const [isSupportCheckComplete, setIsSupportCheckComplete] = useState(false)const huggingfaceToken = useGeneralSetting((state) => state.huggingfaceToken)- const globalTheme = useTheme((s) => s.activeTheme)- const setGlobalTheme = useTheme((s) => s.setTheme)- const globalAccentColor = useInterfaceSettings((s) => s.accentColor)- const setGlobalAccentColor = useInterfaceSettings((s) => s.setAccentColor)- const [pendingTheme, setPendingTheme] = useState<AppTheme>(globalTheme)- const [pendingAccentColor, setPendingAccentColor] = useState<AccentColorValue>(globalAccentColor)const { createThread } = useThreads()const threadCheckedRef = useRef(false)const defaultThreadIdRef = useRef<string | null>(null)@@ -597,6 +519,23 @@ function SetupScreen() {)}, [defaultVariant, localDownloadingModels, downloadProcesses])+ const downloadedSize = useMemo(() => {+ if (!defaultVariant) return { current: 0, total: 0 }+ const process = downloadProcesses.find(+ (e) => e.id === defaultVariant.model_id+ )+ return {+ current: process?.current || 0,+ total: process?.total || 0,+ }+ }, [defaultVariant, downloadProcesses])++ const formatBytes = (bytes: number) => {+ if (bytes === 0) return '0'+ const gb = bytes / (1024 * 1024 * 1024)+ return gb.toFixed(1)+ }+const isDownloaded = useMemo(() => {if (!defaultVariant) return falsereturn llamaProvider?.models.some(@@ -763,173 +702,76 @@ function SetupScreen() {<HeaderPage /><div className="flex h-[calc(100%-60px)] items-center">- <div className="shrink-0 px-10 w-[480px] overflow-auto pb-10 pointer-events-auto -mt-20">+ <div className="shrink-0 px-10 w-[480px] mx-auto overflow-auto pb-10 pointer-events-auto -mt-20"><div className="mb-4"><h1 className="font-studio font-medium text-2xl mb-1">- {isDownloading ? 'While Jan gets ready...' : 'Hey, welcome to Jan!'}+ {isDownloading ? 'Sit tight, Jan is getting ready...' : 'Hey, welcome to Jan!'}</h1>- <p className='text-muted-foreground leading-normal w-full mt-1'>{isDownloading ? 'Explore the app or choose your theme.' : 'Jan needs a model to begin. Let’s set it up.'}</p>+ <p className='text-muted-foreground leading-normal w-full mt-1'>{isDownloading ? 'This may take a few minutes.' : 'Jan needs a model to begin. Let’s set it up.'}</p></div>-- {isDownloading ?- <div className='mt-8 space-y-6'>- <div className='space-y-2.5'>- <div className='text-muted-foreground text-sm'>Accent color</div>- <div className='flex gap-2 flex-wrap'>- {ACCENT_COLORS.map((color) => (- <button- key={color.value}- onClick={() => setPendingAccentColor(color.value)}- className={cn(- 'size-6 rounded-full ring-offset-background ring-offset-2 transition-all',- pendingAccentColor === color.value && 'ring-2 ring-foreground'- )}- style={{ backgroundColor: color.thumb }}- title={color.name}- />- ))}- </div>- </div>- <div className='space-y-2.5'>- <div className='text-muted-foreground text-sm'>Color system</div>- <div className='space-y-2'>- {(['auto', 'light', 'dark'] as const).map((theme) => (- <button- key={theme}- onClick={() => setPendingTheme(theme)}- className={cn(- 'w-full flex items-center gap-3 px-3 py-4 rounded-lg border text-sm transition-all text-left',- pendingTheme === theme ? 'border-primary/50' : 'border-input hover:border-muted-foreground'- )}- >- <span className={cn(- 'size-4 rounded-full border-2 flex items-center justify-center shrink-0',- pendingTheme === theme ? 'border-primary' : 'border-muted-foreground/50'- )}>- {pendingTheme === theme && <span className='size-2 rounded-full bg-primary' />}- </span>- <span className='capitalize'>{theme === 'auto' ? 'System' : theme}</span>- </button>- ))}- </div>+ <div className="flex gap-4 flex-col mt-6 relative z-50">+ <div+ className="w-full text-left"+ >+ <span className='mb-2 block text-sm font-medium'>Recommended model</span>+ <div className={cn("bg-secondary/50 p-3 rounded-lg border transition-all hover:shadow disabled:opacity-60 flex justify-between items-start")}>+ <div className="flex w-full items-start gap-4">+ <div className="shrink-0 size-12 bg-background rounded-xl flex items-center justify-center">+ <img src="/images/jan-logo.png" alt="Jan Logo" className='size-6' /></div>- <div className='flex gap-2'>- <Button size='sm' className='flex-1' onClick={() => {- setGlobalTheme(pendingTheme)- setGlobalAccentColor(pendingAccentColor)- }}>- Apply- </Button>- </div>- </div>- :- <div className="flex gap-4 flex-col mt-6 relative z-50">- <div- className="w-full text-left"- >- <span className='mb-2 block text-sm font-medium'>Recommended model</span>- <div className={cn("bg-secondary/50 p-3 rounded-lg border transition-all hover:shadow disabled:opacity-60 flex justify-between items-start")}>- <div className="flex items-start gap-4">- <div className="shrink-0 size-12 bg-background rounded-xl flex items-center justify-center">- <img src="/images/jan-logo.png" alt="Jan Logo" className='size-6' />- </div>- <div className="flex-1">+ <div className="flex flex-col w-full h-full justify-center">+ <div className="flex flex-1 items-center justify-between"><h1 className="font-semibold text-sm mb-1"><span>Jan v3</span> <span className='text-xs text-muted-foreground'>· {defaultVariant?.file_size}</span></h1>- <div className="text-muted-foreground text-sm mt-1.5">- <span className="inline-flex items-center gap-1 px-2 py-0.5 bg-secondary text-xs rounded-full mr-1">- <IconSquareCheck size={12} />- General- </span>- {(janNewModel?.mmproj_models?.length ?? 0) > 0 && <span className="inline-flex items-center gap-1 px-2 py-0.5 bg-secondary text-xs rounded-full">- <IconEye size={12} />- Vision- </span>}- </div>+ {(isDownloading) && (+ <div className="flex items-center gap-1.5 text-xs text-muted-foreground">+ <svg+ className="size-3 animate-spin"+ viewBox="0 0 24 24"+ fill="none"+ >+ <circle+ className="opacity-25"+ cx="12"+ cy="12"+ r="10"+ stroke="currentColor"+ strokeWidth="4"+ />+ <path+ className="opacity-75"+ fill="currentColor"+ d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"+ />+ </svg>+ <span>{formatBytes(downloadedSize.current)} / {formatBytes(downloadedSize.total)}GB</span>+ </div>+ )}++ </div>+ <div className="text-muted-foreground text-sm mt-1.5 ">+ <span className="inline-flex items-center gap-1 px-2 py-0.5 bg-secondary text-xs rounded-full mr-1">+ <IconSquareCheck size={12} />+ General+ </span>+ {(janNewModel?.mmproj_models?.length ?? 0) > 0 && <span className="inline-flex items-center gap-1 px-2 py-0.5 bg-secondary text-xs rounded-full">+ <IconEye size={12} />+ Vision+ </span>}</div></div></div>- <div className="flex flex-col relative z-50 items-start gap-2 mt-4">- {!isDownloading &&- <Button size="sm" className='w-full' disabled={isDownloading} onClick={handleQuickStart}>- Download- </Button>}- </div>+ </div>+ <div className="flex flex-col relative z-50 items-start gap-2 mt-4">+ <Button size="sm" disabled={isDownloading} onClick={handleQuickStart} className='flex items-center gap-2 w-full'>+ {isDownloading ? 'Downloading' : 'Download'}+ </Button></div></div>- }- </div>-- {!isDownloading && (- <div className='w-full -top-7.5 -left-2 h-[calc(100%+42px)] relative flex items-center justify-center overflow-hidden rounded-2xl'>- {/* Gradient background */}- <img src='/images/onboarding-gradient.png' className='absolute inset-0 w-full h-full object-cover' />- {/* Noise texture overlay */}- <div className='absolute inset-0 opacity-30' style={{ backgroundImage: 'url("data:image/svg+xml,%3Csvg viewBox=\'0 0 256 256\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Cfilter id=\'noise\'%3E%3CfeTurbulence type=\'fractalNoise\' baseFrequency=\'0.9\' numOctaves=\'4\' stitchTiles=\'stitch\'/%3E%3C/filter%3E%3Crect width=\'100%25\' height=\'100%25\' filter=\'url(%23noise)\'/%3E%3C/svg%3E")', backgroundSize: '128px 128px' }} />- {/* Static ChatInput preview with typing animation */}- <SetupChatInputPreview /></div>- )}-- {isDownloading && (() => {- const previewIsDark = pendingTheme === 'dark' || (pendingTheme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches)- const colorObj = ACCENT_COLORS.find(c => c.value === pendingAccentColor) ?? ACCENT_COLORS[0]- const contentBg = previewIsDark ? '#111111' : '#ffffff'- const sidebarFrom = previewIsDark ? colorObj.sidebar.dark : colorObj.sidebar.light- const sidebarBg = `linear-gradient(to bottom, ${sidebarFrom}, ${contentBg})`- const skStyle = { background: previewIsDark ? 'rgba(255,255,255,0.12)' : 'rgba(0,0,0,0.09)' }- const mutedText = previewIsDark ? 'rgba(255,255,255,0.4)' : 'rgba(0,0,0,0.35)'- const borderCol = previewIsDark ? 'rgba(255,255,255,0.08)' : 'rgba(0,0,0,0.08)'- return (- <div className='border-l border-t w-full mt-2 rounded-tl-2xl h-full p-2 relative transition-colors duration-300' style={{ background: contentBg }}>- <div className='bg-clip-padding w-60 h-full rounded-xl shadow transition-colors duration-300' style={{ background: sidebarBg, borderColor: borderCol }}>- <div className='w-full p-4 pb-0 flex justify-between items-center'>- {IS_MACOS ?- <div className="flex gap-1.5">- <div className="size-2.5 rounded-full" style={{ background: mutedText }} />- <div className="size-2.5 rounded-full" style={{ background: mutedText }} />- <div className="size-2.5 rounded-full" style={{ background: mutedText }} />- </div>- :- <div>- <span className="font-studio font-medium" style={{ color: mutedText }}>Jan</span>- </div>}- <div className="flex gap-2.5" style={{ color: mutedText }}>- <DownloadIcon className="size-3" />- <PanelLeft className="size-3" />- </div>- </div>+ </div>- <div className="p-4 space-y-4">- <div className="space-y-2">- <Skeleton className="w-20 h-2" style={skStyle} />- <ul className="space-y-2">- <li className="flex items-center gap-2"><Skeleton className="size-4" style={skStyle} /><Skeleton className="w-20 h-2" style={skStyle} /></li>- <li className="flex items-center gap-2"><Skeleton className="size-4" style={skStyle} /><Skeleton className="w-28 h-2" style={skStyle} /></li>- <li className="flex items-center gap-2"><Skeleton className="size-4" style={skStyle} /><Skeleton className="w-32 h-2" style={skStyle} /></li>- </ul>- </div>- <div className="space-y-2">- <Skeleton className="w-20 h-2" style={skStyle} />- <ul className="space-y-2">- <li className="flex items-center gap-2"><Skeleton className="size-4" style={skStyle} /><Skeleton className="w-20 h-2" style={skStyle} /></li>- <li className="flex items-center gap-2"><Skeleton className="size-4" style={skStyle} /><Skeleton className="w-28 h-2" style={skStyle} /></li>- </ul>- </div>- <div className="space-y-2">- <Skeleton className="w-20 h-2" style={skStyle} />- <ul className="space-y-2">- <li><Skeleton className="w-36 h-2" style={skStyle} /></li>- <li><Skeleton className="w-28 h-2" style={skStyle} /></li>- <li><Skeleton className="w-36 h-2" style={skStyle} /></li>- </ul>- </div>- </div>- </div>- </div>- )- })()}</div></div></div>