Skip to content

Commit 832b734

Browse files
committed
🤖 fix: make model tooltip abbreviations dynamic
Tooltip now derives abbreviation examples from KNOWN_MODELS instead of hardcoding model names, so updates to model versions automatically propagate to the tooltip. _Generated with `mux`_
1 parent 51f74ff commit 832b734

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/browser/components/ChatInput/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import {
5757

5858
import type { ThinkingLevel } from "@/common/types/thinking";
5959
import type { MuxFrontendMetadata } from "@/common/types/message";
60+
import { MODEL_ABBREVIATION_EXAMPLES } from "@/common/constants/knownModels";
6061
import { useTelemetry } from "@/browser/hooks/useTelemetry";
6162
import { getTokenCountPromise } from "@/browser/utils/tokenizer/rendererClient";
6263
import { CreationCenterContent } from "./CreationCenterContent";
@@ -933,8 +934,11 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
933934
<br />
934935
<br />
935936
<strong>Abbreviations:</strong>
936-
<br /><code>/model opus</code> - Claude Opus 4.1
937-
<br /><code>/model sonnet</code> - Claude Sonnet 4.5
937+
{MODEL_ABBREVIATION_EXAMPLES.map((ex) => (
938+
<React.Fragment key={ex.abbrev}>
939+
<br /><code>/model {ex.abbrev}</code> - {ex.displayName}
940+
</React.Fragment>
941+
))}
938942
<br />
939943
<br />
940944
<strong>Full format:</strong>

src/common/constants/knownModels.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,9 @@ export const KNOWN_MODEL_OPTIONS = Object.values(KNOWN_MODELS).map((model) => ({
159159
label: formatModelDisplayName(model.providerModelId),
160160
value: model.id,
161161
}));
162+
163+
/** Tooltip-friendly abbreviation examples: show representative shortcuts */
164+
export const MODEL_ABBREVIATION_EXAMPLES = (["opus", "sonnet"] as const).map((abbrev) => ({
165+
abbrev,
166+
displayName: formatModelDisplayName(MODEL_ABBREVIATIONS[abbrev].split(":")[1]),
167+
}));

0 commit comments

Comments
 (0)