diff --git a/apps/mobile/src/features/threads/SubagentRow.tsx b/apps/mobile/src/features/threads/SubagentRow.tsx index 536b2380291df..4899ab3b31818 100644 --- a/apps/mobile/src/features/threads/SubagentRow.tsx +++ b/apps/mobile/src/features/threads/SubagentRow.tsx @@ -8,11 +8,12 @@ import { resolveSubagentMetadata, subagentCardDetail, } from "@t3tools/client-runtime/state/subagent-display"; -import { formatSubagentEffort } from "@t3tools/client-runtime/state/thread-execution"; import type { EnvironmentId, OrchestrationV2Subagent } from "@t3tools/contracts"; import { msg, T, useMessages, Var } from "gt-react-native"; import type { ReactNode } from "react"; import { View } from "react-native"; +import Svg, { Path } from "react-native-svg"; +import { withUniwind } from "uniwind"; import { AppText as Text } from "../../components/ui/AppText"; import { SymbolView } from "../../components/ui/AppSymbol"; @@ -20,7 +21,14 @@ import { ProviderIcon, ProviderInstanceIcon } from "../../components/ProviderIco import { cn } from "../../lib/cn"; import { useEnvironmentServerConfig, useProject, useThreadShell } from "../../state/entities"; import { SUBAGENT_TONE_TEXT_CLASS, SubagentStatusDot } from "./SubagentStatusDot"; -import { resolveSubagentRowPresentation } from "./threadAgentsPresentation"; +import { + resolveSubagentRowPresentation, + resolveSubagentTraits, + subagentModelSelection, + type SubagentTraits, +} from "./threadAgentsPresentation"; + +const ThemedPath = withUniwind(Path); type SubagentRowSubagent = Pick< OrchestrationV2Subagent, @@ -28,6 +36,7 @@ type SubagentRowSubagent = Pick< | "childThreadId" | "model" | "modelSelection" + | "origin" | "driver" | "providerInstanceId" | "title" @@ -148,7 +157,7 @@ function SubagentMetadata(props: { parent ? scopeProjectRef(environmentId, parent.projectId) : null, ); const childProject = useProject(child ? scopeProjectRef(environmentId, child.projectId) : null); - const selection = subagent.modelSelection; + const selection = subagentModelSelection(subagent, child); const { modelLabel, modelSlug, workspace } = resolveSubagentMetadata( { model: subagent.model, @@ -162,7 +171,12 @@ function SubagentMetadata(props: { messages, ); const branchLabel = messages(msg("Branch", { $context: "field label" })); - const effort = formatSubagentEffort({ modelSlug, modelSelection: selection, provider }); + const traits = resolveSubagentTraits({ + modelSlug, + selection, + providerInstanceId: subagent.providerInstanceId, + provider, + }); return ( {showBadge ? ( @@ -182,8 +196,8 @@ function SubagentMetadata(props: { {provider ? `${resolveProviderInstanceDisplayName(provider)} · ` : ""} {modelLabel} - {effort ? ` · ${effort}` : ""} + {workspace.map(({ label, value }) => ( // Preserve the label against flattening without making it a separate accessibility stop. ); } + +function SubagentTraitsLabel(props: { readonly traits: SubagentTraits }) { + const messages = useMessages(); + const { effort, speedIcon } = props.traits; + if (!effort && !speedIcon) return null; + const speedLabel = + speedIcon === "ultrafast" + ? messages(msg("Ultrafast mode on")) + : speedIcon + ? messages(msg("Fast mode on")) + : null; + return ( + + + · + + {speedIcon ? : null} + {effort ? ( + + {effort} + + ) : null} + + ); +} + +// Same glyphs as the web composer's speed icons. +function SpeedIcon(props: { readonly speedIcon: "fast" | "ultrafast" }) { + return ( + + {props.speedIcon === "ultrafast" ? ( + <> + + + + ) : ( + + )} + + ); +} diff --git a/apps/mobile/src/features/threads/thread-workflow-opening.tsx b/apps/mobile/src/features/threads/thread-workflow-opening.tsx index 34461cc4aa0c7..0ac57c943066b 100644 --- a/apps/mobile/src/features/threads/thread-workflow-opening.tsx +++ b/apps/mobile/src/features/threads/thread-workflow-opening.tsx @@ -70,6 +70,7 @@ function memberRowSubagent( childThreadId: member.childThreadId as ThreadId | null, model: member.model, modelSelection: workflowMemberModelSelection(member, opening.providerInstanceId!), + origin: "provider_native" as const, driver: opening.driver!, providerInstanceId: opening.providerInstanceId!, title: member.title, diff --git a/apps/mobile/src/features/threads/threadAgentsPresentation.test.ts b/apps/mobile/src/features/threads/threadAgentsPresentation.test.ts index 171d73a148597..1560601965cff 100644 --- a/apps/mobile/src/features/threads/threadAgentsPresentation.test.ts +++ b/apps/mobile/src/features/threads/threadAgentsPresentation.test.ts @@ -6,8 +6,10 @@ import { import { NodeId, ProviderDriverKind, + ProviderInstanceId, RunId, ThreadId, + type ModelSelection, type OrchestrationV2SubagentWorkflow, } from "@t3tools/contracts"; import * as DateTime from "effect/DateTime"; @@ -16,6 +18,8 @@ import { nextWorkflowSelection, resolveSubagentRowPresentation, resolveSubagentStopTarget, + resolveSubagentTraits, + subagentModelSelection, workflowMemberDetail, workflowMemberMetadata, workflowRail, @@ -141,6 +145,82 @@ const agent = ( ...overrides, }); +describe("resolveSubagentTraits", () => { + const instance = ProviderInstanceId.make("codex"); + const provider = { + driver: ProviderDriverKind.make("codex"), + models: [ + { + slug: "gpt-test", + name: "GPT Test", + isCustom: false, + capabilities: { + optionDescriptors: [ + { + id: "reasoningEffort", + label: "Effort", + type: "select" as const, + options: [{ id: "high", label: "High" }], + }, + { + id: "serviceTier", + label: "Speed", + type: "select" as const, + options: [ + { id: "default", label: "Normal" }, + { id: "priority", label: "Fast" }, + { id: "ultra", label: "Ultrafast" }, + ], + }, + ], + }, + }, + ], + }; + const selection = (tier: string, overrides: Partial = {}): ModelSelection => ({ + instanceId: instance, + model: "gpt-test", + options: [ + { id: "reasoningEffort", value: "high" }, + { id: "serviceTier", value: tier }, + ], + ...overrides, + }); + const traits = (value: ModelSelection | undefined) => + resolveSubagentTraits({ + modelSlug: "gpt-test", + selection: value, + providerInstanceId: instance, + provider, + }); + + it.each([ + ["priority", "fast"], + ["ultra", "ultrafast"], + ["default", null], + ] as const)("labels effort and service tier %s", (tier, speedIcon) => { + expect(traits(selection(tier))).toEqual({ effort: "High", speedIcon }); + }); + + it("labels nothing for another instance's or model's selection", () => { + const empty = { effort: null, speedIcon: null }; + expect(traits(selection("priority", { instanceId: ProviderInstanceId.make("other") }))).toEqual( + empty, + ); + expect(traits(selection("priority", { model: "other-model" }))).toEqual(empty); + }); + + it("falls back to the child thread's selection only for app-owned agents", () => { + const childThread = { modelSelection: selection("ultra") }; + expect( + subagentModelSelection({ origin: "app_owned", modelSelection: undefined }, childThread), + ).toBe(childThread.modelSelection); + expect( + subagentModelSelection({ origin: "provider_native", modelSelection: undefined }, childThread), + ).toBeUndefined(); + }); +}); + describe("workflowRail", () => { it("keeps declared phases without agents and gives unphased agents a stop", () => { const rail = workflowRailOf([ diff --git a/apps/mobile/src/features/threads/threadAgentsPresentation.ts b/apps/mobile/src/features/threads/threadAgentsPresentation.ts index ae1fe531eefb2..def8cc4c6bab2 100644 --- a/apps/mobile/src/features/threads/threadAgentsPresentation.ts +++ b/apps/mobile/src/features/threads/threadAgentsPresentation.ts @@ -10,10 +10,16 @@ import { type RuntimeSubagent, type SubagentWorkflowGroup, } from "@t3tools/client-runtime/state/subagentRuntime"; -import { REASONING_EFFORT_OPTION_IDS } from "@t3tools/client-runtime/state/thread-execution"; +import { getSelectionSpeedIcon } from "@t3tools/client-runtime/model-traits"; +import { + formatSubagentEffort, + REASONING_EFFORT_OPTION_IDS, +} from "@t3tools/client-runtime/state/thread-execution"; import type { EnvironmentId, + ModelSelection, OrchestrationV2Subagent, + OrchestrationV2ThreadShell, ServerProvider, ThreadId, } from "@t3tools/contracts"; @@ -138,6 +144,49 @@ export function resolveSubagentRowPresentation( }; } +/** The selection an agent ran with; an app-owned agent that saved none ran with its thread's. */ +export function subagentModelSelection( + subagent: Pick, + childThread: Pick | undefined, +): ModelSelection | undefined { + return ( + subagent.modelSelection ?? + (subagent.origin === "app_owned" ? childThread?.modelSelection : undefined) + ); +} + +export interface SubagentTraits { + readonly effort: string | null; + readonly speedIcon: "fast" | "ultrafast" | null; +} + +/** Labels a selection only when it is for the agent's own model and provider instance. */ +export function resolveSubagentTraits(input: { + readonly modelSlug: string | null; + readonly selection: ModelSelection | undefined; + readonly providerInstanceId: OrchestrationV2Subagent["providerInstanceId"]; + readonly provider: Pick | undefined; +}): SubagentTraits { + const { modelSlug, selection, provider } = input; + if ( + !provider || + !selection || + !modelSlug || + selection.instanceId !== input.providerInstanceId || + (resolveSelectableModel(provider.driver, selection.model, provider.models) ?? + selection.model.trim()) !== modelSlug + ) { + return { effort: null, speedIcon: null }; + } + const descriptors = + provider.models.find((model) => model.slug === modelSlug)?.capabilities?.optionDescriptors ?? + []; + return { + effort: formatSubagentEffort({ modelSlug, modelSelection: selection, provider }), + speedIcon: getSelectionSpeedIcon(descriptors, selection), + }; +} + export type WorkflowRailTone = SubagentRowTone | "queued"; export interface WorkflowRailItem { diff --git a/apps/mobile/src/i18n/translations/de.json b/apps/mobile/src/i18n/translations/de.json index 8905e6a7dfa57..18c610ccf3515 100644 --- a/apps/mobile/src/i18n/translations/de.json +++ b/apps/mobile/src/i18n/translations/de.json @@ -4384,6 +4384,8 @@ "9605dc349bd2c872": "Referenz für {label} in {source}", "51e507aa054ee63b": "Sicher speichern", "4ba3eff83827c2d4": "Ablehnen", + "ee71ac7e8e9b000c": "Ultrafast-Modus an", + "e649c08fbd9a1a30": "Fast-Modus an", "1c4391ec5c411ba7": "Workflow konnte nicht gestoppt werden", "fece74611dcf4173": "Agent konnte nicht gestoppt werden", "9ce30f31a483c017": "Workflow {label} wird gestoppt", diff --git a/apps/mobile/src/i18n/translations/en.json b/apps/mobile/src/i18n/translations/en.json index 326854441f2cf..8c09b0c412560 100644 --- a/apps/mobile/src/i18n/translations/en.json +++ b/apps/mobile/src/i18n/translations/en.json @@ -4385,6 +4385,8 @@ "9605dc349bd2c872": "{label} reference in {source}", "51e507aa054ee63b": "Save securely", "4ba3eff83827c2d4": "Decline", + "ee71ac7e8e9b000c": "Ultrafast mode on", + "e649c08fbd9a1a30": "Fast mode on", "1c4391ec5c411ba7": "Could not stop workflow", "fece74611dcf4173": "Could not stop agent", "9ce30f31a483c017": "Stopping workflow {label}", diff --git a/apps/mobile/src/i18n/translations/es.json b/apps/mobile/src/i18n/translations/es.json index b06c7cde064e3..316dd2b1adbd2 100644 --- a/apps/mobile/src/i18n/translations/es.json +++ b/apps/mobile/src/i18n/translations/es.json @@ -4377,6 +4377,8 @@ "9605dc349bd2c872": "Referencia de {label} en {source}", "51e507aa054ee63b": "Guardar de forma segura", "4ba3eff83827c2d4": "Rechazar", + "ee71ac7e8e9b000c": "Modo Ultrafast activado", + "e649c08fbd9a1a30": "Modo rápido activado", "1c4391ec5c411ba7": "No se pudo detener el flujo de trabajo", "fece74611dcf4173": "No se pudo detener el agente", "9ce30f31a483c017": "Deteniendo el flujo de trabajo {label}", diff --git a/apps/mobile/src/i18n/translations/fr.json b/apps/mobile/src/i18n/translations/fr.json index a55be9448f37a..52e305697cc98 100644 --- a/apps/mobile/src/i18n/translations/fr.json +++ b/apps/mobile/src/i18n/translations/fr.json @@ -4378,6 +4378,8 @@ "9605dc349bd2c872": "Référence de {label} dans {source}", "51e507aa054ee63b": "Enregistrer de façon sécurisée", "4ba3eff83827c2d4": "Refuser", + "ee71ac7e8e9b000c": "Mode Ultrafast activé", + "e649c08fbd9a1a30": "Mode Fast activé", "1c4391ec5c411ba7": "Impossible d’arrêter le workflow", "fece74611dcf4173": "Impossible d’arrêter l’agent", "9ce30f31a483c017": "Arrêt du workflow {label}", diff --git a/apps/mobile/src/i18n/translations/ja.json b/apps/mobile/src/i18n/translations/ja.json index a2baf76668ee6..654a4c828d188 100644 --- a/apps/mobile/src/i18n/translations/ja.json +++ b/apps/mobile/src/i18n/translations/ja.json @@ -4359,6 +4359,8 @@ "9605dc349bd2c872": "{source} 内の {label} の参照", "51e507aa054ee63b": "安全に保存", "4ba3eff83827c2d4": "拒否", + "ee71ac7e8e9b000c": "超高速モード オン", + "e649c08fbd9a1a30": "高速モード オン", "1c4391ec5c411ba7": "ワークフローを停止できませんでした", "fece74611dcf4173": "エージェントを停止できませんでした", "9ce30f31a483c017": "ワークフロー {label} を停止しています", diff --git a/apps/mobile/src/i18n/translations/ko.json b/apps/mobile/src/i18n/translations/ko.json index 73b5fba192e03..ada00b4fee5f4 100644 --- a/apps/mobile/src/i18n/translations/ko.json +++ b/apps/mobile/src/i18n/translations/ko.json @@ -4364,6 +4364,8 @@ "9605dc349bd2c872": "{source}의 {label} 참조", "51e507aa054ee63b": "안전하게 저장", "4ba3eff83827c2d4": "거절", + "ee71ac7e8e9b000c": "초고속 모드 켜짐", + "e649c08fbd9a1a30": "고속 모드 켜짐", "1c4391ec5c411ba7": "워크플로를 중지할 수 없습니다", "fece74611dcf4173": "에이전트를 중지할 수 없습니다", "9ce30f31a483c017": "워크플로 {label} 중지 중", diff --git a/apps/mobile/src/i18n/translations/pt-BR.json b/apps/mobile/src/i18n/translations/pt-BR.json index 57f75b3a0737d..59a02f6520c26 100644 --- a/apps/mobile/src/i18n/translations/pt-BR.json +++ b/apps/mobile/src/i18n/translations/pt-BR.json @@ -4378,6 +4378,8 @@ "9605dc349bd2c872": "Referência de {label} em {source}", "51e507aa054ee63b": "Salvar com segurança", "4ba3eff83827c2d4": "Recusar", + "ee71ac7e8e9b000c": "Modo Ultrafast ativado", + "e649c08fbd9a1a30": "Modo Fast ativado", "1c4391ec5c411ba7": "Não foi possível parar o workflow", "fece74611dcf4173": "Não foi possível parar o agente", "9ce30f31a483c017": "Parando o workflow {label}", diff --git a/apps/mobile/src/i18n/translations/ru.json b/apps/mobile/src/i18n/translations/ru.json index 0b519fd61c51e..7389daca368d3 100644 --- a/apps/mobile/src/i18n/translations/ru.json +++ b/apps/mobile/src/i18n/translations/ru.json @@ -4456,6 +4456,8 @@ "9605dc349bd2c872": "Ссылка {label} в {source}", "51e507aa054ee63b": "Сохранить безопасно", "4ba3eff83827c2d4": "Отклонить", + "ee71ac7e8e9b000c": "Сверхбыстрый режим включён", + "e649c08fbd9a1a30": "Быстрый режим включён", "1c4391ec5c411ba7": "Не удалось остановить воркфлоу", "fece74611dcf4173": "Не удалось остановить агента", "9ce30f31a483c017": "Остановка воркфлоу {label}", diff --git a/apps/mobile/src/i18n/translations/sv.json b/apps/mobile/src/i18n/translations/sv.json index 73a0edbbad7e2..b74573181e921 100644 --- a/apps/mobile/src/i18n/translations/sv.json +++ b/apps/mobile/src/i18n/translations/sv.json @@ -4384,6 +4384,8 @@ "9605dc349bd2c872": "Referens för {label} i {source}", "51e507aa054ee63b": "Spara säkert", "4ba3eff83827c2d4": "Avböj", + "ee71ac7e8e9b000c": "Ultrasnabbt läge på", + "e649c08fbd9a1a30": "Snabbläge på", "1c4391ec5c411ba7": "Kunde inte stoppa arbetsflödet", "fece74611dcf4173": "Kunde inte stoppa agenten", "9ce30f31a483c017": "Stoppar arbetsflödet {label}", diff --git a/apps/mobile/src/i18n/translations/zh.json b/apps/mobile/src/i18n/translations/zh.json index 763019979640b..3bc84be7bfdb4 100644 --- a/apps/mobile/src/i18n/translations/zh.json +++ b/apps/mobile/src/i18n/translations/zh.json @@ -4367,6 +4367,8 @@ "9605dc349bd2c872": "{source} 中的 {label} 引用", "51e507aa054ee63b": "安全保存", "4ba3eff83827c2d4": "拒绝", + "ee71ac7e8e9b000c": "极速模式已开启", + "e649c08fbd9a1a30": "快速模式已开启", "1c4391ec5c411ba7": "无法停止工作流", "fece74611dcf4173": "无法停止智能体", "9ce30f31a483c017": "正在停止工作流 {label}", diff --git a/apps/web/src/components/chat/SubagentTooltipContent.tsx b/apps/web/src/components/chat/SubagentTooltipContent.tsx index 16b51bf8bc650..734df30631282 100644 --- a/apps/web/src/components/chat/SubagentTooltipContent.tsx +++ b/apps/web/src/components/chat/SubagentTooltipContent.tsx @@ -13,7 +13,8 @@ import { } from "@t3tools/client-runtime/state/subagent-display"; import { REASONING_EFFORT_OPTION_IDS } from "@t3tools/client-runtime/state/thread-execution"; import { getModelSelectionStringOptionValue, resolveSelectableModel } from "@t3tools/shared/model"; -import { getTraitsSpeedDisplay, TraitsSpeedIcon } from "./TraitsSpeed"; +import { getSelectionSpeedIcon } from "@t3tools/client-runtime/model-traits"; +import { TraitsSpeedIcon } from "./TraitsSpeed"; import { useGT, useMessages } from "gt-react"; import type { ReactNode } from "react"; import { @@ -82,41 +83,10 @@ export function SubagentTooltipContent(props: { const effort = REASONING_EFFORT_OPTION_IDS.map((id) => getModelSelectionStringOptionValue(matchingSelection, id), ).find(Boolean); - const speed = provider - ? providerModel?.capabilities?.optionDescriptors - ?.map((descriptor) => { - const saved = matchingSelection?.options?.find((option) => option.id === descriptor.id); - if ( - descriptor.id === "fastMode" && - descriptor.type === "boolean" && - typeof saved?.value === "boolean" - ) { - return getTraitsSpeedDisplay( - { - ...descriptor, - currentValue: saved.value, - }, - messages, - ); - } - if ( - descriptor.id === "serviceTier" && - descriptor.type === "select" && - typeof saved?.value === "string" && - descriptor.options.some((option) => option.id === saved.value) - ) { - return getTraitsSpeedDisplay( - { - ...descriptor, - currentValue: saved.value, - }, - messages, - ); - } - return null; - }) - .find(Boolean) - : undefined; + const speedIcon = getSelectionSpeedIcon( + providerModel?.capabilities?.optionDescriptors ?? [], + matchingSelection, + ); const driver = props.provider?.driver ?? props.driver; const entries = deriveProviderInstanceEntries(props.providers ?? []); const entry = entries.find((candidate) => candidate.instanceId === props.provider?.instanceId); @@ -151,11 +121,11 @@ export function SubagentTooltipContent(props: { {showInstanceBadge ? `${modelLabel} · ${entry.displayName}` : modelLabel} - {effort || speed?.speedIcon ? ( + {effort || speedIcon ? ( {effort ? " · " : null} - {speed?.speedIcon && provider ? ( - + {speedIcon && provider ? ( + ) : null} {effort} diff --git a/apps/web/src/components/chat/TraitsSpeed.tsx b/apps/web/src/components/chat/TraitsSpeed.tsx index 742fbbfad9d51..b834c1884b241 100644 --- a/apps/web/src/components/chat/TraitsSpeed.tsx +++ b/apps/web/src/components/chat/TraitsSpeed.tsx @@ -1,51 +1,10 @@ -import type { ProviderDriverKind, ProviderOptionDescriptor } from "@t3tools/contracts"; -import { getProviderOptionCurrentValue } from "@t3tools/shared/model"; -import { msg, T } from "gt-react"; +import type { ProviderDriverKind } from "@t3tools/contracts"; +import { T } from "gt-react"; import { ZapIcon } from "lucide-react"; -import { m, type MessageResolver } from "~/i18n/messages"; import { UltrafastIcon } from "../Icons"; import { cn } from "~/lib/utils"; import { ComposerControlIcon, type ComposerControlSize } from "./ComposerControl"; -export function getTraitsSpeedDisplay( - descriptor: ProviderOptionDescriptor, - resolve: MessageResolver = m, -): { label: string; speedIcon: "fast" | "ultrafast" | null } | null { - if (descriptor.id === "fastMode" && descriptor.type === "boolean") { - return { - label: - descriptor.currentValue === true - ? resolve(msg("Fast", { $context: "model speed" })) - : resolve(msg("Normal", { $context: "model speed" })), - speedIcon: descriptor.currentValue === true ? "fast" : null, - }; - } - if (descriptor.id !== "serviceTier" || descriptor.type !== "select") { - return null; - } - const currentValue = getProviderOptionCurrentValue(descriptor); - const fastTier = descriptor.options.find(({ label }) => label === "Fast"); - const ultrafastTier = descriptor.options.find(({ label }) => label === "Ultrafast"); - if ( - ((fastTier || ultrafastTier) && currentValue === "default") || - (fastTier && currentValue === fastTier.id) || - (ultrafastTier && currentValue === ultrafastTier.id) - ) { - return { - label: - descriptor.options.find(({ id }) => id === currentValue)?.label ?? - resolve(msg("Normal", { $context: "model speed" })), - speedIcon: - ultrafastTier && currentValue === ultrafastTier.id - ? "ultrafast" - : fastTier && currentValue === fastTier.id - ? "fast" - : null, - }; - } - return null; -} - export function TraitsSpeedIcon({ provider, speedIcon, diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 08294d6583996..38bdf13366345 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -4462,8 +4462,6 @@ "866b2e7be2433828": "Standard", "da531a1ea0b7b967": "An", "36411ef98a3f56a6": "Aus", - "1eae6743570b2211": "Schnell", - "ed3b9ada396031c5": "Normal", "75cdbffdefbbae3a": "Ultrafast-Modus an", "79c3a186139f8c86": "Fast-Modus an", "a772b49a38a3db40": "Was ist schiefgelaufen?", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index 490aab5d7897a..29f4c9f6553fc 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -4461,8 +4461,6 @@ "866b2e7be2433828": "Default", "da531a1ea0b7b967": "On", "36411ef98a3f56a6": "Off", - "1eae6743570b2211": "Fast", - "ed3b9ada396031c5": "Normal", "75cdbffdefbbae3a": "Ultrafast mode on", "79c3a186139f8c86": "Fast mode on", "a772b49a38a3db40": "What went wrong?", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index d09c34ee915e3..5dbbfa8b86614 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -4459,8 +4459,6 @@ "866b2e7be2433828": "Predeterminado", "da531a1ea0b7b967": "Activado", "36411ef98a3f56a6": "Desactivado", - "1eae6743570b2211": "Rápido", - "ed3b9ada396031c5": "Normal", "75cdbffdefbbae3a": "Modo Ultrafast activado", "79c3a186139f8c86": "Modo rápido activado", "a772b49a38a3db40": "¿Qué salió mal?", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index 496a0075ce751..7d60290f7c2ee 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -4460,8 +4460,6 @@ "866b2e7be2433828": "Par défaut", "da531a1ea0b7b967": "Activé", "36411ef98a3f56a6": "Désactivé", - "1eae6743570b2211": "Rapide", - "ed3b9ada396031c5": "Normale", "75cdbffdefbbae3a": "Mode Ultrafast activé", "79c3a186139f8c86": "Mode Fast activé", "a772b49a38a3db40": "Qu’est-ce qui n’a pas marché ?", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index c6295db2ad24e..b431193fc9f5e 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -4450,8 +4450,6 @@ "866b2e7be2433828": "デフォルト", "da531a1ea0b7b967": "オン", "36411ef98a3f56a6": "オフ", - "1eae6743570b2211": "高速", - "ed3b9ada396031c5": "標準", "75cdbffdefbbae3a": "超高速モード オン", "79c3a186139f8c86": "高速モード オン", "a772b49a38a3db40": "何が問題でしたか?", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index 84311b25cd463..a89fb893ec7cf 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -4447,8 +4447,6 @@ "866b2e7be2433828": "기본값", "da531a1ea0b7b967": "켜짐", "36411ef98a3f56a6": "꺼짐", - "1eae6743570b2211": "빠름", - "ed3b9ada396031c5": "보통", "75cdbffdefbbae3a": "초고속 모드 켜짐", "79c3a186139f8c86": "고속 모드 켜짐", "a772b49a38a3db40": "무엇이 잘못되었나요?", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index 0a566f1e7c18a..867082f4f1a84 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -4459,8 +4459,6 @@ "866b2e7be2433828": "Padrão", "da531a1ea0b7b967": "Ativado", "36411ef98a3f56a6": "Desativado", - "1eae6743570b2211": "Rápido", - "ed3b9ada396031c5": "Normal", "75cdbffdefbbae3a": "Modo Ultrafast ativado", "79c3a186139f8c86": "Modo Fast ativado", "a772b49a38a3db40": "O que deu errado?", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index c948f268338ce..0a0b6e08b4df9 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -4459,8 +4459,6 @@ "866b2e7be2433828": "По умолчанию", "da531a1ea0b7b967": "Вкл.", "36411ef98a3f56a6": "Выкл.", - "1eae6743570b2211": "Быстрая", - "ed3b9ada396031c5": "Обычная", "75cdbffdefbbae3a": "Сверхбыстрый режим включён", "79c3a186139f8c86": "Быстрый режим включён", "a772b49a38a3db40": "Что пошло не так?", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index 9e631e68a8c0e..4a204c68b69eb 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -4460,8 +4460,6 @@ "866b2e7be2433828": "Standard", "da531a1ea0b7b967": "På", "36411ef98a3f56a6": "Av", - "1eae6743570b2211": "Snabb", - "ed3b9ada396031c5": "Normal", "75cdbffdefbbae3a": "Ultrasnabbt läge på", "79c3a186139f8c86": "Snabbläge på", "a772b49a38a3db40": "Vad gick fel?", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index ac25c9237c4fe..641e93ea21c67 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -4466,8 +4466,6 @@ "866b2e7be2433828": "默认", "da531a1ea0b7b967": "开启", "36411ef98a3f56a6": "关闭", - "1eae6743570b2211": "快速", - "ed3b9ada396031c5": "普通", "75cdbffdefbbae3a": "极速模式已开启", "79c3a186139f8c86": "快速模式已开启", "a772b49a38a3db40": "遇到了什么问题?", diff --git a/packages/client-runtime/src/modelTraits.ts b/packages/client-runtime/src/modelTraits.ts index da2387da30278..28c76ba43e49e 100644 --- a/packages/client-runtime/src/modelTraits.ts +++ b/packages/client-runtime/src/modelTraits.ts @@ -195,3 +195,22 @@ export function buildTraitsTriggerDisplay( } return { label: labels.join(" · "), speedLabel, ultracode }; } + +/** The speed a saved selection runs at, read through the model's catalog descriptors. */ +export function getSelectionSpeedIcon( + descriptors: ReadonlyArray, + selection: ModelSelection | undefined, +): "fast" | "ultrafast" | null { + for (const descriptor of descriptors) { + const saved = selection?.options?.find((option) => option.id === descriptor.id)?.value; + if (descriptor.id === "fastMode" && descriptor.type === "boolean" && saved === true) { + return "fast"; + } + if (descriptor.id === "serviceTier" && descriptor.type === "select") { + const label = descriptor.options.find((option) => option.id === saved)?.label; + if (label === "Ultrafast") return "ultrafast"; + if (label === "Fast") return "fast"; + } + } + return null; +}