feat: enhance welcome component and input box with skill mode handling and localization updates

This commit is contained in:
Henry Li
2026-02-02 14:44:23 +08:00
parent ccf21238af
commit f4f16bfa5c
5 changed files with 33 additions and 9 deletions

View File

@@ -9,6 +9,7 @@ import {
PlusIcon,
ZapIcon,
} from "lucide-react";
import { useSearchParams } from "next/navigation";
import { useCallback, useMemo, useState, type ComponentProps } from "react";
import {
@@ -96,6 +97,7 @@ export function InputBox({
onStop?: () => void;
}) {
const { t } = useI18n();
const searchParams = useSearchParams();
const [modelDialogOpen, setModelDialogOpen] = useState(false);
const { models } = useModels();
const selectedModel = useMemo(() => {
@@ -347,7 +349,7 @@ export function InputBox({
/>
</PromptInputTools>
</PromptInputFooter>
{isNewThread && (
{isNewThread && searchParams.get("mode") !== "skill" && (
<div className="absolute right-0 -bottom-12 left-0 z-0 flex items-center justify-center">
<SuggestionList />
</div>

View File

@@ -17,16 +17,28 @@ export function Welcome({ className }: { className?: string }) {
>
<div className="text-2xl font-bold">
{searchParams.get("mode") === "skill"
? `🚀 ${t.settings.skills.createSkill}`
? ` ${t.welcome.createYourOwnSkill}`
: t.welcome.greeting}
</div>
<div className="text-muted-foreground text-sm">
{t.welcome.description.includes("\n") ? (
<pre className="whitespace-pre">{t.welcome.description}</pre>
) : (
<p>{t.welcome.description}</p>
)}
</div>
{searchParams.get("mode") === "skill" ? (
<div className="text-muted-foreground text-sm">
{t.welcome.createYourOwnSkillDescription.includes("\n") ? (
<pre className="font-sans whitespace-pre">
{t.welcome.createYourOwnSkillDescription}
</pre>
) : (
<p>{t.welcome.createYourOwnSkillDescription}</p>
)}
</div>
) : (
<div className="text-muted-foreground text-sm">
{t.welcome.description.includes("\n") ? (
<pre className="whitespace-pre">{t.welcome.description}</pre>
) : (
<p>{t.welcome.description}</p>
)}
</div>
)}
</div>
);
}