Smart auto (#476)

This commit is contained in:
Will Chen
2025-06-23 23:08:29 -07:00
committed by GitHub
parent 3041563809
commit 5d678c2ead
10 changed files with 490 additions and 52 deletions

View File

@@ -1,4 +1,4 @@
import type { LargeLanguageModel } from "@/lib/schemas";
import { isDyadProEnabled, type LargeLanguageModel } from "@/lib/schemas";
import { Button } from "@/components/ui/button";
import {
Tooltip,
@@ -119,6 +119,8 @@ export function ModelPicker() {
return null;
}
const selectedModel = settings?.selectedModel;
const isSmartAutoEnabled =
settings.enableProSmartFilesContextMode && isDyadProEnabled(settings);
const modelDisplayName = getModelDisplayName();
return (
@@ -190,21 +192,37 @@ export function ModelPicker() {
>
<div className="flex justify-between items-start w-full">
<span className="flex flex-col items-start">
<span>{model.displayName}</span>
<span className="text-xs text-muted-foreground">
auto
<span>
{isSmartAutoEnabled
? "Smart Auto"
: model.displayName}
</span>
</span>
{model.tag && (
<span className="text-[10px] bg-primary/10 text-primary px-1.5 py-0.5 rounded-full font-medium">
{model.tag}
</span>
)}
<div className="flex items-center gap-1.5">
{isSmartAutoEnabled && (
<span className="text-[10px] bg-gradient-to-r from-indigo-600 via-indigo-500 to-indigo-600 bg-[length:200%_100%] animate-[shimmer_5s_ease-in-out_infinite] text-white px-1.5 py-0.5 rounded-full font-medium">
Dyad Pro
</span>
)}
{model.tag && (
<span className="text-[10px] bg-primary/10 text-primary px-1.5 py-0.5 rounded-full font-medium">
{model.tag}
</span>
)}
</div>
</div>
</DropdownMenuItem>
</TooltipTrigger>
<TooltipContent side="right">
{model.description}
{isSmartAutoEnabled ? (
<p>
<strong>Smart Auto</strong> uses a cheaper model for
easier tasks
<br /> and a flagship model for harder tasks
</p>
) : (
model.description
)}
</TooltipContent>
</Tooltip>
))}