misc: provider icons, tooltip in chat toolbar, conditionally display the "Open Skills Folder" button and update "Documentation" to "Website" in settings (#60)

This commit is contained in:
Felix
2026-02-12 11:11:28 +08:00
committed by GitHub
Unverified
parent 2ae4201639
commit 8ab1b3af36
26 changed files with 206 additions and 82 deletions

View File

@@ -5,8 +5,10 @@
*/
import { RefreshCw, Brain, ChevronDown, Plus } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
import { useChatStore } from '@/stores/chat';
import { cn } from '@/lib/utils';
import { useTranslation } from 'react-i18next';
export function ChatToolbar() {
const sessions = useChatStore((s) => s.sessions);
@@ -17,6 +19,7 @@ export function ChatToolbar() {
const loading = useChatStore((s) => s.loading);
const showThinking = useChatStore((s) => s.showThinking);
const toggleThinking = useChatStore((s) => s.toggleThinking);
const { t } = useTranslation('chat');
const handleSessionChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
switchSession(e.target.value);
@@ -51,41 +54,59 @@ export function ChatToolbar() {
</div>
{/* New Session */}
<Button
variant="ghost"
size="icon"
className="h-8 w-8"
onClick={newSession}
title="New session"
>
<Plus className="h-4 w-4" />
</Button>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="ghost"
size="icon"
className="h-8 w-8"
onClick={newSession}
>
<Plus className="h-4 w-4" />
</Button>
</TooltipTrigger>
<TooltipContent>
<p>{t('toolbar.newSession')}</p>
</TooltipContent>
</Tooltip>
{/* Refresh */}
<Button
variant="ghost"
size="icon"
className="h-8 w-8"
onClick={() => refresh()}
disabled={loading}
title="Refresh chat"
>
<RefreshCw className={cn('h-4 w-4', loading && 'animate-spin')} />
</Button>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="ghost"
size="icon"
className="h-8 w-8"
onClick={() => refresh()}
disabled={loading}
>
<RefreshCw className={cn('h-4 w-4', loading && 'animate-spin')} />
</Button>
</TooltipTrigger>
<TooltipContent>
<p>{t('toolbar.refresh')}</p>
</TooltipContent>
</Tooltip>
{/* Thinking Toggle */}
<Button
variant="ghost"
size="icon"
className={cn(
'h-8 w-8',
showThinking && 'bg-primary/10 text-primary',
)}
onClick={toggleThinking}
title={showThinking ? 'Hide thinking' : 'Show thinking'}
>
<Brain className="h-4 w-4" />
</Button>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="ghost"
size="icon"
className={cn(
'h-8 w-8',
showThinking && 'bg-primary/10 text-primary',
)}
onClick={toggleThinking}
>
<Brain className="h-4 w-4" />
</Button>
</TooltipTrigger>
<TooltipContent>
<p>{showThinking ? t('toolbar.hideThinking') : t('toolbar.showThinking')}</p>
</TooltipContent>
</Tooltip>
</div>
);
}