authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-09 09:29:20-07:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-09 09:47:21-07:00
log081a6dacdbb623da0b560360384d58cb95a484e5
tree006c9a075fab96185374793c702de8a3d123a39a
parent9fdb45be1efb0e0b542a0dd78d868de6f71d7d4a

Remove fast-tier icons from model selection UI

- delete `shouldShowFastTierIcon` and its test - remove Zap icon badges from slash model commands and provider model picker - simplify related ChatView props and memo dependencies

3 files changed, 2 insertions(+), 41 deletions(-)

apps/web/src/appSettings.test.ts-9
......@@ -4,7 +4,6 @@ import {
44 getAppModelOptions,
55 getSlashModelOptions,
66 normalizeCustomModelSlugs,
7 shouldShowFastTierIcon,
87 resolveAppModelSelection,
98} from "./appSettings";
109
......@@ -83,11 +82,3 @@ describe("getSlashModelOptions", () => {
8382 expect(options.map((option) => option.slug)).toEqual(["openai/gpt-oss-120b"]);
8483 });
8584});
86
87describe("shouldShowFastTierIcon", () => {
88 it("shows the fast-tier icon only for gpt-5.4 when fast mode is enabled", () => {
89 expect(shouldShowFastTierIcon("gpt-5.4", true)).toBe(true);
90 expect(shouldShowFastTierIcon("gpt-5.4", false)).toBe(false);
91 expect(shouldShowFastTierIcon("gpt-5.3-codex", true)).toBe(false);
92 });
93});
apps/web/src/appSettings.ts-13
......@@ -6,7 +6,6 @@ import { getDefaultModel, getModelOptions, normalizeModelSlug } from "@t3tools/s
66const APP_SETTINGS_STORAGE_KEY = "t3code:app-settings:v1";
77const MAX_CUSTOM_MODEL_COUNT = 32;
88export const MAX_CUSTOM_MODEL_LENGTH = 256;
9const MODELS_WITH_FAST_SUPPORT = new Set(["gpt-5.4"]);
109const BUILT_IN_MODEL_SLUGS_BY_PROVIDER: Record<ProviderKind, ReadonlySet<string>> = {
1110 codex: new Set(getModelOptions("codex").map((option) => option.slug)),
1211};
......@@ -33,18 +32,6 @@ export interface AppModelOption {
3332 isCustom: boolean;
3433}
3534
36export function shouldShowFastTierIcon(
37 model: string | null | undefined,
38 fastModeEnabled: boolean,
39): boolean {
40 const normalizedModel = normalizeModelSlug(model);
41 return (
42 fastModeEnabled &&
43 normalizedModel !== null &&
44 MODELS_WITH_FAST_SUPPORT.has(normalizedModel)
45 );
46}
47
4835const DEFAULT_APP_SETTINGS = AppSettingsSchema.makeUnsafe({});
4936
5037let listeners: Array<() => void> = [];
apps/web/src/components/ChatView.tsx+2-19
......@@ -145,7 +145,6 @@ import {
145145 XIcon,
146146 CopyIcon,
147147 CheckIcon,
148 ZapIcon,
149148} from "lucide-react";
150149import { Button } from "./ui/button";
151150import { Input } from "./ui/input";
......@@ -205,7 +204,6 @@ import { readNativeApi } from "~/nativeApi";
205204import {
206205 getAppModelOptions,
207206 resolveAppModelSelection,
208 shouldShowFastTierIcon,
209207 useAppSettings,
210208} from "../appSettings";
211209import {
......@@ -408,7 +406,6 @@ type ComposerCommandItem =
408406 model: ModelSlug;
409407 label: string;
410408 description: string;
411 showFastBadge: boolean;
412409 };
413410
414411type SendPhase = "idle" | "preparing-worktree" | "sending-turn";
......@@ -519,9 +516,6 @@ const ComposerCommandMenuItem = memo(function ComposerCommandMenuItem(props: {
519516 </Badge>
520517 ) : null}
521518 <span className="flex min-w-0 items-center gap-1.5 truncate">
522 {props.item.type === "model" && props.item.showFastBadge ? (
523 <ZapIcon className="size-3.5 shrink-0 text-amber-500" />
524 ) : null}
525519 <span className="truncate">{props.item.label}</span>
526520 </span>
527521 <span className="truncate text-muted-foreground/70 text-xs">{props.item.description}</span>
......@@ -1250,10 +1244,8 @@ export default function ChatView({ threadId }: ChatViewProps) {
12501244 model: slug,
12511245 label: name,
12521246 description: `${providerLabel} · ${slug}`,
1253 showFastBadge:
1254 provider === "codex" && shouldShowFastTierIcon(slug, selectedCodexFastModeEnabled),
12551247 }));
1256 }, [composerTrigger, searchableModelOptions, selectedCodexFastModeEnabled, workspaceEntries]);
1248 }, [composerTrigger, searchableModelOptions, workspaceEntries]);
12571249 const composerMenuOpen = Boolean(composerTrigger);
12581250 const activeComposerMenuItem = useMemo(
12591251 () =>
......@@ -3695,7 +3687,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
36953687 model={selectedModelForPickerWithCustomFallback}
36963688 lockedProvider={lockedProvider}
36973689 modelOptionsByProvider={modelOptionsByProvider}
3698 fastModeEnabled={selectedCodexFastModeEnabled}
36993690 onProviderModelChange={onProviderModelSelect}
37003691 />
37013692
......@@ -5543,7 +5534,6 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {
55435534 model: ModelSlug;
55445535 lockedProvider: ProviderKind | null;
55455536 modelOptionsByProvider: Record<ProviderKind, ReadonlyArray<{ slug: string; name: string }>>;
5546 fastModeEnabled: boolean;
55475537 disabled?: boolean;
55485538 onProviderModelChange: (provider: ProviderKind, model: ModelSlug) => void;
55495539}) {
......@@ -5573,12 +5563,9 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {
55735563 disabled={props.disabled}
55745564 />
55755565 }
5576 >
5566 >
55775567 <span className="flex min-w-0 items-center gap-2">
55785568 <ProviderIcon aria-hidden="true" className="size-4 shrink-0 text-muted-foreground/70" />
5579 {props.provider === "codex" && shouldShowFastTierIcon(props.model, props.fastModeEnabled) ? (
5580 <ZapIcon className="size-3.5 shrink-0 text-amber-500" />
5581 ) : null}
55825569 <span className="truncate">{selectedModelLabel}</span>
55835570 <ChevronDownIcon aria-hidden="true" className="size-3 opacity-60" />
55845571 </span>
......@@ -5621,10 +5608,6 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {
56215608 value={modelOption.slug}
56225609 onClick={() => setIsMenuOpen(false)}
56235610 >
5624 {option.value === "codex" &&
5625 shouldShowFastTierIcon(modelOption.slug, props.fastModeEnabled) ? (
5626 <ZapIcon className="size-3.5 shrink-0 text-amber-500" />
5627 ) : null}
56285611 {modelOption.name}
56295612 </MenuRadioItem>
56305613 ))}