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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: always show composer attachments as cards, rename sent layouts (#12418)
Michael Han3532764aff36
diff --git a/studio/backend/routes/settings.py b/studio/backend/routes/settings.pyindex 37dca75f757..8d0cb5306fe 100644--- a/studio/backend/routes/settings.py+++ b/studio/backend/routes/settings.py@@ -4064,7 +4064,6 @@ class PersonalizationCustomization(BaseModel):uiFontSize: Optional[int] = Field(None, ge = 12, le = 20)codeFontSize: Optional[int] = Field(None, ge = 10, le = 20)chatWidth: Literal["standard", "wide", "full"] = "standard"- composerAttachments: Literal["cards", "compact"] = "cards"sentAttachments: Literal["auto", "list", "chips"] = "auto"contrast: int = Field(50, ge = 0, le = 100)pointerCursors: bool = False@@ -4176,7 +4175,6 @@ class PersonalizationResponse(PersonalizationPayload):# overrides instead of treating a server-filled default as an explicit value.customizationSaved: bool = FalsechatWidthSaved: bool = False- composerAttachmentsSaved: bool = FalsesentAttachmentsSaved: bool = FalsepaletteSaved: bool = FalsegreetingSlothSaved: bool = False@@ -4194,9 +4192,6 @@ def get_personalization_settings(profile = stored.get("profile") if isinstance(stored, dict) else Noneresponse.customizationSaved = isinstance(appearance, dict) and "customization" in appearanceresponse.chatWidthSaved = isinstance(customization, dict) and "chatWidth" in customization- response.composerAttachmentsSaved = (- isinstance(customization, dict) and "composerAttachments" in customization- )response.sentAttachmentsSaved = (isinstance(customization, dict) and "sentAttachments" in customization)diff --git a/studio/backend/tests/test_personalization_settings.py b/studio/backend/tests/test_personalization_settings.pyindex 844a2bd83af..039b1906247 100644--- a/studio/backend/tests/test_personalization_settings.py+++ b/studio/backend/tests/test_personalization_settings.py@@ -90,7 +90,6 @@ def test_customization_defaults():assert c.chatFont is Noneassert c.uiFontSize is Noneassert c.chatWidth == "standard"- assert c.composerAttachments == "cards"assert c.sentAttachments == "auto"assert [(i.id, i.visible) for i in c.sidebarMenu] == [("api", True),@@ -117,10 +116,6 @@ def test_customization_invalid_values_rejected():PersonalizationPayload.model_validate({"appearance": {"customization": {"uiFontSize": 99}}})with pytest.raises(ValidationError):PersonalizationPayload.model_validate({"appearance": {"customization": {"contrast": 500}}})- with pytest.raises(ValidationError):- PersonalizationPayload.model_validate(- {"appearance": {"customization": {"composerAttachments": "huge"}}}- )with pytest.raises(ValidationError):PersonalizationPayload.model_validate({"appearance": {"customization": {"sentAttachments": "grid"}}}@@ -510,7 +505,6 @@ def test_personalization_route_roundtrip_real_shape(monkeypatch):"headingFont": "Avenir Next","chatFont": "Georgia","chatWidth": "full",- "composerAttachments": "compact","sentAttachments": "chips","codeFont": None,"importedFonts": [@@ -626,30 +620,38 @@ def test_personalization_legacy_attachment_display_presence(monkeypatch):client = _shared_setup_1(monkeypatch, store)body = client.get("/api/settings/personalization").json()assert body["customizationSaved"] is True- assert body["composerAttachmentsSaved"] is Falseassert body["sentAttachmentsSaved"] is False- assert body["appearance"]["customization"]["composerAttachments"] == "cards"assert body["appearance"]["customization"]["sentAttachments"] == "auto"put = client.put("/api/settings/personalization",- json = {"appearance": {"customization": {"composerAttachments": "compact"}}},+ json = {"appearance": {"customization": {"sentAttachments": "chips"}}},)assert put.status_code == 200body = client.get("/api/settings/personalization").json()- assert body["composerAttachmentsSaved"] is True- assert body["sentAttachmentsSaved"] is False- assert body["appearance"]["customization"]["composerAttachments"] == "compact"+ assert body["sentAttachmentsSaved"] is True+ assert body["appearance"]["customization"]["sentAttachments"] == "chips"+++def test_personalization_ignores_retired_composer_attachments(monkeypatch):+ # The composer always shows cards now; older clients and records may still carry the key.+ store = {+ pers.PERSONALIZATION_SETTING_KEY: {+ "appearance": {"customization": {"composerAttachments": "compact"}},+ }+ }+ client = _shared_setup_1(monkeypatch, store)+ body = client.get("/api/settings/personalization").json()+ assert "composerAttachments" not in body["appearance"]["customization"]+ assert "composerAttachmentsSaved" not in bodyput = client.put("/api/settings/personalization",- json = {"appearance": {"customization": {"sentAttachments": "chips"}}},+ json = {"appearance": {"customization": {"composerAttachments": "compact"}}},)assert put.status_code == 200body = client.get("/api/settings/personalization").json()- assert body["sentAttachmentsSaved"] is True- assert body["appearance"]["customization"]["sentAttachments"] == "chips"- assert body["appearance"]["customization"]["composerAttachments"] == "compact"+ assert "composerAttachments" not in body["appearance"]["customization"]@pytest.mark.parametrize("width", ["standard", "wide", "full"])diff --git a/studio/frontend/src/components/assistant-ui/attachment.tsx b/studio/frontend/src/components/assistant-ui/attachment.tsxindex b57d9352dd0..5fb0332549e 100644--- a/studio/frontend/src/components/assistant-ui/attachment.tsx+++ b/studio/frontend/src/components/assistant-ui/attachment.tsx@@ -18,11 +18,6 @@ import {DialogTitle,DialogTrigger,} from "@/components/ui/dialog";-import {- Tooltip,- TooltipContent,- TooltipTrigger,-} from "@/components/ui/tooltip";import {ATTACHMENT_KIND_ICON_CLASS,ATTACHMENT_KIND_ICONS,@@ -30,7 +25,6 @@ import {attachmentFileKind,attachmentKindLabel,composerAttachmentsOverflow,- isAudioAttachment,sentAttachmentLayout,type AttachmentFileKind,type SentAttachmentLayout,@@ -52,9 +46,7 @@ import {useAuiState,} from "@assistant-ui/react";import {- AudioWave01Icon,FileEmpty02Icon,- FlimSlateIcon,TextAlignLeft01Icon,} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";@@ -73,48 +65,6 @@ import {} from "react";import { ScrollPane } from "./scroll-pane";-// Before the audio names, which include .mp4 and .webm: the video adapter types every clip video/*.-const isVideoAttachment = (attachment: unknown): boolean =>- /^video\//i.test((attachment as { contentType?: string }).contentType ?? "");--const AttachmentThumb: FC = () => {- const src = useAttachmentImageSrc();- const name = useAuiState(({ attachment }) => attachment.name);- const isVideo = useAuiState(({ attachment }) => isVideoAttachment(attachment));- const contentType = useAuiState(- ({ attachment }) =>- (attachment as { file?: File }).file?.type ??- (attachment as { contentType?: string }).contentType ??- "",- );-- if (src) {- return (- <img- src={src}- alt={name || "Attachment preview"}- className="h-full w-full object-cover"- />- );- }-- return (- <div className="flex h-full w-full items-center justify-center">- <HugeiconsIcon- icon={- isVideo- ? FlimSlateIcon- : isAudioAttachment(name, contentType)- ? AudioWave01Icon- : FileEmpty02Icon- }- strokeWidth={2}- className="size-6 text-muted-foreground"- />- </div>- );-};-const CARD_SLOT ="shrink-0 w-[calc((100%_-_var(--spacing)*8)/5)] min-w-[calc(7rem*var(--ui-space-scale,1))]";const CARD_SIZE = "h-[calc(7rem*var(--ui-space-scale,1))] w-full";@@ -299,14 +249,14 @@ const PastedTextPreviewDialog: FC<);};-type PastedTextVariant = "chip" | "card" | "row" | "pill";+type PastedTextVariant = "card" | "row" | "pill";const PastedTextAttachmentUI: FC<{attachment: PastedTextAttachment;isComposer: boolean;name: string;- variant?: PastedTextVariant;-}> = ({ attachment, isComposer, name, variant = "chip" }) => {+ variant: PastedTextVariant;+}> = ({ attachment, isComposer, name, variant }) => {const aui = useAui();const attachmentId = useAuiState(({ attachment: state }) => state.id);const [inlining, setInlining] = useState(false);@@ -416,7 +366,7 @@ const PastedTextAttachmentUI: FC<{</span></span></button>- ) : variant === "pill" ? (+ ) : (<buttonclassName={cn("aui-pasted-text-pill inline-flex h-9 max-w-[calc(16rem*var(--ui-space-scale,1))] cursor-pointer items-center gap-1.5 rounded-full px-3 text-sm transition-colors",@@ -430,45 +380,6 @@ const PastedTextAttachmentUI: FC<{{textIcon("size-4")}<span className="truncate">{name}</span></button>- ) : (- <button- className={cn(- // Borderless, and in dark mode a shade under the composer surface.- "aui-pasted-text-chip group flex h-14 max-w-[calc(15rem*var(--ui-space-scale,1))] min-w-0 cursor-pointer items-center gap-2.5 rounded-[14px] bg-muted px-3 text-left transition-colors hover:bg-muted-foreground/15 dark:bg-background dark:hover:bg-muted",- // Keep the label clear of the remove button in the corner.- isComposer && "aui-pasted-text-chip-composer pr-6",- )}- type="button"- aria-label={- canInline- ? `Pasted text: ${name}. Show in text field`- : `Pasted text: ${name}. Show contents`- }- onClick={canInline ? showInTextField : undefined}- >- <span className="flex size-8 shrink-0 items-center justify-center rounded-lg bg-[color-mix(in_oklab,var(--foreground)_calc(10%*var(--contrast-wash-gain,1)),transparent)]">- <HugeiconsIcon- icon={TextAlignLeft01Icon}- strokeWidth={2}- className="size-4 text-muted-foreground"- />- </span>- <span className="flex min-w-0 flex-col">- <span className="truncate font-medium text-xs">{name}</span>- <span className="truncate text-ui-11 text-muted-foreground">- {/* Hover swaps the size for the action. */}- <span className={canInline ? "group-hover:hidden" : undefined}>- {bytes === undefined ? "Pasted text" : formatBytes(bytes)}- </span>- {canInline ? (- <span className="hidden items-center gap-0.5 underline underline-offset-2 group-hover:inline-flex">- Show in text field- <ChevronRightIcon className="size-3" />- </span>- ) : null}- </span>- </span>- </button>);return (@@ -485,106 +396,11 @@ const PastedTextAttachmentUI: FC<{{chip}</PastedTextPreviewDialog>)}- {isComposer &&- (variant === "card" ? <AttachmentCardRemove /> : <AttachmentRemove />)}+ {isComposer && <AttachmentCardRemove />}</AttachmentPrimitive.Root>);};-const AttachmentUI: FC = () => {- const aui = useAui();- const isComposer = aui.attachment.source === "composer";- const pastedText = usePastedTextAttachment();-- const isImage = useAuiState(({ attachment }) => attachment.type === "image");- const attachmentId = useAuiState(({ attachment }) => attachment.id);- const name = useAuiState(({ attachment }) => attachment.name);- const typeLabel = useAuiState(({ attachment }) => {- const type = attachment.type;- switch (type) {- case "image":- return "Image";- case "document":- return "Document";- case "file":- if (isVideoAttachment(attachment)) return "Video";- return isAudioAttachment(- attachment.name,- (attachment as { file?: File }).file?.type ?? "",- )- ? "Audio"- : "File";- default:- throw new Error(`Unknown attachment type: ${type as string}`);- }- });- // Filename in accessible name lets screen readers distinguish same-typed- // attachments. Sighted users get it via the tooltip.- const accessibleName = name- ? `${typeLabel} attachment: ${name}`- : `${typeLabel} attachment`;-- if (pastedText) {- return (- <PastedTextAttachmentUI- key={attachmentId}- attachment={pastedText}- isComposer={isComposer}- name={name ?? "Pasted text"}- />- );- }-- return (- <Tooltip>- <AttachmentPrimitive.Root- key={attachmentId}- className={cn(- "aui-attachment-root relative",- isImage &&- "aui-attachment-root-composer only:[&>#attachment-tile]:size-16",- )}- >- <AttachmentPreviewDialog redactFromReload={isComposer}>- <TooltipTrigger asChild={true}>- <button- className={cn(- "aui-attachment-tile size-14 cursor-pointer overflow-hidden rounded-[14px] border bg-muted transition-opacity hover:opacity-75",- isComposer &&- "aui-attachment-tile-composer border-[color-mix(in_oklab,var(--foreground)_calc(20%*var(--contrast-edge-gain,1)),transparent)]",- )}- id="attachment-tile"- aria-label={accessibleName}- type="button"- >- <AttachmentThumb />- </button>- </TooltipTrigger>- </AttachmentPreviewDialog>- {isComposer && <AttachmentRemove />}- </AttachmentPrimitive.Root>- <TooltipContent side="top" className="tooltip-compact">- <AttachmentPrimitive.Name />- </TooltipContent>- </Tooltip>- );-};--const AttachmentRemove: FC = () => {- return (- <AttachmentPrimitive.Remove asChild={true}>- <Button- variant="ghost"- size="icon"- aria-label="Remove file"- className="aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white p-0 text-muted-foreground opacity-100 shadow-sm hover:bg-white! [&_svg]:text-black hover:[&_svg]:text-destructive"- >- <XIcon className="aui-attachment-remove-icon size-3 dark:stroke-[2.5px]" />- </Button>- </AttachmentPrimitive.Remove>- );-};-const AttachmentCardRemove: FC = () => {return (<AttachmentPrimitive.Remove asChild={true}>@@ -773,7 +589,6 @@ const SENT_FILE_COMPONENTS = {Document: SentFileItem,File: SentFileItem,};-const COMPACT_COMPONENTS = { Attachment: AttachmentUI };const CARD_COMPONENTS = { Attachment: ComposerAttachmentCard };export const UserMessageAttachments: FC = () => {@@ -807,7 +622,7 @@ export const UserMessageAttachments: FC = () => {};// The layout decision is a DOM data attribute, never state, so a resize or new card re-renders no card.-const ComposerAttachmentCards: FC<{ className?: string }> = ({ className }) => {+export const ComposerAttachments: FC<{ className?: string }> = ({ className }) => {const count = useAuiState(({ composer }) => composer.attachments.length);const ref = useRef<HTMLDivElement | null>(null);const previousCount = useRef(count);@@ -868,26 +683,6 @@ const ComposerAttachmentCards: FC<{ className?: string }> = ({ className }) => {);};-export const ComposerAttachments: FC<{ className?: string }> = ({- className,-}) => {- const style = useAppearanceCustomStore(- (s) => s.customization.composerAttachments,- );- if (style === "cards") return <ComposerAttachmentCards className={className} />;- return (- <div- data-reload-snapshot-sensitive- className={cn(- "aui-composer-attachments mb-4 flex w-full flex-row items-center gap-2 overflow-x-auto px-1.5 pt-0.5 pb-1 empty:hidden",- className,- )}- >- <ComposerPrimitive.Attachments components={COMPACT_COMPONENTS} />- </div>- );-};-export const ComposerAddAttachment: FC = () => {return (<ComposerPrimitive.AddAttachment asChild={true}>diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsxindex 7bd694c24bc..588312aba88 100644--- a/studio/frontend/src/components/assistant-ui/thread.tsx+++ b/studio/frontend/src/components/assistant-ui/thread.tsx@@ -8746,7 +8746,7 @@ const EditComposer: FC = () => {submitEdit();}}>- <ComposerAttachments className="mb-0 px-3 pt-3 [&_.aui-pasted-text-chip:not(:hover)]:bg-background" />+ <ComposerAttachments className="mb-0 px-3 pt-3" /><ComposerPrimitive.InputsubmitMode={effectiveSendShortcut(sendShortcut, editMultiline ? "\n" : "") === "mod-enter"diff --git a/studio/frontend/src/features/profile/hooks/use-personalization-sync.ts b/studio/frontend/src/features/profile/hooks/use-personalization-sync.tsindex 4beb871ca53..1f9d984eb66 100644--- a/studio/frontend/src/features/profile/hooks/use-personalization-sync.ts+++ b/studio/frontend/src/features/profile/hooks/use-personalization-sync.ts@@ -277,9 +277,6 @@ export function usePersonalizationSync(enabled: boolean): void {const keepLocalChatWidth =remote.chatWidthSaved === false ||remote.appearance.customization?.chatWidth === undefined;- const keepLocalComposerAttachments =- remote.composerAttachmentsSaved === false ||- remote.appearance.customization?.composerAttachments === undefined;const keepLocalSentAttachments =remote.sentAttachmentsSaved === false ||remote.appearance.customization?.sentAttachments === undefined;@@ -290,9 +287,6 @@ export function usePersonalizationSync(enabled: boolean): void {...(keepLocalChatWidth && {chatWidth: localCustomization.chatWidth,}),- ...(keepLocalComposerAttachments && {- composerAttachments: localCustomization.composerAttachments,- }),...(keepLocalSentAttachments && {sentAttachments: localCustomization.sentAttachments,}),diff --git a/studio/frontend/src/features/settings/api/personalization.ts b/studio/frontend/src/features/settings/api/personalization.tsindex 28c62af2bb2..e819cc2409a 100644--- a/studio/frontend/src/features/settings/api/personalization.ts+++ b/studio/frontend/src/features/settings/api/personalization.ts@@ -31,7 +31,6 @@ export type Personalization = {// client then keeps local values instead of the server-filled defaults.customizationSaved: boolean;chatWidthSaved?: boolean;- composerAttachmentsSaved?: boolean;sentAttachmentsSaved?: boolean;paletteSaved: boolean;greetingSlothSaved: boolean;@@ -53,7 +52,6 @@ export async function savePersonalization(| "saved"| "customizationSaved"| "chatWidthSaved"- | "composerAttachmentsSaved"| "sentAttachmentsSaved"| "paletteSaved"| "greetingSlothSaved"diff --git a/studio/frontend/src/features/settings/components/appearance-custom-controls.tsx b/studio/frontend/src/features/settings/components/appearance-custom-controls.tsxindex 8f6bbbd1375..24bfda95af7 100644--- a/studio/frontend/src/features/settings/components/appearance-custom-controls.tsx+++ b/studio/frontend/src/features/settings/components/appearance-custom-controls.tsx@@ -49,7 +49,6 @@ import {DEFAULT_CUSTOMIZATION,MAX_IMPORTED_FONTS,MAX_TOTAL_IMPORTED_FONT_DATA_URL_LENGTH,- type ComposerAttachmentsSetting,type ReduceMotionSetting,type SentAttachmentsSetting,UI_FONT_SIZE_RANGE,@@ -919,43 +918,6 @@ export function ChatWidthSelect() {);}-const COMPOSER_ATTACHMENTS_OPTIONS: ComposerAttachmentsSetting[] = [- "cards",- "compact",-];--export function ComposerAttachmentsSelect() {- const t = useT();- const value = useAppearanceCustomStore(- (s) => s.customization.composerAttachments,- );- const patch = useAppearanceCustomStore((s) => s.patch);- return (- <Select- value={value}- onValueChange={(next) => {- if (next === "cards" || next === "compact") {- patch({ composerAttachments: next });- }- }}- >- <SelectTrigger- className="w-40"- aria-label={t("settings.appearance.custom.composerAttachments.label")}- >- <SelectValue />- </SelectTrigger>- <SelectContent>- {COMPOSER_ATTACHMENTS_OPTIONS.map((option) => (- <SelectItem key={option} value={option}>- {t(`settings.appearance.custom.composerAttachments.${option}`)}- </SelectItem>- ))}- </SelectContent>- </Select>- );-}-const SENT_ATTACHMENTS_OPTIONS: SentAttachmentsSetting[] = ["auto", "list", "chips"];export function SentAttachmentsSelect() {diff --git a/studio/frontend/src/features/settings/settings-search.ts b/studio/frontend/src/features/settings/settings-search.tsindex 55a7d89d3a6..9c27e5067c5 100644--- a/studio/frontend/src/features/settings/settings-search.ts+++ b/studio/frontend/src/features/settings/settings-search.ts@@ -72,7 +72,6 @@ export const SETTINGS_SEARCH_INDEX: Record<SettingsTab, TranslationKey[]> = {"settings.appearance.custom.headingFont.label","settings.appearance.custom.chatFont.label","settings.appearance.custom.chatWidth.label",- "settings.appearance.custom.composerAttachments.label","settings.appearance.custom.sentAttachments.label","settings.appearance.custom.codeFont.label","settings.appearance.custom.contrast.label",diff --git a/studio/frontend/src/features/settings/stores/appearance-custom-store.ts b/studio/frontend/src/features/settings/stores/appearance-custom-store.tsindex f4c325f8f47..b86178e10c3 100644--- a/studio/frontend/src/features/settings/stores/appearance-custom-store.ts+++ b/studio/frontend/src/features/settings/stores/appearance-custom-store.ts@@ -39,7 +39,6 @@ const guardedLocalStorage: StateStorage = {export type ReduceMotionSetting = "system" | "on" | "off";export type ChatWidthSetting = "standard" | "wide" | "full";-export type ComposerAttachmentsSetting = "cards" | "compact";export type SentAttachmentsSetting = "auto" | "list" | "chips";export type CustomModeColors = {@@ -238,7 +237,6 @@ export type AppearanceCustomization = {headingFont: string | null;chatFont: string | null;chatWidth: ChatWidthSetting;- composerAttachments: ComposerAttachmentsSetting;sentAttachments: SentAttachmentsSetting;codeFont: string | null;importedFonts: ImportedFont[];@@ -273,7 +271,6 @@ export const DEFAULT_CUSTOMIZATION: AppearanceCustomization = {headingFont: null,chatFont: null,chatWidth: "standard",- composerAttachments: "cards",sentAttachments: "auto",codeFont: null,importedFonts: [],@@ -489,8 +486,6 @@ export function sanitizeCustomization(value: unknown): AppearanceCustomization {source.chatWidth === "wide" || source.chatWidth === "full"? source.chatWidth: "standard",- composerAttachments:- source.composerAttachments === "compact" ? "compact" : "cards",sentAttachments:source.sentAttachments === "list" || source.sentAttachments === "chips"? source.sentAttachmentsdiff --git a/studio/frontend/src/features/settings/tabs/appearance-tab.tsx b/studio/frontend/src/features/settings/tabs/appearance-tab.tsxindex 4877b55e421..b45bc3171de 100644--- a/studio/frontend/src/features/settings/tabs/appearance-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/appearance-tab.tsx@@ -9,7 +9,6 @@ import {ActiveColorControl,ChatFontRow,ChatWidthSelect,- ComposerAttachmentsSelect,SentAttachmentsSelect,CodeFontRow,CodeFontSizeRow,@@ -133,14 +132,6 @@ export function AppearanceTab() {><ChatWidthSelect /></SettingsRow>- <SettingsRow- label={t("settings.appearance.custom.composerAttachments.label")}- description={t(- "settings.appearance.custom.composerAttachments.description",- )}- >- <ComposerAttachmentsSelect />- </SettingsRow><SettingsRowlabel={t("settings.appearance.custom.sentAttachments.label")}description={t(diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.tsindex 15b4e2735ab..71a8cf36d97 100644--- a/studio/frontend/src/i18n/locales/ar.ts+++ b/studio/frontend/src/i18n/locales/ar.ts@@ -1335,20 +1335,13 @@ export const ar = {wide: "واسع",full: "العرض الكامل",},- composerAttachments: {- label: "المرفقات في حقل الكتابة",- description:- "بطاقات كبيرة تُوسّع حقل الكتابة، أو صف مضغوط من المربعات الصغيرة.",- cards: "بطاقات كبيرة",- compact: "مربعات مضغوطة",- },sentAttachments: {label: "المرفقات في الرسائل المرسلة",description:- "قائمة تعرض نوع كل ملف، أو شارات صغيرة. يتحوّل الوضع التلقائي إلى الشارات عند تجاوز ستة ملفات.",+ "يعرض الوضع القياسي نوع كل ملف، ويعرض الوضع المضغوط ملفات أكثر في كل سطر. يتحوّل الوضع التلقائي إلى المضغوط عند تجاوز ستة ملفات.",auto: "تلقائي",- list: "قائمة",- chips: "شارات",+ list: "قياسي",+ chips: "مضغوط",},reset: "إعادة تعيين",resetAll: "إعادة تعيين التخصيص",diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.tsindex 2d5fdd81a66..2006d85fa49 100644--- a/studio/frontend/src/i18n/locales/de.ts+++ b/studio/frontend/src/i18n/locales/de.ts@@ -1361,20 +1361,13 @@ export const de = {wide: "Breit",full: "Volle Breite",},- composerAttachments: {- label: "Anhänge im Eingabefeld",- description:- "Große Karten, die das Eingabefeld vergrößern, oder eine kompakte Reihe von Kacheln.",- cards: "Große Karten",- compact: "Kompakte Kacheln",- },sentAttachments: {label: "Anhänge in gesendeten Nachrichten",description:- "Eine Liste mit dem Typ jeder Datei oder kleine Chips. „Automatisch“ wechselt ab sieben Dateien zu Chips.",+ "Standard zeigt jede Datei mit ihrem Typ, Kompakt passt mehr in eine Zeile. „Automatisch“ wechselt ab sieben Dateien zu Kompakt.",auto: "Automatisch",- list: "Liste",- chips: "Chips",+ list: "Standard",+ chips: "Kompakt",},reset: "Zurücksetzen",resetAll: "Anpassungen zurücksetzen",diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.tsindex 647df715b4c..786b5086220 100644--- a/studio/frontend/src/i18n/locales/en.ts+++ b/studio/frontend/src/i18n/locales/en.ts@@ -1336,20 +1336,13 @@ export const en = {wide: "Wide",full: "Full width",},- composerAttachments: {- label: "Attachments in the composer",- description:- "Large cards that grow the message box, or a compact row of tiles.",- cards: "Large cards",- compact: "Compact tiles",- },sentAttachments: {label: "Attachments in sent messages",description:- "A list with each file's type, or small chips. Auto switches to chips past six files.",+ "Standard shows each file with its type, compact fits more on each line. Auto switches to compact past six files.",auto: "Auto",- list: "List",- chips: "Chips",+ list: "Standard",+ chips: "Compact",},reset: "Reset",resetAll: "Reset customization",diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.tsindex 200f50eb8a4..69e5749089e 100644--- a/studio/frontend/src/i18n/locales/es.ts+++ b/studio/frontend/src/i18n/locales/es.ts@@ -1356,20 +1356,13 @@ export const es = {wide: "Amplio",full: "Ancho completo",},- composerAttachments: {- label: "Adjuntos en el cuadro de texto",- description:- "Tarjetas grandes que agrandan el cuadro de texto o una fila compacta de miniaturas.",- cards: "Tarjetas grandes",- compact: "Miniaturas compactas",- },sentAttachments: {label: "Adjuntos en los mensajes enviados",description:- "Una lista con el tipo de cada archivo o pequeñas etiquetas. Automático cambia a etiquetas con más de seis archivos.",+ "Estándar muestra cada archivo con su tipo y Compacto cabe más en cada línea. Automático cambia a compacto con más de seis archivos.",auto: "Automático",- list: "Lista",- chips: "Etiquetas",+ list: "Estándar",+ chips: "Compacto",},reset: "Restablecer",resetAll: "Restablecer la personalización",diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.tsindex 3f87a74b170..f101922a36b 100644--- a/studio/frontend/src/i18n/locales/fr.ts+++ b/studio/frontend/src/i18n/locales/fr.ts@@ -1360,20 +1360,13 @@ export const fr = {wide: "Large",full: "Pleine largeur",},- composerAttachments: {- label: "Pièces jointes dans la zone de saisie",- description:- "De grandes cartes qui agrandissent la zone de saisie, ou une rangée compacte de vignettes.",- cards: "Grandes cartes",- compact: "Vignettes compactes",- },sentAttachments: {label: "Pièces jointes dans les messages envoyés",description:- "Une liste indiquant le type de chaque fichier, ou de petites étiquettes. Le mode automatique passe aux étiquettes au-delà de six fichiers.",+ "Standard affiche chaque fichier avec son type, Compact en place davantage sur chaque ligne. Le mode automatique passe en compact au-delà de six fichiers.",auto: "Automatique",- list: "Liste",- chips: "Étiquettes",+ list: "Standard",+ chips: "Compact",},reset: "Réinitialiser",resetAll: "Réinitialiser la personnalisation",diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.tsindex c650b55e7ce..1f8d87a620a 100644--- a/studio/frontend/src/i18n/locales/hi.ts+++ b/studio/frontend/src/i18n/locales/hi.ts@@ -1338,20 +1338,13 @@ export const hi = {wide: "चौड़ा",full: "पूरी चौड़ाई",},- composerAttachments: {- label: "इनपुट बॉक्स में अटैचमेंट",- description:- "बड़े कार्ड जो इनपुट बॉक्स को बड़ा करते हैं, या टाइलों की एक कॉम्पैक्ट पंक्ति।",- cards: "बड़े कार्ड",- compact: "कॉम्पैक्ट टाइलें",- },sentAttachments: {label: "भेजे गए संदेशों में अटैचमेंट",description:- "हर फ़ाइल के प्रकार के साथ एक सूची, या छोटे चिप्स। छह से ज़्यादा फ़ाइलें होने पर ऑटो चिप्स पर स्विच हो जाता है।",+ "मानक हर फ़ाइल को उसके प्रकार के साथ दिखाता है, कॉम्पैक्ट हर पंक्ति में ज़्यादा फ़ाइलें दिखाता है। छह से ज़्यादा फ़ाइलें होने पर ऑटो कॉम्पैक्ट पर स्विच हो जाता है।",auto: "ऑटो",- list: "सूची",- chips: "चिप्स",+ list: "मानक",+ chips: "कॉम्पैक्ट",},reset: "रीसेट करें",resetAll: "कस्टमाइज़ेशन रीसेट करें",diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.tsindex 39432265682..e339fe3e19e 100644--- a/studio/frontend/src/i18n/locales/it.ts+++ b/studio/frontend/src/i18n/locales/it.ts@@ -1320,20 +1320,13 @@ export const it = {wide: "Ampia",full: "Larghezza piena",},- composerAttachments: {- label: "Allegati nel campo di testo",- description:- "Schede grandi che ingrandiscono il campo di testo, oppure una riga compatta di riquadri.",- cards: "Schede grandi",- compact: "Riquadri compatti",- },sentAttachments: {label: "Allegati nei messaggi inviati",description:- "Un elenco con il tipo di ogni file, oppure piccole etichette. Automatico passa alle etichette oltre i sei file.",+ "Standard mostra ogni file con il suo tipo, Compatto ne mette di più su ogni riga. Automatico passa a compatto oltre i sei file.",auto: "Automatico",- list: "Elenco",- chips: "Etichette",+ list: "Standard",+ chips: "Compatto",},reset: "Ripristina",resetAll: "Ripristina la personalizzazione",diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.tsindex cd84e49baac..0d9a8155e90 100644--- a/studio/frontend/src/i18n/locales/ja.ts+++ b/studio/frontend/src/i18n/locales/ja.ts@@ -1317,20 +1317,13 @@ export const ja = {wide: "広い",full: "全幅",},- composerAttachments: {- label: "入力欄の添付ファイル",- description:- "入力欄を広げる大きなカード、またはコンパクトなタイルの列で表示します。",- cards: "大きなカード",- compact: "コンパクトなタイル",- },sentAttachments: {label: "送信済みメッセージの添付ファイル",description:- "各ファイルの種類を示すリスト、または小さなチップで表示します。自動では 7 件以上でチップに切り替わります。",+ "標準では各ファイルを種類付きで表示し、コンパクトでは 1 行により多く表示します。自動では 7 件以上でコンパクトに切り替わります。",auto: "自動",- list: "リスト",- chips: "チップ",+ list: "標準",+ chips: "コンパクト",},reset: "リセット",resetAll: "カスタマイズをリセット",diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.tsindex 5f4168d4ce2..068a60875dd 100644--- a/studio/frontend/src/i18n/locales/ko.ts+++ b/studio/frontend/src/i18n/locales/ko.ts@@ -1331,20 +1331,13 @@ export const ko = {wide: "넓게",full: "전체 너비",},- composerAttachments: {- label: "입력창의 첨부 파일",- description:- "입력창을 키우는 큰 카드 또는 작은 타일 한 줄로 표시합니다.",- cards: "큰 카드",- compact: "작은 타일",- },sentAttachments: {label: "보낸 메시지의 첨부 파일",description:- "각 파일의 형식을 보여 주는 목록 또는 작은 칩으로 표시합니다. 자동은 파일이 6개를 넘으면 칩으로 바뀝니다.",+ "표준은 각 파일을 형식과 함께 표시하고, 컴팩트는 한 줄에 더 많이 표시합니다. 자동은 파일이 6개를 넘으면 컴팩트로 바뀝니다.",auto: "자동",- list: "목록",- chips: "칩",+ list: "표준",+ chips: "컴팩트",},reset: "초기화",resetAll: "사용자 지정 초기화",diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.tsindex 2dd232613e7..891142c9abe 100644--- a/studio/frontend/src/i18n/locales/pt-br.ts+++ b/studio/frontend/src/i18n/locales/pt-br.ts@@ -1348,20 +1348,13 @@ export const ptBR = {wide: "Ampla",full: "Largura total",},- composerAttachments: {- label: "Anexos no campo de texto",- description:- "Cartões grandes que aumentam o campo de texto ou uma fileira compacta de miniaturas.",- cards: "Cartões grandes",- compact: "Miniaturas compactas",- },sentAttachments: {label: "Anexos nas mensagens enviadas",description:- "Uma lista com o tipo de cada arquivo ou pequenas etiquetas. O modo automático muda para etiquetas com mais de seis arquivos.",+ "Padrão mostra cada arquivo com seu tipo e Compacto cabe mais em cada linha. O modo automático muda para compacto com mais de seis arquivos.",auto: "Automático",- list: "Lista",- chips: "Etiquetas",+ list: "Padrão",+ chips: "Compacto",},reset: "Redefinir",resetAll: "Redefinir personalização",diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.tsindex 0920e855384..d0c67d15d2a 100644--- a/studio/frontend/src/i18n/locales/ru.ts+++ b/studio/frontend/src/i18n/locales/ru.ts@@ -1340,20 +1340,13 @@ export const ru = {wide: "Широкая",full: "Полная ширина",},- composerAttachments: {- label: "Вложения в поле ввода",- description:- "Крупные карточки, увеличивающие поле ввода, или компактный ряд плиток.",- cards: "Крупные карточки",- compact: "Компактные плитки",- },sentAttachments: {label: "Вложения в отправленных сообщениях",description:- "Список с типом каждого файла или небольшие метки. В автоматическом режиме при более чем шести файлах используются метки.",+ "Стандартный вид показывает тип каждого файла, компактный помещает больше файлов в строку. В автоматическом режиме при более чем шести файлах используется компактный вид.",auto: "Авто",- list: "Список",- chips: "Метки",+ list: "Стандартный",+ chips: "Компактный",},reset: "Сбросить",resetAll: "Сбросить настройки оформления",diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.tsindex 2d22d2d55d6..7a9dce609b3 100644--- a/studio/frontend/src/i18n/locales/zh-CN.ts+++ b/studio/frontend/src/i18n/locales/zh-CN.ts@@ -1318,20 +1318,13 @@ export const zhCN = {wide: "宽",full: "全宽",},- composerAttachments: {- label: "输入框中的附件",- description:- "使用会撑大输入框的大卡片,或紧凑的一行小图块。",- cards: "大卡片",- compact: "紧凑图块",- },sentAttachments: {label: "已发送消息中的附件",description:- "显示各文件类型的列表,或小标签。超过六个文件时,“自动”会切换为小标签。",+ "标准会显示每个文件及其类型,紧凑会在每行显示更多文件。超过六个文件时,“自动”会切换为紧凑。",auto: "自动",- list: "列表",- chips: "小标签",+ list: "标准",+ chips: "紧凑",},reset: "重置",resetAll: "重置自定义",diff --git a/studio/frontend/tests/attachment-source-cost.test.ts b/studio/frontend/tests/attachment-source-cost.test.tsindex 49719ee3d47..cbf98975775 100644--- a/studio/frontend/tests/attachment-source-cost.test.ts+++ b/studio/frontend/tests/attachment-source-cost.test.ts@@ -5,7 +5,7 @@// store notification and on every render, and useShallow gates the re-render,// not the selector. Building a "data:audio/wav;base64,..." string in there// therefore copies the whole clip per token of a streamed reply, twice over:-// AttachmentThumb and AttachmentPreviewDialog each mount the hook.+// the composer card and AttachmentPreviewDialog each mount the hook.import assert from "node:assert/strict";import test from "node:test";@@ -157,14 +157,14 @@ test("the attachment selector still resolves text and image attachments", () =>});// ComposerPrimitive.Attachments keys its providers by list index. Removing the-// first attachment therefore reuses AttachmentUI for the next attachment, so+// first attachment therefore reuses ComposerAttachmentCard for the next attachment, so// every stateful preview/source branch needs the attachment identity as its own// reset boundary.test("attachment previews reset when an index is reused for another attachment", () => {const attachment = readSrc("components/assistant-ui/attachment.tsx");const ui = attachment.slice(- attachment.indexOf("const AttachmentUI"),- attachment.indexOf("const AttachmentRemove"),+ attachment.indexOf("const ComposerAttachmentCard: FC"),+ attachment.indexOf("const SentAttachmentLayoutContext"),);assert.match(ui, ATTACHMENT_ID_SELECTOR_RE);diff --git a/studio/frontend/tests/chat-attachment-display.test.ts b/studio/frontend/tests/chat-attachment-display.test.tsindex 721c234fc80..8bd5656508c 100644--- a/studio/frontend/tests/chat-attachment-display.test.ts+++ b/studio/frontend/tests/chat-attachment-display.test.ts@@ -27,6 +27,7 @@ import {DEFAULT_CUSTOMIZATION,sanitizeCustomization,} from "../src/features/settings/stores/appearance-custom-store.ts";+import { en } from "../src/i18n/locales/en.ts";import { readSrcAsync } from "./helpers/kit.ts";const ATTACHMENT = await readSrcAsync("components/assistant-ui/attachment.tsx");@@ -116,8 +117,8 @@ test("cards keep their hairline edge in dark mode", () => {test("the strip is laid out through the DOM, never through React state", () => {const strip = ATTACHMENT.slice(- ATTACHMENT.indexOf("const ComposerAttachmentCards: FC"),ATTACHMENT.indexOf("export const ComposerAttachments: FC"),+ ATTACHMENT.indexOf("export const ComposerAddAttachment: FC"),);assert.match(strip, /el\.dataset\.layout = next/);assert.doesNotMatch(strip, /useState/);@@ -138,21 +139,29 @@ test("sent attachments split images from files by type, with stable component maassert.match(sent, /<AttachmentPreviewDialog redactFromReload=\{false\}>/);});-test("both attachment settings default to the new look and reject anything else", () => {- assert.equal(DEFAULT_CUSTOMIZATION.composerAttachments, "cards");+test("the sent attachments setting defaults to auto and rejects anything else", () => {assert.equal(DEFAULT_CUSTOMIZATION.sentAttachments, "auto");- const saved = sanitizeCustomization({- composerAttachments: "compact",- sentAttachments: "chips",- });- assert.equal(saved.composerAttachments, "compact");- assert.equal(saved.sentAttachments, "chips");- const junk = sanitizeCustomization({- composerAttachments: "huge",- sentAttachments: 7,- });- assert.equal(junk.composerAttachments, "cards");- assert.equal(junk.sentAttachments, "auto");+ assert.equal(sanitizeCustomization({ sentAttachments: "chips" }).sentAttachments, "chips");+ assert.equal(sanitizeCustomization({ sentAttachments: 7 }).sentAttachments, "auto");+});++test("the sent attachments options read as Standard and Compact", () => {+ const options = en.settings.appearance.custom.sentAttachments;+ assert.equal(options.list, "Standard");+ assert.equal(options.chips, "Compact");+ assert.doesNotMatch(options.description, /\b(list|chips?)\b/i);+});++test("the composer always shows attachments as cards", () => {+ // A record saved while compact tiles were an option is dropped on load.+ const saved = sanitizeCustomization({ composerAttachments: "compact" });+ assert.equal("composerAttachments" in saved, false);+ assert.match(+ ATTACHMENT,+ /<ComposerPrimitive\.Attachments components=\{CARD_COMPONENTS\} \/>/,+ );+ assert.doesNotMatch(ATTACHMENT, /COMPACT_COMPONENTS|const AttachmentUI\b|aui-pasted-text-chip/);+ assert.doesNotMatch(ATTACHMENT, /customization\.composerAttachments/);});test("audio or video attached before a model loaded is checked when sent", () => {@@ -295,8 +304,9 @@ test("a sent text file downloads whole, not the capped preview", async () => {});test("a composer clip reads as a video, not by its .mp4 name as audio", () => {- assert.match(ATTACHMENT, /if \(isVideoAttachment\(attachment\)\) return "Video";\n\s*return isAudioAttachment\(/);- assert.match(ATTACHMENT, /isVideo\n\s*\? FlimSlateIcon\n\s*: isAudioAttachment\(name, contentType\)/);+ assert.equal(attachmentFileKind("clip.mp4", "video/mp4"), "video");+ assert.equal(attachmentFileKind("clip.webm", "video/webm"), "video");+ assert.equal(attachmentFileKind("song.mp3", "audio/mpeg"), "audio");});test("a sent document shown from its stored text downloads and chats as a .txt", async () => {diff --git a/studio/frontend/tests/edit-composer-attachments.test.ts b/studio/frontend/tests/edit-composer-attachments.test.tsindex ff674c755e6..dc8a756deb6 100644--- a/studio/frontend/tests/edit-composer-attachments.test.ts+++ b/studio/frontend/tests/edit-composer-attachments.test.ts@@ -44,5 +44,5 @@ test("a pasted-text chip without its File previews instead of inlining", () => {chip,/\{canInline \? \(\s*chip\s*\) : \(\s*<PastedTextPreviewDialog/,);- assert.match(chip, /\{isComposer &&\s*\(variant === "card" \? <AttachmentCardRemove \/> : <AttachmentRemove \/>\)\}/);+ assert.match(chip, /\{isComposer && <AttachmentCardRemove \/>\}/);});diff --git a/studio/frontend/tests/personalization-locale-hydration.test.ts b/studio/frontend/tests/personalization-locale-hydration.test.tsindex dcb4a3df586..9d651b85bf7 100644--- a/studio/frontend/tests/personalization-locale-hydration.test.ts+++ b/studio/frontend/tests/personalization-locale-hydration.test.ts@@ -189,7 +189,6 @@ function setup(localCustomization?: Record<string, unknown>;remote?: ReturnType<typeof remotePersonalization> & {chatWidthSaved?: boolean;- composerAttachmentsSaved?: boolean;sentAttachmentsSaved?: boolean;};} = {},@@ -440,7 +439,6 @@ function attachmentsRemote(saved: boolean | undefined, customization: Record<str...remote,version: 5,chatWidthSaved: true,- composerAttachmentsSaved: saved,sentAttachmentsSaved: saved,appearance: {...remote.appearance,@@ -451,33 +449,30 @@ function attachmentsRemote(saved: boolean | undefined, customization: Record<strtest("legacy attachment display preserves and uploads the local choice", async () => {const app = setup("stalled", {- localCustomization: { composerAttachments: "compact", sentAttachments: "chips" },- remote: attachmentsRemote(false, { composerAttachments: "cards", sentAttachments: "auto" }),+ localCustomization: { sentAttachments: "chips" },+ remote: attachmentsRemote(false, { sentAttachments: "auto" }),});app.render();await settle();app.render();- assert.equal(app.customization().composerAttachments, "compact");assert.equal(app.customization().sentAttachments, "chips");assert.equal(app.customization().uiFont, "Georgia");app.runTimers();await settle();assert.equal(app.saves.length, 1);- assert.equal(app.saves[0]?.appearance.customization.composerAttachments, "compact");assert.equal(app.saves[0]?.appearance.customization.sentAttachments, "chips");app.host.unmount();});test("saved attachment display overrides local without another save", async () => {const app = setup("stalled", {- localCustomization: { composerAttachments: "compact", sentAttachments: "chips" },- remote: attachmentsRemote(true, { composerAttachments: "cards", sentAttachments: "list" }),+ localCustomization: { sentAttachments: "chips" },+ remote: attachmentsRemote(true, { sentAttachments: "list" }),});app.render();await settle();app.render();- assert.equal(app.customization().composerAttachments, "cards");assert.equal(app.customization().sentAttachments, "list");app.runTimers();await settle();@@ -487,13 +482,12 @@ test("saved attachment display overrides local without another save", async () =test("an older server without attachment display keys preserves the local choice", async () => {const app = setup("stalled", {- localCustomization: { composerAttachments: "compact", sentAttachments: "list" },+ localCustomization: { sentAttachments: "list" },remote: attachmentsRemote(undefined, {}),});app.render();await settle();app.render();- assert.equal(app.customization().composerAttachments, "compact");assert.equal(app.customization().sentAttachments, "list");app.host.unmount();});