Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: customizable new-chat greeting (#16408)

Michael Han8da4ba2f1c3d
diff --git a/studio/backend/routes/settings.py b/studio/backend/routes/settings.py
index 226329c1d31..e370f0368c0 100644
--- a/studio/backend/routes/settings.py
+++ b/studio/backend/routes/settings.py
@@ -4560,6 +4560,11 @@ def _is_bundled_avatar_url(value: str) -> bool:
return path[path.index(marker) :].lower().endswith(".png")
+_GREETING_DATA_URL_PATTERN = r"^data:image/(?:png|jpeg|webp|gif);base64,[A-Za-z0-9+/=]+$"
+MAX_GREETING_ICON_DATA_URL_LENGTH = 96 * 1024
+MAX_GREETING_IMAGE_DATA_URL_LENGTH = MAX_AVATAR_DATA_URL_BYTES
+
+
class PersonalizationProfile(BaseModel):
model_config = ConfigDict(extra = "ignore")
@@ -4568,6 +4573,25 @@ class PersonalizationProfile(BaseModel):
avatarDataUrl: Optional[str] = Field(None, max_length = MAX_AVATAR_DATA_URL_BYTES)
avatarShape: Literal["circle", "rounded"] = "circle"
showGreetingSloth: bool = True
+ greetingStyle: Literal["text", "image"] = "text"
+ greetingIcon: Literal["sloth", "custom", "none"] = "sloth"
+ greetingIconDataUrl: Optional[str] = Field(
+ None,
+ max_length = MAX_GREETING_ICON_DATA_URL_LENGTH,
+ pattern = _GREETING_DATA_URL_PATTERN,
+ )
+ greetingText: str = Field("", max_length = 100)
+ greetingImageDataUrl: Optional[str] = Field(
+ None,
+ max_length = MAX_GREETING_IMAGE_DATA_URL_LENGTH,
+ pattern = _GREETING_DATA_URL_PATTERN,
+ )
+
+ @field_validator("greetingStyle", "greetingIcon", mode = "before")
+ @classmethod
+ def _known_greeting_choice(cls, value: object, info) -> object:
+ allowed = get_args(cls.model_fields[info.field_name].annotation)
+ return value if value in allowed else cls.model_fields[info.field_name].default
@field_validator("avatarDataUrl")
@classmethod
@@ -4865,6 +4889,7 @@ class PersonalizationResponse(PersonalizationPayload):
sentAttachmentsSaved: bool = False
paletteSaved: bool = False
greetingSlothSaved: bool = False
+ greetingCustomSaved: bool = False
@_account_settings_router.get("/personalization", response_model = PersonalizationResponse)
@@ -4884,6 +4909,7 @@ def get_personalization_settings(
)
response.paletteSaved = isinstance(appearance, dict) and "palette" in appearance
response.greetingSlothSaved = isinstance(profile, dict) and "showGreetingSloth" in profile
+ response.greetingCustomSaved = isinstance(profile, dict) and "greetingStyle" in profile
return response
diff --git a/studio/backend/tests/test_personalization_settings.py b/studio/backend/tests/test_personalization_settings.py
index b5dd8539c19..c763fbe04ca 100644
--- a/studio/backend/tests/test_personalization_settings.py
+++ b/studio/backend/tests/test_personalization_settings.py
@@ -45,6 +45,11 @@ def test_defaults_fill_missing_fields():
assert p.profile.avatarShape == "circle"
assert p.profile.displayName == ""
assert p.profile.showGreetingSloth is True
+ assert p.profile.greetingStyle == "text"
+ assert p.profile.greetingIcon == "sloth"
+ assert p.profile.greetingText == ""
+ assert p.profile.greetingIconDataUrl is None
+ assert p.profile.greetingImageDataUrl is None
def test_unknown_keys_are_ignored():
@@ -473,6 +478,11 @@ def test_personalization_route_roundtrip_real_shape(monkeypatch):
"avatarDataUrl": "/Sloth%20emojis/large%20sloth%20yay.png",
"avatarShape": "rounded",
"showGreetingSloth": False,
+ "greetingStyle": "image",
+ "greetingIcon": "custom",
+ "greetingIconDataUrl": "data:image/webp;base64,AAAA",
+ "greetingText": "Hello there",
+ "greetingImageDataUrl": "data:image/png;base64,BBBB",
},
"appearance": {
"theme": "dark",
@@ -538,6 +548,7 @@ def test_personalization_route_roundtrip_real_shape(monkeypatch):
assert body["customizationSaved"] is True
assert body["paletteSaved"] is True
assert body["greetingSlothSaved"] is True
+ assert body["greetingCustomSaved"] is True
assert body["profile"] == payload["profile"]
assert body["appearance"] == payload["appearance"]
@@ -561,6 +572,8 @@ def test_personalization_get_flags_legacy_fields(monkeypatch):
assert body["customizationSaved"] is False
assert body["paletteSaved"] is False
assert body["greetingSlothSaved"] is False
+ assert body["greetingCustomSaved"] is False
+ assert body["profile"]["greetingStyle"] == "text"
def test_personalization_legacy_chat_width_presence(monkeypatch):
@@ -713,3 +726,49 @@ def test_personalization_put_preserves_existing_fields_on_stale_write(monkeypatc
assert body["paletteSaved"] is True
assert body["customizationSaved"] is True
assert body["greetingSlothSaved"] is True
+
+
[email protected]("field", ["greetingIconDataUrl", "greetingImageDataUrl"])
+ "value",
+ [
+ "data:image/svg+xml;base64,PHN2Zz48c2NyaXB0Lz48L3N2Zz4=",
+ "data:image/svg+xml,<svg onload=alert(1)>",
+ "javascript:alert(1)",
+ "https://example.com/a.png",
+ "/Sloth%20emojis/large%20sloth%20yay.png",
+ "data:image/png;base64,AAAA\nBBBB",
+ ],
+)
+def test_greeting_images_must_be_raster_data_urls(field, value):
+ with pytest.raises(ValidationError):
+ PersonalizationPayload.model_validate({"profile": {field: value}})
+
+
[email protected]("mime", ["png", "jpeg", "webp", "gif"])
+def test_greeting_images_accept_raster_types(mime):
+ url = f"data:image/{mime};base64,AAAA"
+ p = PersonalizationPayload.model_validate(
+ {"profile": {"greetingIconDataUrl": url, "greetingImageDataUrl": url}}
+ )
+ assert p.profile.greetingIconDataUrl == url
+ assert p.profile.greetingImageDataUrl == url
+
+
+def test_greeting_sizes_are_capped():
+ icon = "data:image/png;base64," + "A" * settings_routes.MAX_GREETING_ICON_DATA_URL_LENGTH
+ image = "data:image/png;base64," + "A" * settings_routes.MAX_GREETING_IMAGE_DATA_URL_LENGTH
+ with pytest.raises(ValidationError):
+ PersonalizationPayload.model_validate({"profile": {"greetingIconDataUrl": icon}})
+ with pytest.raises(ValidationError):
+ PersonalizationPayload.model_validate({"profile": {"greetingImageDataUrl": image}})
+ with pytest.raises(ValidationError):
+ PersonalizationPayload.model_validate({"profile": {"greetingText": "x" * 101}})
+
+
+def test_unknown_greeting_choices_fall_back_to_defaults():
+ p = PersonalizationPayload.model_validate(
+ {"profile": {"greetingStyle": "video", "greetingIcon": "rocket"}}
+ )
+ assert p.profile.greetingStyle == "text"
+ assert p.profile.greetingIcon == "sloth"
diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx
index e1d7f63f2b6..fae22b48dda 100644
--- a/studio/frontend/src/components/assistant-ui/thread.tsx
+++ b/studio/frontend/src/components/assistant-ui/thread.tsx
@@ -387,6 +387,7 @@ import { useRagAvailabilityStore } from "@/features/rag/api/rag-availability";
import { ThreadDocumentsBar } from "@/features/rag/components/thread-documents-bar";
import { KnowledgeBaseComposerButton } from "@/features/rag/components/knowledge-base-composer-button";
import { useUserProfileStore } from "@/features/profile/stores/user-profile-store";
+import { resolveGreeting } from "@/features/profile/greeting";
import { usePublishedFrame } from "@/features/settings/hooks/use-published-frame";
import { useVoiceSettingsStore } from "@/features/settings/stores/voice-settings-store";
import { applyQwenThinkingParams } from "@/features/chat/utils/qwen-params";
@@ -2747,6 +2748,22 @@ const ThreadWelcome: FC<{
const displayName = useUserProfileStore((s) => s.displayName);
const nickname = useUserProfileStore((s) => s.nickname);
const showGreetingSloth = useUserProfileStore((s) => s.showGreetingSloth);
+ const greetingStyle = useUserProfileStore((s) => s.greetingStyle);
+ const greetingIcon = useUserProfileStore((s) => s.greetingIcon);
+ const greetingIconDataUrl = useUserProfileStore((s) => s.greetingIconDataUrl);
+ const greetingText = useUserProfileStore((s) => s.greetingText);
+ const greetingImageDataUrl = useUserProfileStore(
+ (s) => s.greetingImageDataUrl,
+ );
+ const greeting = resolveGreeting({
+ showGreetingSloth,
+ greetingStyle,
+ greetingIcon,
+ greetingIconDataUrl,
+ greetingText,
+ greetingImageDataUrl,
+ });
+ const customText = greeting.kind === "text" ? greeting.text : null;
// At the bottom, Thread docks the composer and the greeting centres in the space above it.
const composerAtBottom = useChatPreferencesStore(
(s) => s.newChatComposerAtBottom,
@@ -2774,7 +2791,7 @@ const ThreadWelcome: FC<{
: "justify-start has-[.unsloth-files-panel]:justify-center has-[.unsloth-files-panel]:pt-0 has-[.unsloth-files-panel]:pb-[6dvh]",
// Without the greeting, its row and gap become padding, so the composer stays where it was.
!composerAtBottom &&
- (showGreetingSloth || incognito
+ (greeting.kind !== "off" || incognito
? "pt-[27.5dvh]"
: "pt-[calc(27.5dvh_+_44px*var(--ui-space-scale,1)_+_2.25rem)]"),
)}
@@ -2782,18 +2799,58 @@ const ThreadWelcome: FC<{
{/* No padding, so the composer here is as wide as once it docks. */}
<div className="aui-thread-welcome-message flex w-full flex-col justify-center gap-9">
{/* The setting hides the whole greeting; the incognito title is a status, so it stays. */}
- {(showGreetingSloth || incognito) && (
- <div className="unsloth-welcome-greeting flex flex-row items-center justify-center gap-[calc(15px*var(--ui-space-scale,1))]">
- {!incognito && (
+ {greeting.kind === "image" && !incognito && (
+ <div
+ className={cn(
+ "unsloth-welcome-greeting flex flex-row items-end justify-center",
+ !composerAtBottom &&
+ "h-[calc(120px*var(--ui-space-scale,1))] -mt-[calc(76px*var(--ui-space-scale,1))]",
+ )}
+ >
+ <h1 className="sr-only">{t(welcome.key, welcome.name ? { name: welcome.name } : undefined)}</h1>
+ <img
+ src={greeting.src}
+ alt=""
+ draggable={false}
+ className="unsloth-welcome-image fade-in slide-in-from-bottom-1 animate-in max-h-[calc(120px*var(--ui-space-scale,1))] max-w-full object-contain duration-200"
+ />
+ </div>
+ )}
+ {(greeting.kind === "text" || incognito) && (
+ <div
+ className={cn(
+ "unsloth-welcome-greeting flex flex-row items-center justify-center gap-[calc(15px*var(--ui-space-scale,1))]",
+ !incognito &&
+ greeting.kind === "text" &&
+ greeting.icon.kind === "none" &&
+ "min-h-[calc(44px*var(--ui-space-scale,1))]",
+ )}
+ >
+ {!incognito && greeting.kind === "text" && greeting.icon.kind === "sloth" && (
<MascotImg
src={currentEmojiSrc}
className="unsloth-welcome-sloth size-[calc(44px*var(--ui-space-scale,1))] -translate-y-[2px]"
/>
)}
- <h1 className="aui-thread-welcome-message-inner unsloth-welcome-title fade-in slide-in-from-bottom-1 animate-in text-3xl tracking-[-0.02em] duration-200">
+ {!incognito && greeting.kind === "text" && greeting.icon.kind === "custom" && (
+ <img
+ src={greeting.icon.src}
+ alt=""
+ draggable={false}
+ className="unsloth-welcome-sloth unsloth-welcome-icon size-[calc(44px*var(--ui-space-scale,1))] shrink-0 -translate-y-[2px] object-contain"
+ />
+ )}
+ <h1
+ className={cn(
+ "aui-thread-welcome-message-inner unsloth-welcome-title fade-in slide-in-from-bottom-1 animate-in text-3xl tracking-[-0.02em] duration-200",
+ customText && "min-w-0 text-balance text-center [overflow-wrap:anywhere]",
+ )}
+ >
{incognito
? t("welcome.temporaryChat")
- : t(welcome.key, welcome.name ? { name: welcome.name } : undefined)}
+ : customText
+ ? customText
+ : t(welcome.key, welcome.name ? { name: welcome.name } : undefined)}
</h1>
</div>
)}
diff --git a/studio/frontend/src/features/profile/greeting.ts b/studio/frontend/src/features/profile/greeting.ts
new file mode 100644
index 00000000000..79b48f78b35
--- /dev/null
+++ b/studio/frontend/src/features/profile/greeting.ts
@@ -0,0 +1,118 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import type { ResizeLimits } from "./utils/resize-image-file";
+
+export type GreetingStyle = "text" | "image";
+export type GreetingIcon = "sloth" | "custom" | "none";
+export const GREETING_TEXT_MAX_LENGTH = 100;
+
+export const GREETING_IMAGE_TYPES = [
+ "image/png",
+ "image/jpeg",
+ "image/webp",
+ "image/gif",
+] as const;
+export const GREETING_UPLOAD_MAX_BYTES = 10 * 1024 * 1024;
+export const GREETING_ICON_LIMITS: ResizeLimits = {
+ maxEdge: 128,
+ minEdge: 64,
+ maxBytes: 48_000,
+};
+export const GREETING_IMAGE_LIMITS: ResizeLimits = {
+ maxEdge: 960,
+ minEdge: 320,
+ maxBytes: 240_000,
+};
+
+const DATA_URL = /^data:image\/(?:png|jpeg|webp|gif);base64,[A-Za-z0-9+/=]+$/;
+
+export function isGreetingDataUrl(value: unknown): value is string {
+ return typeof value === "string" && DATA_URL.test(value);
+}
+
+export function validGreetingUpload(file: Pick<File, "type" | "size">) {
+ return (
+ file.size > 0 &&
+ file.size <= GREETING_UPLOAD_MAX_BYTES &&
+ (GREETING_IMAGE_TYPES as readonly string[]).includes(file.type)
+ );
+}
+
+export type GreetingSettings = {
+ showGreetingSloth: boolean;
+ greetingStyle: GreetingStyle;
+ greetingIcon: GreetingIcon;
+ greetingIconDataUrl: string | null;
+ greetingText: string;
+ greetingImageDataUrl: string | null;
+};
+
+export const DEFAULT_GREETING: GreetingSettings = {
+ showGreetingSloth: true,
+ greetingStyle: "text",
+ greetingIcon: "sloth",
+ greetingIconDataUrl: null,
+ greetingText: "",
+ greetingImageDataUrl: null,
+};
+
+export function sanitizeGreeting(
+ input: Partial<Record<keyof GreetingSettings, unknown>>,
+): GreetingSettings {
+ return {
+ showGreetingSloth: input.showGreetingSloth !== false,
+ greetingStyle: input.greetingStyle === "image" ? "image" : "text",
+ greetingIcon:
+ input.greetingIcon === "custom" || input.greetingIcon === "none"
+ ? input.greetingIcon
+ : "sloth",
+ greetingIconDataUrl: isGreetingDataUrl(input.greetingIconDataUrl)
+ ? input.greetingIconDataUrl
+ : null,
+ greetingText:
+ typeof input.greetingText === "string"
+ ? input.greetingText.slice(0, GREETING_TEXT_MAX_LENGTH)
+ : "",
+ greetingImageDataUrl: isGreetingDataUrl(input.greetingImageDataUrl)
+ ? input.greetingImageDataUrl
+ : null,
+ };
+}
+
+export type ResolvedGreeting =
+ | { kind: "off" }
+ | { kind: "image"; src: string }
+ | {
+ kind: "text";
+ icon:
+ | { kind: "sloth" }
+ | { kind: "none" }
+ | { kind: "custom"; src: string };
+ text: string | null;
+ };
+
+export function resolveGreeting(settings: GreetingSettings): ResolvedGreeting {
+ const s = sanitizeGreeting(settings);
+ if (!s.showGreetingSloth) {
+ return { kind: "off" };
+ }
+ if (s.greetingStyle === "image" && s.greetingImageDataUrl) {
+ return { kind: "image", src: s.greetingImageDataUrl };
+ }
+ if (s.greetingStyle === "text" && s.greetingIcon === "custom") {
+ const text = s.greetingText.trim() || null;
+ return s.greetingIconDataUrl
+ ? {
+ kind: "text",
+ icon: { kind: "custom", src: s.greetingIconDataUrl },
+ text,
+ }
+ : { kind: "text", icon: { kind: "none" }, text };
+ }
+ return {
+ kind: "text",
+ icon: { kind: s.greetingIcon === "none" ? "none" : "sloth" },
+ text: null,
+ };
+}
diff --git a/studio/frontend/src/features/profile/hooks/use-personalization-sync.ts b/studio/frontend/src/features/profile/hooks/use-personalization-sync.ts
index 03ccd2dbeec..96e09746917 100644
--- a/studio/frontend/src/features/profile/hooks/use-personalization-sync.ts
+++ b/studio/frontend/src/features/profile/hooks/use-personalization-sync.ts
@@ -28,6 +28,11 @@ import {
useLocalePreference,
} from "@/i18n";
import { useCallback, useEffect, useRef, useState } from "react";
+import {
+ DEFAULT_GREETING,
+ type GreetingSettings,
+ sanitizeGreeting,
+} from "../greeting";
import {
PROFILE_TEXT_MAX_LENGTH,
useUserProfileStore,
@@ -42,14 +47,37 @@ const PUSH_DEBOUNCE_MS = 800;
// Version 6 shows Appearance in the account menu once.
const PERSONALIZATION_VERSION = 6;
-type ProfileSnapshot = {
+type ProfileSnapshot = GreetingSettings & {
displayName: string;
nickname: string;
avatarDataUrl: string | null;
avatarShape: AvatarShape;
- showGreetingSloth: boolean;
};
+const CUSTOM_GREETING_KEYS = [
+ "greetingStyle",
+ "greetingIcon",
+ "greetingIconDataUrl",
+ "greetingText",
+ "greetingImageDataUrl",
+] as const;
+type CustomGreeting = Pick<
+ GreetingSettings,
+ (typeof CUSTOM_GREETING_KEYS)[number]
+>;
+
+function customGreeting(profile: GreetingSettings): CustomGreeting {
+ const s = sanitizeGreeting(profile);
+ return Object.fromEntries(
+ CUSTOM_GREETING_KEYS.map((key) => [key, s[key]]),
+ ) as CustomGreeting;
+}
+
+function isDefaultCustomGreeting(profile: GreetingSettings): boolean {
+ const s = sanitizeGreeting(profile);
+ return CUSTOM_GREETING_KEYS.every((key) => s[key] === DEFAULT_GREETING[key]);
+}
+
type PersonalizationWrite = Parameters<typeof savePersonalization>[0];
type QueuedSave = {
data: PersonalizationWrite;
@@ -65,6 +93,7 @@ function profileText(value: string): string {
function normalizeProfile(profile: ProfileSnapshot): ProfileSnapshot {
return {
...profile,
+ ...customGreeting(profile),
displayName: profileText(profile.displayName),
nickname: profileText(profile.nickname),
};
@@ -76,7 +105,8 @@ function sameProfile(a: ProfileSnapshot, b: ProfileSnapshot): boolean {
a.nickname === b.nickname &&
a.avatarDataUrl === b.avatarDataUrl &&
a.avatarShape === b.avatarShape &&
- a.showGreetingSloth === b.showGreetingSloth
+ a.showGreetingSloth === b.showGreetingSloth &&
+ CUSTOM_GREETING_KEYS.every((key) => a[key] === b[key])
);
}
@@ -124,6 +154,11 @@ function profileSnapshot(): ProfileSnapshot {
avatarDataUrl: s.avatarDataUrl,
avatarShape: s.avatarShape,
showGreetingSloth: s.showGreetingSloth,
+ greetingStyle: s.greetingStyle,
+ greetingIcon: s.greetingIcon,
+ greetingIconDataUrl: s.greetingIconDataUrl,
+ greetingText: s.greetingText,
+ greetingImageDataUrl: s.greetingImageDataUrl,
};
}
@@ -168,6 +203,7 @@ function hasLocalSettings(
profile.avatarDataUrl ||
profile.avatarShape !== "circle" ||
!profile.showGreetingSloth ||
+ !isDefaultCustomGreeting(profile) ||
theme !== "system" ||
palette !== "standard" ||
!isDefaultCustomization(customization) ||
@@ -181,6 +217,13 @@ export function usePersonalizationSync(enabled: boolean): void {
const avatarDataUrl = useUserProfileStore((s) => s.avatarDataUrl);
const avatarShape = useUserProfileStore((s) => s.avatarShape);
const showGreetingSloth = useUserProfileStore((s) => s.showGreetingSloth);
+ const greetingStyle = useUserProfileStore((s) => s.greetingStyle);
+ const greetingIcon = useUserProfileStore((s) => s.greetingIcon);
+ const greetingIconDataUrl = useUserProfileStore((s) => s.greetingIconDataUrl);
+ const greetingText = useUserProfileStore((s) => s.greetingText);
+ const greetingImageDataUrl = useUserProfileStore(
+ (s) => s.greetingImageDataUrl,
+ );
const { theme } = useTheme();
const { palette } = usePalette();
const customization = useAppearanceCustomStore((s) => s.customization);
@@ -248,6 +291,14 @@ export function usePersonalizationSync(enabled: boolean): void {
const remoteGreeting = remote.profile.showGreetingSloth !== false;
const keepLocalGreeting =
remote.greetingSlothSaved === false && localGreeting === false;
+ const localProfile = profileSnapshot();
+ const remoteCustomGreeting = customGreeting({
+ ...DEFAULT_GREETING,
+ ...remote.profile,
+ });
+ const keepLocalCustomGreeting =
+ remote.greetingCustomSaved !== true &&
+ !isDefaultCustomGreeting(localProfile);
const nextProfile: ProfileSnapshot = {
displayName: remote.profile.displayName ?? "",
nickname: remote.profile.nickname ?? "",
@@ -257,6 +308,9 @@ export function usePersonalizationSync(enabled: boolean): void {
showGreetingSloth: keepLocalGreeting
? localGreeting
: remoteGreeting,
+ ...(keepLocalCustomGreeting
+ ? customGreeting(localProfile)
+ : remoteCustomGreeting),
};
const nextTheme = remote.appearance.theme;
const localPalette = latestPaletteRef.current;
@@ -340,7 +394,11 @@ export function usePersonalizationSync(enabled: boolean): void {
// lastSaved records the server's actual values so the push re-uploads preserved local values.
lastSavedRef.current = serialized({
...payload(
- { ...nextProfile, showGreetingSloth: remoteGreeting },
+ {
+ ...nextProfile,
+ ...remoteCustomGreeting,
+ showGreetingSloth: remoteGreeting,
+ },
nextTheme,
remotePalette,
storedRemoteCustomization,
@@ -404,7 +462,18 @@ export function usePersonalizationSync(enabled: boolean): void {
useEffect(() => {
if (!enabled || hydratedGeneration !== authGenerationRef.current) return;
const current = payload(
- { displayName, nickname, avatarDataUrl, avatarShape, showGreetingSloth },
+ {
+ displayName,
+ nickname,
+ avatarDataUrl,
+ avatarShape,
+ showGreetingSloth,
+ greetingStyle,
+ greetingIcon,
+ greetingIconDataUrl,
+ greetingText,
+ greetingImageDataUrl,
+ },
theme,
palette,
customization,
@@ -429,6 +498,11 @@ export function usePersonalizationSync(enabled: boolean): void {
avatarDataUrl,
avatarShape,
showGreetingSloth,
+ greetingStyle,
+ greetingIcon,
+ greetingIconDataUrl,
+ greetingText,
+ greetingImageDataUrl,
theme,
palette,
customization,
diff --git a/studio/frontend/src/features/profile/index.ts b/studio/frontend/src/features/profile/index.ts
index 981cf993e75..d9fa3513bb0 100644
--- a/studio/frontend/src/features/profile/index.ts
+++ b/studio/frontend/src/features/profile/index.ts
@@ -7,3 +7,12 @@ export { UserAvatar } from "./components/user-avatar";
export { useEffectiveProfile } from "./hooks/use-effective-profile";
export { usePersonalizationSync } from "./hooks/use-personalization-sync";
export { useUserProfileStore } from "./stores/user-profile-store";
+export {
+ GREETING_ICON_LIMITS,
+ GREETING_IMAGE_LIMITS,
+ GREETING_IMAGE_TYPES,
+ GREETING_TEXT_MAX_LENGTH,
+ isGreetingDataUrl,
+ validGreetingUpload,
+} from "./greeting";
+export { resizeImageFileToDataUrl } from "./utils/resize-image-file";
diff --git a/studio/frontend/src/features/profile/stores/user-profile-store.ts b/studio/frontend/src/features/profile/stores/user-profile-store.ts
index a882a936a8f..f20859cd115 100644
--- a/studio/frontend/src/features/profile/stores/user-profile-store.ts
+++ b/studio/frontend/src/features/profile/stores/user-profile-store.ts
@@ -3,6 +3,7 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
+import type { GreetingIcon, GreetingStyle } from "../greeting";
export type AvatarShape = "circle" | "rounded";
export const PROFILE_TEXT_MAX_LENGTH = 200;
@@ -13,11 +14,29 @@ export interface UserProfileState {
avatarDataUrl: string | null;
avatarShape: AvatarShape;
showGreetingSloth: boolean;
+ greetingStyle: GreetingStyle;
+ greetingIcon: GreetingIcon;
+ greetingIconDataUrl: string | null;
+ greetingText: string;
+ greetingImageDataUrl: string | null;
setDisplayName: (displayName: string) => void;
setNickname: (nickname: string) => void;
setAvatarDataUrl: (avatarDataUrl: string | null) => void;
setAvatarShape: (avatarShape: AvatarShape) => void;
setShowGreetingSloth: (showGreetingSloth: boolean) => void;
+ setGreeting: (
+ patch: Partial<
+ Pick<
+ UserProfileState,
+ | "showGreetingSloth"
+ | "greetingStyle"
+ | "greetingIcon"
+ | "greetingIconDataUrl"
+ | "greetingText"
+ | "greetingImageDataUrl"
+ >
+ >,
+ ) => void;
}
export const useUserProfileStore = create<UserProfileState>()(
@@ -28,11 +47,17 @@ export const useUserProfileStore = create<UserProfileState>()(
avatarDataUrl: null,
avatarShape: "circle",
showGreetingSloth: true,
+ greetingStyle: "text",
+ greetingIcon: "sloth",
+ greetingIconDataUrl: null,
+ greetingText: "",
+ greetingImageDataUrl: null,
setDisplayName: (displayName) => set({ displayName }),
setNickname: (nickname) => set({ nickname }),
setAvatarDataUrl: (avatarDataUrl) => set({ avatarDataUrl }),
setAvatarShape: (avatarShape) => set({ avatarShape }),
setShowGreetingSloth: (showGreetingSloth) => set({ showGreetingSloth }),
+ setGreeting: (patch) => set(patch),
}),
{ name: "unsloth_user_profile" },
),
diff --git a/studio/frontend/src/features/profile/utils/resize-image-file.ts b/studio/frontend/src/features/profile/utils/resize-image-file.ts
index 48ac7e2ce83..644a03f8d1e 100644
--- a/studio/frontend/src/features/profile/utils/resize-image-file.ts
+++ b/studio/frontend/src/features/profile/utils/resize-image-file.ts
@@ -1,16 +1,28 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
-const MAX_EDGE = 256;
-const MIN_EDGE = 96;
const EDGE_STEP = 32;
-const MAX_BYTES = 380_000;
-const MAX_DATA_URL_LENGTH = Math.floor(MAX_BYTES * 1.35);
const JPEG_QUALITY_START = 0.88;
const WEBP_QUALITY_START = 0.9;
const MIN_QUALITY = 0.45;
const QUALITY_STEP = 0.08;
+export type ResizeLimits = {
+ maxEdge: number;
+ minEdge: number;
+ maxBytes: number;
+};
+
+const AVATAR_LIMITS: ResizeLimits = {
+ maxEdge: 256,
+ minEdge: 96,
+ maxBytes: 380_000,
+};
+
+function maxDataUrlLength(limits: ResizeLimits): number {
+ return Math.floor(limits.maxBytes * 1.35);
+}
+
function loadImage(file: File): Promise<HTMLImageElement> {
return new Promise((resolve, reject) => {
const url = URL.createObjectURL(file);
@@ -43,24 +55,28 @@ function encodeCanvasWithinLimit(
canvas: HTMLCanvasElement,
mimeType: string,
startQuality: number,
+ maxLength: number,
): string | null {
let quality = startQuality;
let dataUrl = canvas.toDataURL(mimeType, quality);
if (!dataUrl.startsWith(`data:${mimeType}`)) return null;
- while (dataUrl.length > MAX_DATA_URL_LENGTH && quality > MIN_QUALITY) {
+ while (dataUrl.length > maxLength && quality > MIN_QUALITY) {
quality -= QUALITY_STEP;
dataUrl = canvas.toDataURL(mimeType, quality);
}
- return dataUrl.length <= MAX_DATA_URL_LENGTH ? dataUrl : null;
+ return dataUrl.length <= maxLength ? dataUrl : null;
}
// Safari cannot encode WebP, so PNG is the universal alpha-preserving fallback.
-function encodePngWithinLimit(canvas: HTMLCanvasElement): string | null {
+function encodePngWithinLimit(
+ canvas: HTMLCanvasElement,
+ maxLength: number,
+): string | null {
const dataUrl = canvas.toDataURL("image/png");
if (!dataUrl.startsWith("data:image/png")) return null;
- return dataUrl.length <= MAX_DATA_URL_LENGTH ? dataUrl : null;
+ return dataUrl.length <= maxLength ? dataUrl : null;
}
function drawScaled(
@@ -86,26 +102,32 @@ function drawScaled(
return { canvas, ctx, cw, ch };
}
-export async function resizeImageFileToDataUrl(file: File): Promise<string> {
+export async function resizeImageFileToDataUrl(
+ file: File,
+ limits: ResizeLimits = AVATAR_LIMITS,
+): Promise<string> {
const img = await loadImage(file);
const w = img.naturalWidth;
const h = img.naturalHeight;
if (!w || !h) throw new Error("Invalid image dimensions");
- const base = drawScaled(img, w, h, MAX_EDGE);
+ const { maxEdge, minEdge } = limits;
+ const maxLength = maxDataUrlLength(limits);
+ const base = drawScaled(img, w, h, maxEdge);
const hasTransparency = canvasHasTransparency(base.ctx, base.cw, base.ch);
if (hasTransparency) {
// Never JPEG: it would paint a background behind a transparent image.
- for (let edge = MAX_EDGE; edge >= MIN_EDGE; edge -= EDGE_STEP) {
- const { canvas } = edge === MAX_EDGE ? base : drawScaled(img, w, h, edge);
+ for (let edge = maxEdge; edge >= minEdge; edge -= EDGE_STEP) {
+ const { canvas } = edge === maxEdge ? base : drawScaled(img, w, h, edge);
const webpDataUrl = encodeCanvasWithinLimit(
canvas,
"image/webp",
WEBP_QUALITY_START,
+ maxLength,
);
if (webpDataUrl) return webpDataUrl;
- const pngDataUrl = encodePngWithinLimit(canvas);
+ const pngDataUrl = encodePngWithinLimit(canvas, maxLength);
if (pngDataUrl) return pngDataUrl;
}
throw new Error(
@@ -117,6 +139,7 @@ export async function resizeImageFileToDataUrl(file: File): Promise<string> {
base.canvas,
"image/jpeg",
JPEG_QUALITY_START,
+ maxLength,
);
if (jpegDataUrl) return jpegDataUrl;
diff --git a/studio/frontend/src/features/settings/api/personalization.ts b/studio/frontend/src/features/settings/api/personalization.ts
index 14b41867ab7..703c4ee3b31 100644
--- a/studio/frontend/src/features/settings/api/personalization.ts
+++ b/studio/frontend/src/features/settings/api/personalization.ts
@@ -12,6 +12,11 @@ export type PersonalizationProfile = {
avatarDataUrl: string | null;
avatarShape: "circle" | "rounded";
showGreetingSloth: boolean;
+ greetingStyle: "text" | "image";
+ greetingIcon: "sloth" | "custom" | "none";
+ greetingIconDataUrl: string | null;
+ greetingText: string;
+ greetingImageDataUrl: string | null;
};
export type PersonalizationAppearance = {
@@ -32,6 +37,7 @@ export type Personalization = {
sentAttachmentsSaved?: boolean;
paletteSaved: boolean;
greetingSlothSaved: boolean;
+ greetingCustomSaved?: boolean;
};
export async function loadPersonalization(): Promise<Personalization> {
@@ -53,6 +59,7 @@ export async function savePersonalization(
| "sentAttachmentsSaved"
| "paletteSaved"
| "greetingSlothSaved"
+ | "greetingCustomSaved"
>,
): Promise<void> {
const res = await authFetch("/api/settings/personalization", {
diff --git a/studio/frontend/src/features/settings/components/greeting-controls.tsx b/studio/frontend/src/features/settings/components/greeting-controls.tsx
new file mode 100644
index 00000000000..aa333fb3476
--- /dev/null
+++ b/studio/frontend/src/features/settings/components/greeting-controls.tsx
@@ -0,0 +1,351 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { MascotImg } from "@/components/mascot-img";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import {
+ GREETING_ICON_LIMITS,
+ GREETING_IMAGE_LIMITS,
+ GREETING_IMAGE_TYPES,
+ GREETING_TEXT_MAX_LENGTH,
+ isGreetingDataUrl,
+ resizeImageFileToDataUrl,
+ useUserProfileStore,
+ validGreetingUpload,
+} from "@/features/profile";
+import { type TranslationKey, useT } from "@/i18n";
+import { cn } from "@/lib/utils";
+import {
+ Cancel01Icon,
+ Image01Icon,
+ SmileIcon,
+ Upload01Icon,
+} from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
+import { type ReactNode, useRef, useState } from "react";
+import { SettingsRow } from "./settings-row";
+
+type UploadField = "greetingIconDataUrl" | "greetingImageDataUrl";
+type UploadError = "file" | "image";
+type GreetingMode = "default" | "custom" | "image" | "off";
+
+const PROFILE_STORAGE_KEY = "unsloth_user_profile";
+const ACCEPT = GREETING_IMAGE_TYPES.join(",");
+const MODES: { mode: GreetingMode; label: TranslationKey }[] = [
+ { mode: "default", label: "settings.profile.greetingDefault" },
+ { mode: "custom", label: "settings.profile.greetingCustom" },
+ { mode: "image", label: "settings.profile.greetingImage" },
+ { mode: "off", label: "settings.profile.noneLabel" },
+];
+const MODE_PATCH = {
+ default: {
+ showGreetingSloth: true,
+ greetingStyle: "text",
+ greetingIcon: "sloth",
+ },
+ custom: {
+ showGreetingSloth: true,
+ greetingStyle: "text",
+ greetingIcon: "custom",
+ },
+ image: { showGreetingSloth: true, greetingStyle: "image" },
+ off: { showGreetingSloth: false },
+} as const;
+const SLOTH_PREVIEW = "Sloth emojis/large sloth wave.png";
+const SAMPLE_TEXT = "Aa";
+
+function persistedValue(field: UploadField): unknown {
+ try {
+ const raw = window.localStorage.getItem(PROFILE_STORAGE_KEY);
+ return raw
+ ? (JSON.parse(raw) as { state?: Record<string, unknown> }).state?.[field]
+ : null;
+ } catch {
+ return null;
+ }
+}
+
+function useGreetingMode(): GreetingMode {
+ const on = useUserProfileStore((s) => s.showGreetingSloth);
+ const style = useUserProfileStore((s) => s.greetingStyle);
+ const icon = useUserProfileStore((s) => s.greetingIcon);
+ if (!on) {
+ return "off";
+ }
+ if (style === "image") {
+ return "image";
+ }
+ return icon === "custom" ? "custom" : "default";
+}
+
+function useGreetingUpload() {
+ const setGreeting = useUserProfileStore((s) => s.setGreeting);
+ const [error, setError] = useState<UploadError | null>(null);
+ const [busy, setBusy] = useState(false);
+ const upload = async (
+ field: UploadField,
+ file: File | undefined,
+ ): Promise<void> => {
+ if (!file) {
+ return;
+ }
+ setError(null);
+ if (!validGreetingUpload(file)) {
+ setError("file");
+ return;
+ }
+ setBusy(true);
+ try {
+ const dataUrl = await resizeImageFileToDataUrl(
+ file,
+ field === "greetingIconDataUrl"
+ ? GREETING_ICON_LIMITS
+ : GREETING_IMAGE_LIMITS,
+ );
+ if (!isGreetingDataUrl(dataUrl)) {
+ throw new Error("encode");
+ }
+ const previous = useUserProfileStore.getState()[field];
+ let stored = false;
+ try {
+ setGreeting({ [field]: dataUrl });
+ stored = persistedValue(field) === dataUrl;
+ } catch {
+ // Checked below.
+ }
+ if (!stored) {
+ setGreeting({ [field]: previous });
+ throw new Error("storage");
+ }
+ } catch {
+ setError("image");
+ } finally {
+ setBusy(false);
+ }
+ };
+ return { upload, error, busy };
+}
+
+function UploadControls({
+ field,
+ preview,
+}: {
+ field: UploadField;
+ preview: string | null;
+}) {
+ const t = useT();
+ const setGreeting = useUserProfileStore((s) => s.setGreeting);
+ const { upload, error, busy } = useGreetingUpload();
+ const input = useRef<HTMLInputElement>(null);
+ return (
+ <div className="flex flex-col items-end gap-1.5">
+ <div className="flex items-center gap-2">
+ <input
+ ref={input}
+ className="sr-only"
+ tabIndex={-1}
+ aria-label={`${t("settings.profile.greetingSloth")}: ${t("chatBackground.upload")}`}
+ type="file"
+ accept={ACCEPT}
+ disabled={busy}
+ onChange={(event) => {
+ const file = event.target.files?.[0];
+ event.target.value = "";
+ upload(field, file);
+ }}
+ />
+ {preview && (
+ <img
+ src={preview}
+ alt=""
+ className="h-8 max-w-24 shrink-0 object-contain"
+ data-greeting-preview=""
+ />
+ )}
+ {preview && (
+ <Button
+ className="text-foreground"
+ type="button"
+ variant="ghost"
+ size="sm"
+ disabled={busy}
+ onClick={() => setGreeting({ [field]: null })}
+ >
+ <HugeiconsIcon
+ icon={Cancel01Icon}
+ strokeWidth={1.75}
+ className="size-4"
+ aria-hidden="true"
+ />
+ {t("settings.profile.removePhoto")}
+ </Button>
+ )}
+ <Button
+ className="text-foreground"
+ type="button"
+ variant="outline"
+ size="sm"
+ disabled={busy}
+ onClick={() => input.current?.click()}
+ >
+ <HugeiconsIcon
+ icon={Upload01Icon}
+ strokeWidth={1.75}
+ className="size-4"
+ aria-hidden="true"
+ />
+ {busy
+ ? t("common.loading")
+ : t(preview ? "chatBackground.replace" : "chatBackground.upload")}
+ </Button>
+ </div>
+ {error && (
+ <p role="alert" className="text-xs text-destructive">
+ {t(
+ error === "file"
+ ? "settings.profile.greetingFileError"
+ : "settings.profile.greetingImageError",
+ )}
+ </p>
+ )}
+ </div>
+ );
+}
+
+function GreetingModeOptions({ mode }: { mode: GreetingMode }) {
+ const t = useT();
+ const setGreeting = useUserProfileStore((s) => s.setGreeting);
+ const text = useUserProfileStore((s) => s.greetingText);
+ const iconDataUrl = useUserProfileStore((s) => s.greetingIconDataUrl);
+ const imageDataUrl = useUserProfileStore((s) => s.greetingImageDataUrl);
+ if (mode === "custom") {
+ return (
+ <div className="flex flex-col gap-3">
+ <UploadControls field="greetingIconDataUrl" preview={iconDataUrl} />
+ <Input
+ aria-label={t("settings.profile.greetingText")}
+ value={text}
+ maxLength={GREETING_TEXT_MAX_LENGTH}
+ placeholder={t("welcome.onYourMind")}
+ onChange={(event) =>
+ setGreeting({ greetingText: event.target.value })
+ }
+ />
+ <p className="text-right text-xs text-muted-foreground">
+ {t("settings.profile.greetingTextDescription")}
+ </p>
+ </div>
+ );
+ }
+ if (mode === "image") {
+ return (
+ <UploadControls field="greetingImageDataUrl" preview={imageDataUrl} />
+ );
+ }
+ return null;
+}
+
+function GreetingTiles({ mode }: { mode: GreetingMode }) {
+ const t = useT();
+ const setGreeting = useUserProfileStore((s) => s.setGreeting);
+ const iconDataUrl = useUserProfileStore((s) => s.greetingIconDataUrl);
+ const imageDataUrl = useUserProfileStore((s) => s.greetingImageDataUrl);
+ const art: Record<GreetingMode, ReactNode> = {
+ default: (
+ <span className="flex items-center gap-1.5 text-sm font-medium">
+ <MascotImg src={SLOTH_PREVIEW} className="size-5" />
+ {SAMPLE_TEXT}
+ </span>
+ ),
+ custom: (
+ <span className="flex items-center gap-1.5 text-sm font-medium">
+ {iconDataUrl ? (
+ <img src={iconDataUrl} alt="" className="size-5 object-contain" />
+ ) : (
+ <HugeiconsIcon
+ icon={SmileIcon}
+ strokeWidth={1.75}
+ className="size-5"
+ />
+ )}
+ {SAMPLE_TEXT}
+ </span>
+ ),
+ image: imageDataUrl ? (
+ <img
+ src={imageDataUrl}
+ alt=""
+ className="max-h-8 max-w-[80%] object-contain"
+ />
+ ) : (
+ <HugeiconsIcon icon={Image01Icon} strokeWidth={1.75} className="size-5" />
+ ),
+ off: (
+ <HugeiconsIcon
+ icon={Cancel01Icon}
+ strokeWidth={1.75}
+ className="size-5 text-muted-foreground"
+ />
+ ),
+ };
+ return (
+ <div
+ role="radiogroup"
+ aria-label={t("settings.profile.greetingSloth")}
+ className="grid w-[calc(24rem*var(--ui-space-scale,1))] max-w-full grid-cols-4 gap-2"
+ >
+ {MODES.map((m) => (
+ <button
+ key={m.mode}
+ type="button"
+ role="radio"
+ aria-checked={mode === m.mode}
+ onClick={() => setGreeting(MODE_PATCH[m.mode])}
+ className="group flex cursor-pointer flex-col items-center gap-1.5"
+ >
+ <span
+ className={cn(
+ "flex h-14 w-full items-center justify-center rounded-lg border bg-background text-foreground transition-colors",
+ mode === m.mode
+ ? "border-primary"
+ : "border-border group-hover:border-[color-mix(in_srgb,var(--foreground)_calc(30%*var(--contrast-wash-gain,1)),transparent)]",
+ m.mode === "off" && "border-dashed",
+ )}
+ >
+ {art[m.mode]}
+ </span>
+ <span
+ className={cn(
+ "text-xs",
+ mode === m.mode ? "text-foreground" : "text-muted-foreground",
+ )}
+ >
+ {t(m.label)}
+ </span>
+ </button>
+ ))}
+ </div>
+ );
+}
+
+export function GreetingSettingsRows() {
+ const t = useT();
+ const mode = useGreetingMode();
+ return (
+ <SettingsRow
+ label={t("settings.profile.greetingSloth")}
+ description={t("settings.profile.greetingSlothDescription")}
+ wideControl={true}
+ below={
+ mode === "custom" || mode === "image" ? (
+ <div className="flex w-[calc(24rem*var(--ui-space-scale,1))] max-w-full flex-col gap-3">
+ <GreetingModeOptions mode={mode} />
+ </div>
+ ) : undefined
+ }
+ >
+ <GreetingTiles mode={mode} />
+ </SettingsRow>
+ );
+}
diff --git a/studio/frontend/src/features/settings/tabs/appearance-tab.tsx b/studio/frontend/src/features/settings/tabs/appearance-tab.tsx
index 8d447bc17dc..0a6665e8b0a 100644
--- a/studio/frontend/src/features/settings/tabs/appearance-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/appearance-tab.tsx
@@ -12,7 +12,6 @@ import { Button } from "@/components/ui/button";
import { Switch } from "@/components/ui/switch";
import { useSidebarPin } from "@/hooks/use-sidebar-pin";
import { useChatPreferencesStore } from "@/features/chat";
-import { useUserProfileStore } from "@/features/profile";
import { useT } from "@/i18n";
import { isTauri } from "@/lib/api-base";
import {
@@ -35,6 +34,7 @@ import {
} from "../components/appearance-custom-controls";
import { CodeDisplayPreview } from "../components/code-display-preview";
import { ColorThemeSelect } from "../components/color-theme-select";
+import { GreetingSettingsRows } from "../components/greeting-controls";
import { GpuRenderingSegmented } from "../components/gpu-rendering-segmented";
import { SettingsRow } from "../components/settings-row";
import { SidebarMenuCustomizer } from "../components/sidebar-menu-customizer";
@@ -168,10 +168,6 @@ export function AppearanceTab() {
const setComposerAtBottom = useChatPreferencesStore(
(s) => s.setNewChatComposerAtBottom,
);
- const showGreetingSloth = useUserProfileStore((s) => s.showGreetingSloth);
- const setShowGreetingSloth = useUserProfileStore(
- (s) => s.setShowGreetingSloth,
- );
const sidebarNavSectionRef = useRef<HTMLDivElement | null>(null);
const scrollTarget = useSettingsDialogStore((s) => s.scrollTarget);
const consumeScrollTarget = useSettingsDialogStore(
@@ -262,17 +258,7 @@ export function AppearanceTab() {
>
<ChatWidthSelect />
</SettingsRow>
- <SettingsRow
- label={t("settings.profile.greetingSloth")}
- description={t("settings.profile.greetingSlothDescription")}
- >
- <Switch
- aria-label={t("settings.profile.greetingSloth")}
- id="profile-greeting-sloth"
- checked={showGreetingSloth}
- onCheckedChange={setShowGreetingSloth}
- />
- </SettingsRow>
+ <GreetingSettingsRows />
<SettingsRow
label={t("settings.chat.composerAtBottom")}
description={t("settings.chat.composerAtBottomDescription")}
diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.ts
index 2a471cfaf79..958878a0a8c 100644
--- a/studio/frontend/src/i18n/locales/ar.ts
+++ b/studio/frontend/src/i18n/locales/ar.ts
@@ -41,8 +41,8 @@ export const ar = {
scopeChats: "المحادثات",
scopeAll: "كل الصفحات",
positionValue: "أفقي {x}%، عمودي {y}%",
- newChat: "دردشة جديدة",
- conversation: "محادثة",
+ newChat: "معاينة محادثة جديدة",
+ conversation: "معاينة المحادثة",
prompt: "ماذا تود استكشافه؟",
response: "تبقى محادثتك واضحة فوق الخلفية.",
storageError: "تعذر حفظ الخلفية. تحقق من مساحة تخزين المتصفح.",
@@ -2218,6 +2218,13 @@ export const ar = {
pictureOptions: "خيارات صورة الملف الشخصي",
greetingSloth: "التحية",
greetingSlothDescription: "إظهار التحية في المحادثات الجديدة.",
+ greetingDefault: "افتراضي",
+ greetingCustom: "مخصص",
+ greetingImage: "صورة",
+ greetingText: "نص التحية",
+ greetingTextDescription: "اتركه فارغًا لاستخدام التحيات المدمجة.",
+ greetingFileError: "اختر صورة PNG أو JPEG أو WebP أو GIF أصغر من 10 ميغابايت.",
+ greetingImageError: "تعذر استخدام هذه الصورة. جرّب صورة أصغر.",
noPicture: "لا توجد صورة ملف شخصي",
noneLabel: "بلا",
stats: {
@@ -2346,7 +2353,7 @@ export const ar = {
chatWidth: {
label: "عرض المحادثة",
description: "عرض الرسائل وحقل الكتابة.",
- standard: "قياسي",
+ standard: "افتراضي",
wide: "واسع",
full: "العرض الكامل",
},
diff --git a/studio/frontend/src/i18n/locales/cs.ts b/studio/frontend/src/i18n/locales/cs.ts
index f6f32de541a..1f6ce15dd5c 100644
--- a/studio/frontend/src/i18n/locales/cs.ts
+++ b/studio/frontend/src/i18n/locales/cs.ts
@@ -41,8 +41,8 @@ export const cs = {
scopeChats: "Chaty",
scopeAll: "Všechny stránky",
positionValue: "Vodorovně {x} %, svisle {y} %",
- newChat: "Nový chat",
- conversation: "Konverzace",
+ newChat: "Náhled nového chatu",
+ conversation: "Náhled konverzace",
prompt: "Co chcete prozkoumat?",
response: "Konverzace zůstává na pozadí čitelná.",
storageError: "Pozadí se nepodařilo uložit. Zkontrolujte dostupné úložiště prohlížeče.",
@@ -2416,6 +2416,13 @@ export const cs = {
avatarShapeRounded: "Zaoblený",
greetingSloth: "Pozdrav",
greetingSlothDescription: "Zobrazovat pozdrav v nových chatech.",
+ greetingDefault: "Výchozí",
+ greetingCustom: "Vlastní",
+ greetingImage: "Obrázek",
+ greetingText: "Text pozdravu",
+ greetingTextDescription: "Ponechte prázdné a použijí se vestavěné pozdravy.",
+ greetingFileError: "Vyberte PNG, JPEG, WebP nebo GIF menší než 10 MB.",
+ greetingImageError: "Tento obrázek nelze použít. Zkuste menší.",
chooseSloth: "Nebo vyberte lenochoda",
noPicture: "Žádný profilový obrázek",
noneLabel: "Žádný",
@@ -2561,7 +2568,7 @@ export const cs = {
chatWidth: {
label: "Šířka chatu",
description: "Šířka zpráv a pole zprávy.",
- standard: "Standardní",
+ standard: "Výchozí",
wide: "Široká",
full: "Plná šířka",
},
diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.ts
index 5cffc07805a..4733f069b8f 100644
--- a/studio/frontend/src/i18n/locales/de.ts
+++ b/studio/frontend/src/i18n/locales/de.ts
@@ -41,8 +41,8 @@ export const de = {
scopeChats: "Chats",
scopeAll: "Allen Seiten",
positionValue: "Horizontal {x} %, vertikal {y} %",
- newChat: "Neuer Chat",
- conversation: "Unterhaltung",
+ newChat: "Vorschau für neuen Chat",
+ conversation: "Vorschau der Unterhaltung",
prompt: "Was möchtest du erkunden?",
response: "Deine Unterhaltung bleibt vor dem Hintergrund gut lesbar.",
storageError: "Der Hintergrund konnte nicht gespeichert werden. Prüfe den Browserspeicher.",
@@ -2247,6 +2247,13 @@ export const de = {
pictureOptions: "Optionen für das Profilbild",
greetingSloth: "Begrüßung",
greetingSlothDescription: "Die Begrüßung in neuen Chats anzeigen.",
+ greetingDefault: "Standard",
+ greetingCustom: "Eigene",
+ greetingImage: "Bild",
+ greetingText: "Begrüßungstext",
+ greetingTextDescription: "Leer lassen, um die eingebauten Begrüßungen zu verwenden.",
+ greetingFileError: "Wähle ein PNG, JPEG, WebP oder GIF unter 10 MB.",
+ greetingImageError: "Dieses Bild konnte nicht verwendet werden. Versuche ein kleineres.",
noPicture: "Kein Profilbild",
noneLabel: "Keines",
stats: {
diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.ts
index 4bcc713c758..bc913c25e2c 100644
--- a/studio/frontend/src/i18n/locales/en.ts
+++ b/studio/frontend/src/i18n/locales/en.ts
@@ -38,8 +38,8 @@ export const en = {
scopeChats: "Chats",
scopeAll: "All pages",
positionValue: "Horizontal {x}%, vertical {y}%",
- newChat: "New chat",
- conversation: "Conversation",
+ newChat: "New chat preview",
+ conversation: "Conversation preview",
prompt: "What would you like to explore?",
response: "Your conversation stays clear over the background.",
storageError: "Could not save the background. Check available browser storage.",
@@ -2221,6 +2221,13 @@ export const en = {
avatarShapeRounded: "Rounded",
greetingSloth: "Greeting",
greetingSlothDescription: "Show the greeting on new chats.",
+ greetingDefault: "Default",
+ greetingCustom: "Custom",
+ greetingImage: "Image",
+ greetingText: "Greeting text",
+ greetingTextDescription: "Leave blank to use the built-in greetings.",
+ greetingFileError: "Choose a PNG, JPEG, WebP or GIF under 10 MB.",
+ greetingImageError: "This image couldn't be used. Try a smaller one.",
chooseSloth: "Or pick a sloth",
noPicture: "No profile picture",
noneLabel: "None",
@@ -2360,7 +2367,7 @@ export const en = {
chatWidth: {
label: "Chat width",
description: "Width of messages and the composer.",
- standard: "Standard",
+ standard: "Default",
wide: "Wide",
full: "Full width",
},
diff --git a/studio/frontend/src/i18n/locales/es-419.ts b/studio/frontend/src/i18n/locales/es-419.ts
index 2d15129df4e..8eae6e7f0d5 100644
--- a/studio/frontend/src/i18n/locales/es-419.ts
+++ b/studio/frontend/src/i18n/locales/es-419.ts
@@ -41,8 +41,8 @@ export const es419 = {
scopeChats: "Chats",
scopeAll: "Todas las páginas",
positionValue: "Horizontal {x} %, vertical {y} %",
- newChat: "Nuevo chat",
- conversation: "Conversación",
+ newChat: "Vista previa del chat nuevo",
+ conversation: "Vista previa de la conversación",
prompt: "¿Qué te gustaría explorar?",
response: "Tu conversación sigue siendo legible sobre el fondo.",
storageError: "No se pudo guardar el fondo. Comprueba el almacenamiento del navegador.",
@@ -2434,6 +2434,13 @@ export const es419 = {
avatarShapeRounded: "Redondeada",
greetingSloth: "Saludo",
greetingSlothDescription: "Mostrar el saludo en los chats nuevos.",
+ greetingDefault: "Predeterminado",
+ greetingCustom: "Personalizado",
+ greetingImage: "Imagen",
+ greetingText: "Texto del saludo",
+ greetingTextDescription: "Déjalo vacío para usar los saludos integrados.",
+ greetingFileError: "Elige un PNG, JPEG, WebP o GIF de menos de 10 MB.",
+ greetingImageError: "No se pudo usar esta imagen. Prueba con una más pequeña.",
chooseSloth: "O elige un perezoso",
noPicture: "Sin foto de perfil",
noneLabel: "Ninguno",
@@ -2579,7 +2586,7 @@ export const es419 = {
chatWidth: {
label: "Ancho del chat",
description: "Ancho de los mensajes y del cuadro de redacción.",
- standard: "Estándar",
+ standard: "Predeterminado",
wide: "Amplio",
full: "Ancho completo",
},
diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.ts
index 45b768f5ce3..ed4bbc08208 100644
--- a/studio/frontend/src/i18n/locales/es.ts
+++ b/studio/frontend/src/i18n/locales/es.ts
@@ -41,8 +41,8 @@ export const es = {
scopeChats: "Chats",
scopeAll: "Todas las páginas",
positionValue: "Horizontal {x} %, vertical {y} %",
- newChat: "Nuevo chat",
- conversation: "Conversación",
+ newChat: "Vista previa del chat nuevo",
+ conversation: "Vista previa de la conversación",
prompt: "¿Qué te gustaría explorar?",
response: "Tu conversación sigue siendo legible sobre el fondo.",
storageError: "No se pudo guardar el fondo. Comprueba el almacenamiento del navegador.",
@@ -2242,6 +2242,13 @@ export const es = {
pictureOptions: "Opciones de la foto de perfil",
greetingSloth: "Saludo",
greetingSlothDescription: "Mostrar el saludo en los chats nuevos.",
+ greetingDefault: "Predeterminado",
+ greetingCustom: "Personalizado",
+ greetingImage: "Imagen",
+ greetingText: "Texto del saludo",
+ greetingTextDescription: "Déjalo vacío para usar los saludos integrados.",
+ greetingFileError: "Elige un PNG, JPEG, WebP o GIF de menos de 10 MB.",
+ greetingImageError: "No se pudo usar esta imagen. Prueba con una más pequeña.",
noPicture: "Sin foto de perfil",
noneLabel: "Ninguno",
stats: {
@@ -2370,7 +2377,7 @@ export const es = {
chatWidth: {
label: "Ancho del chat",
description: "Ancho de los mensajes y del cuadro de texto.",
- standard: "Estándar",
+ standard: "Predeterminado",
wide: "Amplio",
full: "Ancho completo",
},
diff --git a/studio/frontend/src/i18n/locales/fa.ts b/studio/frontend/src/i18n/locales/fa.ts
index b1610e2e8de..6bd8cecfccd 100644
--- a/studio/frontend/src/i18n/locales/fa.ts
+++ b/studio/frontend/src/i18n/locales/fa.ts
@@ -41,8 +41,8 @@ export const fa = {
scopeChats: "گفتگوها",
scopeAll: "همهٔ صفحه‌ها",
positionValue: "افقی {x}٪، عمودی {y}٪",
- newChat: "گفتگوی جدید",
- conversation: "گفتگو",
+ newChat: "پیش‌نمایش گفتگوی جدید",
+ conversation: "پیش‌نمایش گفتگو",
prompt: "می‌خواهید چه چیزی را بررسی کنید؟",
response: "متن گفتگو روی پس‌زمینه خوانا می‌ماند.",
storageError: "ذخیرهٔ پس‌زمینه ممکن نشد. فضای ذخیره‌سازی مرورگر را بررسی کنید.",
@@ -2388,6 +2388,13 @@ export const fa = {
avatarShapeRounded: "گوشه‌گرد",
greetingSloth: "خوشامدگویی",
greetingSlothDescription: "نمایش خوشامدگویی در گفتگوهای جدید.",
+ greetingDefault: "پیش‌فرض",
+ greetingCustom: "سفارشی",
+ greetingImage: "تصویر",
+ greetingText: "متن خوشامدگویی",
+ greetingTextDescription: "برای استفاده از خوشامدگویی‌های داخلی، خالی بگذارید.",
+ greetingFileError: "یک تصویر PNG، JPEG، WebP یا GIF کمتر از ۱۰ مگابایت انتخاب کنید.",
+ greetingImageError: "این تصویر قابل استفاده نیست. تصویر کوچک‌تری را امتحان کنید.",
chooseSloth: "یا یک تنبل انتخاب کنید",
noPicture: "بدون تصویر نمایه",
noneLabel: "هیچ",
@@ -2533,7 +2540,7 @@ export const fa = {
chatWidth: {
label: "عرض گفتگو",
description: "عرض پیام‌ها و کادر نوشتن.",
- standard: "استاندارد",
+ standard: "پیش‌فرض",
wide: "عریض",
full: "تمام عرض",
},
diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.ts
index a3b4677cbf8..9314a7a291d 100644
--- a/studio/frontend/src/i18n/locales/fr.ts
+++ b/studio/frontend/src/i18n/locales/fr.ts
@@ -41,8 +41,8 @@ export const fr = {
scopeChats: "Discussions",
scopeAll: "Toutes les pages",
positionValue: "Horizontal {x} %, vertical {y} %",
- newChat: "Nouveau chat",
- conversation: "Conversation",
+ newChat: "Aperçu d'une nouvelle discussion",
+ conversation: "Aperçu d'une conversation",
prompt: "Que souhaitez-vous explorer ?",
response: "Votre conversation reste lisible sur l’arrière-plan.",
storageError: "Impossible d’enregistrer l’arrière-plan. Vérifiez le stockage du navigateur.",
@@ -2245,6 +2245,13 @@ export const fr = {
pictureOptions: "Options de la photo de profil",
greetingSloth: "Message d'accueil",
greetingSlothDescription: "Afficher le message d'accueil dans les nouvelles discussions.",
+ greetingDefault: "Par défaut",
+ greetingCustom: "Personnalisé",
+ greetingImage: "Image",
+ greetingText: "Texte d'accueil",
+ greetingTextDescription: "Laissez vide pour utiliser les messages d'accueil intégrés.",
+ greetingFileError: "Choisissez un PNG, JPEG, WebP ou GIF de moins de 10 Mo.",
+ greetingImageError: "Impossible d'utiliser cette image. Essayez-en une plus petite.",
noPicture: "Aucune photo de profil",
noneLabel: "Aucun",
stats: {
@@ -2373,7 +2380,7 @@ export const fr = {
chatWidth: {
label: "Largeur du chat",
description: "Largeur des messages et de la zone de saisie.",
- standard: "Standard",
+ standard: "Par défaut",
wide: "Large",
full: "Pleine largeur",
},
diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.ts
index 9c35c35dac1..9a672d3947f 100644
--- a/studio/frontend/src/i18n/locales/he.ts
+++ b/studio/frontend/src/i18n/locales/he.ts
@@ -41,8 +41,8 @@ export const he = {
scopeChats: "צ׳אטים",
scopeAll: "כל הדפים",
positionValue: "אופקי {x}%, אנכי {y}%",
- newChat: "צ׳אט חדש",
- conversation: "שיחה",
+ newChat: "תצוגה מקדימה של צ'אט חדש",
+ conversation: "תצוגה מקדימה של שיחה",
prompt: "מה תרצו לחקור?",
response: "השיחה נשארת ברורה על גבי הרקע.",
storageError: "לא ניתן לשמור את הרקע. בדקו את שטח האחסון בדפדפן.",
@@ -2263,6 +2263,13 @@ export const he = {
avatarShapeRounded: "פינות מעוגלות",
greetingSloth: "ברכה",
greetingSlothDescription: "הצגת הברכה בצ'אטים חדשים.",
+ greetingDefault: "ברירת מחדל",
+ greetingCustom: "מותאם אישית",
+ greetingImage: "תמונה",
+ greetingText: "טקסט הברכה",
+ greetingTextDescription: "השאירו ריק כדי להשתמש בברכות המובנות.",
+ greetingFileError: "בחרו קובץ PNG, JPEG, WebP או GIF קטן מ-10 MB.",
+ greetingImageError: "לא ניתן להשתמש בתמונה הזו. נסו תמונה קטנה יותר.",
chooseSloth: "או בחר עצלן",
noPicture: "ללא תמונת פרופיל",
noneLabel: "ללא",
@@ -2402,7 +2409,7 @@ export const he = {
chatWidth: {
label: "רוחב הצ'אט",
description: "רוחב ההודעות ותיבת ההודעה.",
- standard: "רגיל",
+ standard: "ברירת מחדל",
wide: "רחב",
full: "רוחב מלא",
},
diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.ts
index 5d508cdc1d6..988e5c2e8ab 100644
--- a/studio/frontend/src/i18n/locales/hi.ts
+++ b/studio/frontend/src/i18n/locales/hi.ts
@@ -41,8 +41,8 @@ export const hi = {
scopeChats: "चैट",
scopeAll: "सभी पेज",
positionValue: "क्षैतिज {x}%, लंबवत {y}%",
- newChat: "नई चैट",
- conversation: "बातचीत",
+ newChat: "नई चैट का पूर्वावलोकन",
+ conversation: "बातचीत का पूर्वावलोकन",
prompt: "आप क्या जानना चाहेंगे?",
response: "पृष्ठभूमि पर भी आपकी बातचीत स्पष्ट रहती है।",
storageError: "पृष्ठभूमि सहेजी नहीं जा सकी। ब्राउज़र का संग्रहण जाँचें।",
@@ -2224,6 +2224,13 @@ export const hi = {
pictureOptions: "प्रोफ़ाइल फ़ोटो विकल्प",
greetingSloth: "अभिवादन",
greetingSlothDescription: "नई चैट में अभिवादन दिखाएँ।",
+ greetingDefault: "डिफ़ॉल्ट",
+ greetingCustom: "कस्टम",
+ greetingImage: "चित्र",
+ greetingText: "अभिवादन टेक्स्ट",
+ greetingTextDescription: "बिल्ट-इन अभिवादन इस्तेमाल करने के लिए खाली छोड़ें।",
+ greetingFileError: "10 MB से छोटी PNG, JPEG, WebP या GIF फ़ाइल चुनें।",
+ greetingImageError: "यह चित्र उपयोग नहीं हो सका। कोई छोटा चित्र आज़माएँ।",
noPicture: "कोई प्रोफ़ाइल फ़ोटो नहीं",
noneLabel: "कोई नहीं",
stats: {
@@ -2352,7 +2359,7 @@ export const hi = {
chatWidth: {
label: "चैट की चौड़ाई",
description: "संदेशों और इनपुट बॉक्स की चौड़ाई।",
- standard: "मानक",
+ standard: "डिफ़ॉल्ट",
wide: "चौड़ा",
full: "पूरी चौड़ाई",
},
diff --git a/studio/frontend/src/i18n/locales/id.ts b/studio/frontend/src/i18n/locales/id.ts
index be1601a40dd..1cd54b22234 100644
--- a/studio/frontend/src/i18n/locales/id.ts
+++ b/studio/frontend/src/i18n/locales/id.ts
@@ -41,8 +41,8 @@ export const id = {
scopeChats: "Chat",
scopeAll: "Semua halaman",
positionValue: "Horizontal {x}%, vertikal {y}%",
- newChat: "Chat baru",
- conversation: "Percakapan",
+ newChat: "Pratinjau chat baru",
+ conversation: "Pratinjau percakapan",
prompt: "Apa yang ingin Anda jelajahi?",
response: "Percakapan Anda tetap jelas di atas latar belakang.",
storageError: "Tidak dapat menyimpan latar belakang. Periksa ruang penyimpanan browser.",
@@ -2397,6 +2397,13 @@ export const id = {
avatarShapeRounded: "Membulat",
greetingSloth: "Sapaan",
greetingSlothDescription: "Tampilkan sapaan di chat baru.",
+ greetingDefault: "Bawaan",
+ greetingCustom: "Kustom",
+ greetingImage: "Gambar",
+ greetingText: "Teks sapaan",
+ greetingTextDescription: "Kosongkan untuk memakai sapaan bawaan.",
+ greetingFileError: "Pilih PNG, JPEG, WebP, atau GIF di bawah 10 MB.",
+ greetingImageError: "Gambar ini tidak dapat digunakan. Coba yang lebih kecil.",
chooseSloth: "Atau pilih sloth",
noPicture: "Tidak ada foto profil",
noneLabel: "Tidak ada",
@@ -2544,7 +2551,7 @@ export const id = {
chatWidth: {
label: "Lebar chat",
description: "Lebar pesan dan kolom pesan.",
- standard: "Standar",
+ standard: "Bawaan",
wide: "Lebar",
full: "Lebar penuh",
},
diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.ts
index 73e9f58b765..e60198f176a 100644
--- a/studio/frontend/src/i18n/locales/it.ts
+++ b/studio/frontend/src/i18n/locales/it.ts
@@ -38,8 +38,8 @@ export const it = {
scopeChats: "Chat",
scopeAll: "Tutte le pagine",
positionValue: "Orizzontale {x}%, verticale {y}%",
- newChat: "Nuova chat",
- conversation: "Conversazione",
+ newChat: "Anteprima nuova chat",
+ conversation: "Anteprima conversazione",
prompt: "Cosa vorresti esplorare?",
response: "La conversazione rimane leggibile sullo sfondo.",
storageError: "Impossibile salvare lo sfondo. Controlla lo spazio del browser.",
@@ -2136,6 +2136,13 @@ export const it = {
avatarShapeRounded: "Arrotondata",
greetingSloth: "Saluto",
greetingSlothDescription: "Mostra il saluto nelle nuove chat.",
+ greetingDefault: "Predefinito",
+ greetingCustom: "Personalizzato",
+ greetingImage: "Immagine",
+ greetingText: "Testo del saluto",
+ greetingTextDescription: "Lascia vuoto per usare i saluti predefiniti.",
+ greetingFileError: "Scegli un PNG, JPEG, WebP o GIF inferiore a 10 MB.",
+ greetingImageError: "Impossibile usare questa immagine. Prova con una più piccola.",
chooseSloth: "Oppure scegli un bradipo",
noPicture: "Nessuna immagine del profilo",
noneLabel: "Nessuna",
@@ -2275,7 +2282,7 @@ export const it = {
chatWidth: {
label: "Larghezza chat",
description: "Larghezza dei messaggi e del campo di testo.",
- standard: "Standard",
+ standard: "Predefinito",
wide: "Ampia",
full: "Larghezza piena",
},
diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.ts
index 59b4c749425..fe0de625f9e 100644
--- a/studio/frontend/src/i18n/locales/ja.ts
+++ b/studio/frontend/src/i18n/locales/ja.ts
@@ -42,8 +42,8 @@ export const ja = {
scopeChats: "チャット",
scopeAll: "すべてのページ",
positionValue: "横 {x}%、縦 {y}%",
- newChat: "新しいチャット",
- conversation: "会話",
+ newChat: "新しいチャットのプレビュー",
+ conversation: "会話のプレビュー",
prompt: "何を調べたいですか?",
response: "背景があっても会話は読みやすく表示されます。",
storageError: "背景を保存できませんでした。ブラウザーの空き容量を確認してください。",
@@ -2189,6 +2189,13 @@ export const ja = {
avatarShapeRounded: "角丸",
greetingSloth: "あいさつ",
greetingSlothDescription: "新しいチャットにあいさつを表示します。",
+ greetingDefault: "デフォルト",
+ greetingCustom: "カスタム",
+ greetingImage: "画像",
+ greetingText: "あいさつのテキスト",
+ greetingTextDescription: "空欄にすると、組み込みのあいさつを使います。",
+ greetingFileError: "10 MB 未満の PNG、JPEG、WebP、GIF を選んでください。",
+ greetingImageError: "この画像は使用できませんでした。もっと小さい画像を試してください。",
chooseSloth: "またはナマケモノのプロフィール画像を選択",
noPicture: "プロフィール画像なし",
noneLabel: "なし",
@@ -2329,7 +2336,7 @@ export const ja = {
chatWidth: {
label: "チャットの幅",
description: "メッセージと入力欄の幅です。",
- standard: "標準",
+ standard: "デフォルト",
wide: "広い",
full: "全幅",
},
diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.ts
index b27f48b7b6c..19fd5bed304 100644
--- a/studio/frontend/src/i18n/locales/ko.ts
+++ b/studio/frontend/src/i18n/locales/ko.ts
@@ -41,8 +41,8 @@ export const ko = {
scopeChats: "채팅",
scopeAll: "모든 페이지",
positionValue: "가로 {x}%, 세로 {y}%",
- newChat: "새 채팅",
- conversation: "대화",
+ newChat: "새 채팅 미리보기",
+ conversation: "대화 미리보기",
prompt: "무엇을 알아보고 싶으신가요?",
response: "배경 위에서도 대화가 선명하게 표시됩니다.",
storageError: "배경을 저장할 수 없습니다. 브라우저 저장 공간을 확인하세요.",
@@ -2212,6 +2212,13 @@ export const ko = {
pictureOptions: "프로필 사진 옵션",
greetingSloth: "인사말",
greetingSlothDescription: "새 채팅에 인사말을 표시합니다.",
+ greetingDefault: "기본값",
+ greetingCustom: "사용자 지정",
+ greetingImage: "이미지",
+ greetingText: "인사말 텍스트",
+ greetingTextDescription: "비워 두면 기본 제공 인사말을 사용합니다.",
+ greetingFileError: "10MB 미만의 PNG, JPEG, WebP 또는 GIF를 선택하세요.",
+ greetingImageError: "이 이미지를 사용할 수 없습니다. 더 작은 이미지를 사용해 보세요.",
noPicture: "프로필 사진 없음",
noneLabel: "없음",
stats: {
@@ -2340,7 +2347,7 @@ export const ko = {
chatWidth: {
label: "채팅 너비",
description: "메시지와 입력창의 너비입니다.",
- standard: "표준",
+ standard: "기본값",
wide: "넓게",
full: "전체 너비",
},
diff --git a/studio/frontend/src/i18n/locales/nl.ts b/studio/frontend/src/i18n/locales/nl.ts
index 7651e2ed675..bc9b1384d79 100644
--- a/studio/frontend/src/i18n/locales/nl.ts
+++ b/studio/frontend/src/i18n/locales/nl.ts
@@ -41,8 +41,8 @@ export const nl = {
scopeChats: "Chats",
scopeAll: "Alle pagina’s",
positionValue: "Horizontaal {x}%, verticaal {y}%",
- newChat: "Nieuwe chat",
- conversation: "Gesprek",
+ newChat: "Voorbeeld nieuwe chat",
+ conversation: "Voorbeeld gesprek",
prompt: "Wat wil je ontdekken?",
response: "Je gesprek blijft goed leesbaar op de achtergrond.",
storageError: "Kan de achtergrond niet opslaan. Controleer de beschikbare browseropslag.",
@@ -2436,6 +2436,13 @@ export const nl = {
avatarShapeRounded: "Afgerond",
greetingSloth: "Begroeting",
greetingSlothDescription: "De begroeting tonen bij nieuwe chats.",
+ greetingDefault: "Standaard",
+ greetingCustom: "Aangepast",
+ greetingImage: "Afbeelding",
+ greetingText: "Begroetingstekst",
+ greetingTextDescription: "Laat leeg om de ingebouwde begroetingen te gebruiken.",
+ greetingFileError: "Kies een PNG, JPEG, WebP of GIF kleiner dan 10 MB.",
+ greetingImageError: "Deze afbeelding kan niet worden gebruikt. Probeer een kleinere.",
chooseSloth: "Of kies een luiaard",
noPicture: "Geen profielfoto",
noneLabel: "Geen",
diff --git a/studio/frontend/src/i18n/locales/pl.ts b/studio/frontend/src/i18n/locales/pl.ts
index 993178ce587..6ce7f040392 100644
--- a/studio/frontend/src/i18n/locales/pl.ts
+++ b/studio/frontend/src/i18n/locales/pl.ts
@@ -41,8 +41,8 @@ export const pl = {
scopeChats: "Czatach",
scopeAll: "Wszystkich stronach",
positionValue: "Poziomo {x}%, pionowo {y}%",
- newChat: "Nowy czat",
- conversation: "Rozmowa",
+ newChat: "Podgląd nowego czatu",
+ conversation: "Podgląd rozmowy",
prompt: "Co chcesz odkryć?",
response: "Rozmowa pozostaje czytelna na tle.",
storageError: "Nie udało się zapisać tła. Sprawdź dostępne miejsce w pamięci przeglądarki.",
@@ -2430,6 +2430,13 @@ export const pl = {
avatarShapeRounded: "Zaokrąglony",
greetingSloth: "Powitanie",
greetingSlothDescription: "Pokazuj powitanie w nowych czatach.",
+ greetingDefault: "Domyślne",
+ greetingCustom: "Własne",
+ greetingImage: "Obraz",
+ greetingText: "Tekst powitania",
+ greetingTextDescription: "Pozostaw puste, aby używać wbudowanych powitań.",
+ greetingFileError: "Wybierz plik PNG, JPEG, WebP lub GIF mniejszy niż 10 MB.",
+ greetingImageError: "Nie można użyć tego obrazu. Spróbuj mniejszego.",
chooseSloth: "Lub wybierz leniwca",
noPicture: "Brak zdjęcia profilowego",
noneLabel: "Brak",
@@ -2576,7 +2583,7 @@ export const pl = {
chatWidth: {
label: "Szerokość czatu",
description: "Szerokość wiadomości i pola wiadomości.",
- standard: "Standardowa",
+ standard: "Domyślna",
wide: "Szeroka",
full: "Pełna szerokość",
},
diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.ts
index c1190078f09..66e7ff33e50 100644
--- a/studio/frontend/src/i18n/locales/pt-br.ts
+++ b/studio/frontend/src/i18n/locales/pt-br.ts
@@ -41,8 +41,8 @@ export const ptBR = {
scopeChats: "Chats",
scopeAll: "Todas as páginas",
positionValue: "Horizontal {x}%, vertical {y}%",
- newChat: "Novo chat",
- conversation: "Conversa",
+ newChat: "Prévia de nova conversa",
+ conversation: "Prévia da conversa",
prompt: "O que você gostaria de explorar?",
response: "Sua conversa continua legível sobre o fundo.",
storageError: "Não foi possível salvar o fundo. Verifique o armazenamento do navegador.",
@@ -2220,6 +2220,13 @@ export const ptBR = {
avatarShapeRounded: "Arredondado",
greetingSloth: "Saudação",
greetingSlothDescription: "Mostrar a saudação nas novas conversas.",
+ greetingDefault: "Padrão",
+ greetingCustom: "Personalizado",
+ greetingImage: "Imagem",
+ greetingText: "Texto da saudação",
+ greetingTextDescription: "Deixe vazio para usar as saudações integradas.",
+ greetingFileError: "Escolha um PNG, JPEG, WebP ou GIF com menos de 10 MB.",
+ greetingImageError: "Não foi possível usar esta imagem. Tente uma menor.",
chooseSloth: "Ou escolha um bicho-preguiça",
noPicture: "Sem foto de perfil",
noneLabel: "Nenhuma",
diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.ts
index 377ba4400dc..64171ba2c10 100644
--- a/studio/frontend/src/i18n/locales/ru.ts
+++ b/studio/frontend/src/i18n/locales/ru.ts
@@ -41,8 +41,8 @@ export const ru = {
scopeChats: "В чатах",
scopeAll: "На всех страницах",
positionValue: "По горизонтали {x}%, по вертикали {y}%",
- newChat: "Новый чат",
- conversation: "Переписка",
+ newChat: "Предпросмотр нового чата",
+ conversation: "Предпросмотр беседы",
prompt: "Что вы хотите изучить?",
response: "Переписка остаётся хорошо видимой на фоне.",
storageError: "Не удалось сохранить фон. Проверьте хранилище браузера.",
@@ -2228,6 +2228,13 @@ export const ru = {
pictureOptions: "Параметры фото профиля",
greetingSloth: "Приветствие",
greetingSlothDescription: "Показывать приветствие в новых чатах.",
+ greetingDefault: "По умолчанию",
+ greetingCustom: "Своё",
+ greetingImage: "Изображение",
+ greetingText: "Текст приветствия",
+ greetingTextDescription: "Оставьте пустым, чтобы использовать встроенные приветствия.",
+ greetingFileError: "Выберите PNG, JPEG, WebP или GIF размером до 10 МБ.",
+ greetingImageError: "Не удалось использовать это изображение. Попробуйте изображение поменьше.",
noPicture: "Нет фото профиля",
noneLabel: "Нет",
stats: {
@@ -2356,7 +2363,7 @@ export const ru = {
chatWidth: {
label: "Ширина чата",
description: "Ширина сообщений и поля ввода.",
- standard: "Стандартная",
+ standard: "По умолчанию",
wide: "Широкая",
full: "Полная ширина",
},
diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.ts
index e558b6e90fc..c56ffce4606 100644
--- a/studio/frontend/src/i18n/locales/sv.ts
+++ b/studio/frontend/src/i18n/locales/sv.ts
@@ -38,8 +38,8 @@ export const sv = {
scopeChats: "Chattar",
scopeAll: "Alla sidor",
positionValue: "Horisontellt {x} %, vertikalt {y} %",
- newChat: "Ny chatt",
- conversation: "Konversation",
+ newChat: "Förhandsvisning av ny chatt",
+ conversation: "Förhandsvisning av konversation",
prompt: "Vad vill du utforska?",
response: "Konversationen förblir tydlig mot bakgrunden.",
storageError: "Det gick inte att spara bakgrunden. Kontrollera webbläsarens lagringsutrymme.",
@@ -2333,6 +2333,13 @@ export const sv = {
avatarShapeRounded: "Avrundad",
greetingSloth: "Hälsning",
greetingSlothDescription: "Visa hälsningen i nya chattar.",
+ greetingDefault: "Standard",
+ greetingCustom: "Egen",
+ greetingImage: "Bild",
+ greetingText: "Hälsningstext",
+ greetingTextDescription: "Lämna tomt för att använda de inbyggda hälsningarna.",
+ greetingFileError: "Välj en PNG, JPEG, WebP eller GIF under 10 MB.",
+ greetingImageError: "Bilden kunde inte användas. Prova en mindre.",
chooseSloth: "Eller välj en sengångare",
noPicture: "Ingen profilbild",
noneLabel: "Ingen",
diff --git a/studio/frontend/src/i18n/locales/th.ts b/studio/frontend/src/i18n/locales/th.ts
index 9193c53bc8b..ab5686babf3 100644
--- a/studio/frontend/src/i18n/locales/th.ts
+++ b/studio/frontend/src/i18n/locales/th.ts
@@ -41,8 +41,8 @@ export const th = {
scopeChats: "แชท",
scopeAll: "ทุกหน้า",
positionValue: "แนวนอน {x}% แนวตั้ง {y}%",
- newChat: "แชทใหม่",
- conversation: "การสนทนา",
+ newChat: "ตัวอย่างแชทใหม่",
+ conversation: "ตัวอย่างการสนทนา",
prompt: "คุณอยากสำรวจอะไร?",
response: "ข้อความสนทนายังคงอ่านได้ชัดเจนบนพื้นหลัง",
storageError: "บันทึกพื้นหลังไม่ได้ ตรวจสอบพื้นที่จัดเก็บของเบราว์เซอร์",
@@ -2295,6 +2295,13 @@ export const th = {
avatarShapeRounded: "มุมมน",
greetingSloth: "คำทักทาย",
greetingSlothDescription: "แสดงคำทักทายในแชทใหม่",
+ greetingDefault: "ค่าเริ่มต้น",
+ greetingCustom: "กำหนดเอง",
+ greetingImage: "รูปภาพ",
+ greetingText: "ข้อความทักทาย",
+ greetingTextDescription: "เว้นว่างไว้เพื่อใช้คำทักทายในตัว",
+ greetingFileError: "เลือกไฟล์ PNG, JPEG, WebP หรือ GIF ที่มีขนาดไม่เกิน 10 MB",
+ greetingImageError: "ใช้รูปภาพนี้ไม่ได้ ลองใช้รูปที่เล็กกว่านี้",
chooseSloth: "หรือเลือกสลอธ",
noPicture: "ไม่มีรูปโปรไฟล์",
noneLabel: "ไม่มี",
@@ -2439,7 +2446,7 @@ export const th = {
chatWidth: {
label: "ความกว้างของแชท",
description: "ความกว้างของข้อความและช่องเขียนข้อความ",
- standard: "มาตรฐาน",
+ standard: "ค่าเริ่มต้น",
wide: "กว้าง",
full: "เต็มความกว้าง",
},
diff --git a/studio/frontend/src/i18n/locales/tr.ts b/studio/frontend/src/i18n/locales/tr.ts
index 36c20a59a1b..575f93a9f4d 100644
--- a/studio/frontend/src/i18n/locales/tr.ts
+++ b/studio/frontend/src/i18n/locales/tr.ts
@@ -41,8 +41,8 @@ export const tr = {
scopeChats: "Sohbetler",
scopeAll: "Tüm sayfalar",
positionValue: "Yatay %{x}, dikey %{y}",
- newChat: "Yeni sohbet",
- conversation: "Sohbet",
+ newChat: "Yeni sohbet önizlemesi",
+ conversation: "Konuşma önizlemesi",
prompt: "Ne keşfetmek istersiniz?",
response: "Sohbetiniz arka plan üzerinde okunaklı kalır.",
storageError: "Arka plan kaydedilemedi. Tarayıcının kullanılabilir depolama alanını kontrol edin.",
@@ -2392,6 +2392,13 @@ export const tr = {
avatarShapeRounded: "Yuvarlatılmış",
greetingSloth: "Karşılama",
greetingSlothDescription: "Yeni sohbetlerde karşılamayı gösterin.",
+ greetingDefault: "Varsayılan",
+ greetingCustom: "Özel",
+ greetingImage: "Görsel",
+ greetingText: "Karşılama metni",
+ greetingTextDescription: "Yerleşik karşılamaları kullanmak için boş bırakın.",
+ greetingFileError: "10 MB'den küçük bir PNG, JPEG, WebP veya GIF seçin.",
+ greetingImageError: "Bu görsel kullanılamadı. Daha küçük bir görsel deneyin.",
chooseSloth: "Veya bir tembel hayvan seçin",
noPicture: "Profil resmi yok",
noneLabel: "Yok",
@@ -2536,7 +2543,7 @@ export const tr = {
chatWidth: {
label: "Sohbet genişliği",
description: "Mesajların ve yazma alanının genişliği.",
- standard: "Standart",
+ standard: "Varsayılan",
wide: "Geniş",
full: "Tam genişlik",
},
diff --git a/studio/frontend/src/i18n/locales/uk.ts b/studio/frontend/src/i18n/locales/uk.ts
index c746cd2185b..fd45579b40e 100644
--- a/studio/frontend/src/i18n/locales/uk.ts
+++ b/studio/frontend/src/i18n/locales/uk.ts
@@ -41,8 +41,8 @@ export const uk = {
scopeChats: "У чатах",
scopeAll: "На всіх сторінках",
positionValue: "По горизонталі {x}%, по вертикалі {y}%",
- newChat: "Новий чат",
- conversation: "Розмова",
+ newChat: "Попередній перегляд нового чату",
+ conversation: "Попередній перегляд розмови",
prompt: "Що хочете дослідити?",
response: "Розмова залишається чіткою на тлі.",
storageError: "Не вдалося зберегти тло. Перевірте доступне сховище браузера.",
@@ -2423,6 +2423,13 @@ export const uk = {
avatarShapeRounded: "Заокруглена",
greetingSloth: "Привітання",
greetingSlothDescription: "Показувати привітання в нових чатах.",
+ greetingDefault: "За замовчуванням",
+ greetingCustom: "Власне",
+ greetingImage: "Зображення",
+ greetingText: "Текст привітання",
+ greetingTextDescription: "Залиште порожнім, щоб використовувати вбудовані привітання.",
+ greetingFileError: "Виберіть PNG, JPEG, WebP або GIF розміром до 10 МБ.",
+ greetingImageError: "Не вдалося використати це зображення. Спробуйте менше.",
chooseSloth: "Або виберіть лінивця",
noPicture: "Немає зображення профілю",
noneLabel: "Немає",
@@ -2568,7 +2575,7 @@ export const uk = {
chatWidth: {
label: "Ширина чату",
description: "Ширина повідомлень і поля введення.",
- standard: "Стандартна",
+ standard: "За замовчуванням",
wide: "Широка",
full: "На всю ширину",
},
diff --git a/studio/frontend/src/i18n/locales/vi.ts b/studio/frontend/src/i18n/locales/vi.ts
index 950b17d1dd2..f3b679553b4 100644
--- a/studio/frontend/src/i18n/locales/vi.ts
+++ b/studio/frontend/src/i18n/locales/vi.ts
@@ -41,8 +41,8 @@ export const vi = {
scopeChats: "Trò chuyện",
scopeAll: "Mọi trang",
positionValue: "Ngang {x}%, dọc {y}%",
- newChat: "Cuộc trò chuyện mới",
- conversation: "Cuộc trò chuyện",
+ newChat: "Xem trước cuộc trò chuyện mới",
+ conversation: "Xem trước hội thoại",
prompt: "Bạn muốn khám phá điều gì?",
response: "Nội dung trò chuyện vẫn rõ ràng trên nền.",
storageError: "Không thể lưu nền. Kiểm tra dung lượng lưu trữ của trình duyệt.",
@@ -2403,6 +2403,13 @@ export const vi = {
avatarShapeRounded: "Bo góc",
greetingSloth: "Lời chào",
greetingSlothDescription: "Hiển thị lời chào trong cuộc trò chuyện mới.",
+ greetingDefault: "Mặc định",
+ greetingCustom: "Tùy chỉnh",
+ greetingImage: "Hình ảnh",
+ greetingText: "Nội dung lời chào",
+ greetingTextDescription: "Để trống để dùng lời chào có sẵn.",
+ greetingFileError: "Chọn ảnh PNG, JPEG, WebP hoặc GIF dưới 10 MB.",
+ greetingImageError: "Không thể dùng hình ảnh này. Hãy thử ảnh nhỏ hơn.",
chooseSloth: "Hoặc chọn một chú lười",
noPicture: "Không có ảnh hồ sơ",
noneLabel: "Không có",
@@ -2548,7 +2555,7 @@ export const vi = {
chatWidth: {
label: "Độ rộng khung trò chuyện",
description: "Độ rộng của tin nhắn và khung soạn thảo.",
- standard: "Tiêu chuẩn",
+ standard: "Mặc định",
wide: "Rộng",
full: "Toàn chiều rộng",
},
diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.ts
index ec55c7f3cc1..95829dc2fbe 100644
--- a/studio/frontend/src/i18n/locales/zh-CN.ts
+++ b/studio/frontend/src/i18n/locales/zh-CN.ts
@@ -41,8 +41,8 @@ export const zhCN = {
scopeChats: "聊天",
scopeAll: "所有页面",
positionValue: "水平 {x}%,垂直 {y}%",
- newChat: "新聊天",
- conversation: "对话",
+ newChat: "新聊天预览",
+ conversation: "对话预览",
prompt: "你想探索什么?",
response: "背景上的对话依然清晰可读。",
storageError: "无法保存背景。请检查浏览器存储空间。",
@@ -2181,6 +2181,13 @@ export const zhCN = {
avatarShapeRounded: "圆角矩形",
greetingSloth: "问候语",
greetingSlothDescription: "在新聊天中显示问候语。",
+ greetingDefault: "默认",
+ greetingCustom: "自定义",
+ greetingImage: "图片",
+ greetingText: "问候语文字",
+ greetingTextDescription: "留空则使用内置问候语。",
+ greetingFileError: "请选择小于 10 MB 的 PNG、JPEG、WebP 或 GIF 图片。",
+ greetingImageError: "无法使用此图片,请换一张更小的图片。",
chooseSloth: "或选择一只树懒作为头像",
noPicture: "无头像",
noneLabel: "无",
@@ -2332,7 +2339,7 @@ export const zhCN = {
chatWidth: {
label: "聊天宽度",
description: "消息和输入框的宽度。",
- standard: "标准",
+ standard: "默认",
wide: "宽",
full: "全宽",
},
diff --git a/studio/frontend/src/i18n/locales/zh-TW.ts b/studio/frontend/src/i18n/locales/zh-TW.ts
index e8e2e515396..34b758ba623 100644
--- a/studio/frontend/src/i18n/locales/zh-TW.ts
+++ b/studio/frontend/src/i18n/locales/zh-TW.ts
@@ -41,8 +41,8 @@ export const zhTW = {
scopeChats: "聊天",
scopeAll: "所有頁面",
positionValue: "水平 {x}%,垂直 {y}%",
- newChat: "新對話",
- conversation: "對話",
+ newChat: "新聊天預覽",
+ conversation: "對話預覽",
prompt: "你想探索什麼?",
response: "對話內容在背景上保持清晰。",
storageError: "無法儲存背景。請檢查瀏覽器可用儲存空間。",
@@ -2283,6 +2283,13 @@ export const zhTW = {
avatarShapeRounded: "圓角",
greetingSloth: "問候語",
greetingSlothDescription: "在新聊天中顯示問候語。",
+ greetingDefault: "預設",
+ greetingCustom: "自訂",
+ greetingImage: "圖片",
+ greetingText: "問候語文字",
+ greetingTextDescription: "留空則使用內建問候語。",
+ greetingFileError: "請選擇小於 10 MB 的 PNG、JPEG、WebP 或 GIF 圖片。",
+ greetingImageError: "無法使用此圖片,請換一張較小的圖片。",
chooseSloth: "或選一隻樹懶",
noPicture: "沒有大頭貼",
noneLabel: "無",
@@ -2426,7 +2433,7 @@ export const zhTW = {
chatWidth: {
label: "聊天寬度",
description: "訊息與輸入框的寬度。",
- standard: "標準",
+ standard: "預設",
wide: "寬",
full: "全寬",
},
diff --git a/studio/frontend/tests/greeting-customization.test.ts b/studio/frontend/tests/greeting-customization.test.ts
new file mode 100644
index 00000000000..5fb7bfad81e
--- /dev/null
+++ b/studio/frontend/tests/greeting-customization.test.ts
@@ -0,0 +1,146 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import {
+ DEFAULT_GREETING,
+ GREETING_ICON_LIMITS,
+ GREETING_IMAGE_LIMITS,
+ resolveGreeting,
+ sanitizeGreeting,
+ validGreetingUpload,
+} from "../src/features/profile/greeting.ts";
+import { readText } from "./helpers/kit.ts";
+
+const PNG = "data:image/png;base64,AAAA";
+
+test("the default greeting is the sloth with the built-in lines", () => {
+ assert.deepEqual(resolveGreeting(DEFAULT_GREETING), {
+ kind: "text",
+ icon: { kind: "sloth" },
+ text: null,
+ });
+});
+
+test("the old switch still turns the whole greeting off", () => {
+ assert.deepEqual(
+ resolveGreeting({
+ ...DEFAULT_GREETING,
+ showGreetingSloth: false,
+ greetingStyle: "image",
+ greetingImageDataUrl: PNG,
+ }),
+ { kind: "off" },
+ );
+});
+
+test("each mode resolves to what the welcome screen draws", () => {
+ assert.deepEqual(
+ resolveGreeting({
+ ...DEFAULT_GREETING,
+ greetingIcon: "custom",
+ greetingIconDataUrl: PNG,
+ greetingText: " Hi ",
+ }),
+ { kind: "text", icon: { kind: "custom", src: PNG }, text: "Hi" },
+ );
+ assert.deepEqual(
+ resolveGreeting({ ...DEFAULT_GREETING, greetingIcon: "none" }),
+ {
+ kind: "text",
+ icon: { kind: "none" },
+ text: null,
+ },
+ );
+ assert.deepEqual(
+ resolveGreeting({
+ ...DEFAULT_GREETING,
+ greetingStyle: "image",
+ greetingImageDataUrl: PNG,
+ }),
+ { kind: "image", src: PNG },
+ );
+});
+
+test("an image greeting without an upload falls back to the default", () => {
+ assert.deepEqual(
+ resolveGreeting({
+ ...DEFAULT_GREETING,
+ greetingStyle: "image",
+ greetingIcon: "custom",
+ greetingText: "Hi",
+ }),
+ { kind: "text", icon: { kind: "sloth" }, text: null },
+ );
+});
+
+test("custom without an icon is text only; custom words only show in custom", () => {
+ assert.deepEqual(
+ resolveGreeting({
+ ...DEFAULT_GREETING,
+ greetingIcon: "custom",
+ greetingText: "Hi",
+ }),
+ { kind: "text", icon: { kind: "none" }, text: "Hi" },
+ );
+ assert.deepEqual(
+ resolveGreeting({ ...DEFAULT_GREETING, greetingText: "Hi" }),
+ { kind: "text", icon: { kind: "sloth" }, text: null },
+ );
+});
+
+test("stored values that are not raster data URLs never reach an img", () => {
+ for (const bad of [
+ "data:image/svg+xml;base64,PHN2Zz48L3N2Zz4=",
+ "javascript:alert(1)",
+ "https://example.com/a.png",
+ "data:image/png;base64,AA AA",
+ ]) {
+ const s = sanitizeGreeting({
+ greetingIconDataUrl: bad,
+ greetingImageDataUrl: bad,
+ });
+ assert.equal(s.greetingIconDataUrl, null, bad);
+ assert.equal(s.greetingImageDataUrl, null, bad);
+ }
+ const s = sanitizeGreeting({
+ greetingStyle: "video",
+ greetingIcon: 3,
+ greetingText: "x".repeat(500),
+ });
+ assert.equal(s.greetingStyle, "text");
+ assert.equal(s.greetingIcon, "sloth");
+ assert.equal(s.greetingText.length, 100);
+});
+
+test("uploads are image types under the cap, never SVG", () => {
+ assert.equal(validGreetingUpload({ type: "image/png", size: 1000 }), true);
+ assert.equal(validGreetingUpload({ type: "image/gif", size: 1000 }), true);
+ assert.equal(
+ validGreetingUpload({ type: "image/svg+xml", size: 1000 }),
+ false,
+ );
+ assert.equal(validGreetingUpload({ type: "text/html", size: 1000 }), false);
+ assert.equal(validGreetingUpload({ type: "image/png", size: 0 }), false);
+ assert.equal(
+ validGreetingUpload({ type: "image/png", size: 11 * 1024 * 1024 }),
+ false,
+ );
+});
+
+test("the client size limits fit inside the server caps", () => {
+ const source = readText("../../backend/routes/settings.py");
+ const icon = /MAX_GREETING_ICON_DATA_URL_LENGTH = (\d+) \* 1024/.exec(source);
+ assert.ok(icon, "could not find MAX_GREETING_ICON_DATA_URL_LENGTH");
+ assert.ok(GREETING_ICON_LIMITS.maxBytes * 1.35 < Number(icon[1]) * 1024);
+ const avatar = readText("../../backend/utils/personalization_settings.py");
+ const image = /MAX_AVATAR_DATA_URL_BYTES = (\d+) \* 1024/.exec(avatar);
+ assert.ok(image, "could not find MAX_AVATAR_DATA_URL_BYTES");
+ assert.match(
+ source,
+ /MAX_GREETING_IMAGE_DATA_URL_LENGTH = MAX_AVATAR_DATA_URL_BYTES/,
+ );
+ assert.ok(GREETING_IMAGE_LIMITS.maxBytes * 1.35 < Number(image[1]) * 1024);
+});
diff --git a/studio/frontend/tests/personalization-locale-hydration.test.ts b/studio/frontend/tests/personalization-locale-hydration.test.ts
index d673c9ee58c..b75ee2ce1e9 100644
--- a/studio/frontend/tests/personalization-locale-hydration.test.ts
+++ b/studio/frontend/tests/personalization-locale-hydration.test.ts
@@ -8,6 +8,7 @@ import test from "node:test";
import { loadWithStubs } from "./helpers/module-stubs.ts";
import { sanitizeCustomization } from "../src/features/settings/stores/appearance-custom-store.ts";
+import * as greeting from "../src/features/profile/greeting.ts";
type Slot = {
value?: unknown;
@@ -26,6 +27,11 @@ type Profile = {
avatarDataUrl: string | null;
avatarShape: "circle" | "rounded";
showGreetingSloth: boolean;
+ greetingStyle?: string;
+ greetingIcon?: string;
+ greetingIconDataUrl?: string | null;
+ greetingText?: string;
+ greetingImageDataUrl?: string | null;
};
type SavedPayload = {
@@ -160,7 +166,7 @@ function remotePersonalization(language: string) {
nickname: "",
avatarDataUrl: null,
avatarShape: "circle" as const,
- showGreetingSloth: true,
+ ...greeting.DEFAULT_GREETING,
},
appearance: {
theme: "system",
@@ -182,7 +188,9 @@ function setup(
remote?: ReturnType<typeof remotePersonalization> & {
chatWidthSaved?: boolean;
sentAttachmentsSaved?: boolean;
+ greetingCustomSaved?: boolean;
};
+ localProfile?: Partial<Profile>;
// Holds the personalization GET open until it resolves.
remoteGate?: Promise<void>;
} = {},
@@ -208,7 +216,8 @@ function setup(
nickname: "",
avatarDataUrl: null,
avatarShape: "circle",
- showGreetingSloth: true,
+ ...greeting.DEFAULT_GREETING,
+ ...options.localProfile,
};
let preference = "auto";
let releaseLocale!: () => void;
@@ -273,6 +282,7 @@ function setup(
},
useLocalePreference: () => preference,
},
+ "../greeting": greeting,
"../stores/user-profile-store": {
PROFILE_TEXT_MAX_LENGTH: 200,
useUserProfileStore: profileStore,
@@ -286,6 +296,7 @@ function setup(
runTimers,
saves,
customization: () => customization,
+ profile: () => profile,
// What a settings control does: a new customization object in the store.
edit(next: Record<string, unknown>) {
customization = sanitizeCustomization({ ...customization, ...next });
@@ -535,3 +546,52 @@ test("without an edit in flight the saved server customization still wins", asyn
assert.equal(app.customization().uiFontSize, 20);
app.host.unmount();
});
+
+const ICON = "data:image/png;base64,AAAA";
+
+test("a server record from before the custom greeting keeps and re-pushes the local one", async () => {
+ const app = setup("stalled", {
+ localProfile: { greetingIcon: "custom", greetingIconDataUrl: ICON, greetingText: "Hi" },
+ remote: remotePersonalization("auto"),
+ });
+ app.render();
+ await settle();
+ app.render();
+
+ assert.equal(app.profile().greetingIcon, "custom");
+ assert.equal(app.profile().greetingIconDataUrl, ICON);
+ assert.equal(app.profile().greetingText, "Hi");
+ app.runTimers();
+ await settle();
+ assert.equal(app.saves.length, 1);
+ assert.equal(app.saves[0]?.profile.greetingIconDataUrl, ICON);
+ app.host.unmount();
+});
+
+test("a saved server greeting wins over the local one", async () => {
+ const remote = remotePersonalization("auto");
+ const app = setup("stalled", {
+ localProfile: { greetingText: "Local" },
+ remote: {
+ ...remote,
+ version: 6,
+ greetingCustomSaved: true,
+ profile: {
+ ...remote.profile,
+ greetingStyle: "image",
+ greetingImageDataUrl: ICON,
+ },
+ },
+ });
+ app.render();
+ await settle();
+ app.render();
+
+ assert.equal(app.profile().greetingStyle, "image");
+ assert.equal(app.profile().greetingImageDataUrl, ICON);
+ assert.equal(app.profile().greetingText, "");
+ app.runTimers();
+ await settle();
+ assert.equal(app.saves.length, 0);
+ app.host.unmount();
+});