diff --git a/gui/src/combo-public-model.ts b/gui/src/combo-public-model.ts new file mode 100644 index 000000000..9292cbf71 --- /dev/null +++ b/gui/src/combo-public-model.ts @@ -0,0 +1,7 @@ +/** Placeholder shown before the draft id/alias can form a public model id. */ +export const PUBLIC_MODEL_PREVIEW_PLACEHOLDER = "…"; + +/** True when the preview value is a real public model id clients can request. */ +export function canCopyPublicModelId(model: string): boolean { + return model.trim().length > 0 && model !== PUBLIC_MODEL_PREVIEW_PLACEHOLDER; +} diff --git a/gui/src/components/combo-workspace-add-modal.tsx b/gui/src/components/combo-workspace-add-modal.tsx index cff828c5c..8dcfb5869 100644 --- a/gui/src/components/combo-workspace-add-modal.tsx +++ b/gui/src/components/combo-workspace-add-modal.tsx @@ -6,11 +6,12 @@ import { intersectComboEfforts, validateComboDraft, } from "../combo-workspace-data"; +import { PUBLIC_MODEL_PREVIEW_PLACEHOLDER } from "../combo-public-model"; import { IconX } from "../icons"; import { useT } from "../i18n/shared"; import { Notice } from "../ui"; import type { ModelOption, ProviderOption } from "./combo-workspace-types"; -import { EffortSelect, StrategySeg, TargetEditor } from "./combo-workspace-controls"; +import { EffortSelect, PublicModelPreview, StrategySeg, TargetEditor } from "./combo-workspace-controls"; import { clampedNumberInput } from "./combo-workspace-utils"; export function AddComboModal({ @@ -139,11 +140,9 @@ export function AddComboModal({
{t("cws.field.aliasHint")}
-- {t("cws.field.idHint", { - model: draft.id.trim() ? comboPublicModelId(draft.id, draft.alias) : "…", - })} -
+
+ {before}
+ {model}
+ {after}
+