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 {...@@ -4,7 +4,6 @@ import {
4 getAppModelOptions,4 getAppModelOptions,
5 getSlashModelOptions,5 getSlashModelOptions,
6 normalizeCustomModelSlugs,6 normalizeCustomModelSlugs,
7 shouldShowFastTierIcon,
8 resolveAppModelSelection,7 resolveAppModelSelection,
9} from "./appSettings";8} from "./appSettings";
109
...@@ -83,11 +82,3 @@ describe("getSlashModelOptions", () => {...@@ -83,11 +82,3 @@ describe("getSlashModelOptions", () => {
83 expect(options.map((option) => option.slug)).toEqual(["openai/gpt-oss-120b"]);82 expect(options.map((option) => option.slug)).toEqual(["openai/gpt-oss-120b"]);
84 });83 });
85});84});
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...@@ -6,7 +6,6 @@ import { getDefaultModel, getModelOptions, normalizeModelSlug } from "@t3tools/s
6const APP_SETTINGS_STORAGE_KEY = "t3code:app-settings:v1";6const APP_SETTINGS_STORAGE_KEY = "t3code:app-settings:v1";
7const MAX_CUSTOM_MODEL_COUNT = 32;7const MAX_CUSTOM_MODEL_COUNT = 32;
8export const MAX_CUSTOM_MODEL_LENGTH = 256;8export const MAX_CUSTOM_MODEL_LENGTH = 256;
9const MODELS_WITH_FAST_SUPPORT = new Set(["gpt-5.4"]);
10const BUILT_IN_MODEL_SLUGS_BY_PROVIDER: Record<ProviderKind, ReadonlySet<string>> = {9const BUILT_IN_MODEL_SLUGS_BY_PROVIDER: Record<ProviderKind, ReadonlySet<string>> = {
11 codex: new Set(getModelOptions("codex").map((option) => option.slug)),10 codex: new Set(getModelOptions("codex").map((option) => option.slug)),
12};11};
...@@ -33,18 +32,6 @@ export interface AppModelOption {...@@ -33,18 +32,6 @@ export interface AppModelOption {
33 isCustom: boolean;32 isCustom: boolean;
34}33}
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
48const DEFAULT_APP_SETTINGS = AppSettingsSchema.makeUnsafe({});35const DEFAULT_APP_SETTINGS = AppSettingsSchema.makeUnsafe({});
4936
50let listeners: Array<() => void> = [];37let listeners: Array<() => void> = [];
apps/web/src/components/ChatView.tsx+2-19
...@@ -145,7 +145,6 @@ import {...@@ -145,7 +145,6 @@ import {
145 XIcon,145 XIcon,
146 CopyIcon,146 CopyIcon,
147 CheckIcon,147 CheckIcon,
148 ZapIcon,
149} from "lucide-react";148} from "lucide-react";
150import { Button } from "./ui/button";149import { Button } from "./ui/button";
151import { Input } from "./ui/input";150import { Input } from "./ui/input";
...@@ -205,7 +204,6 @@ import { readNativeApi } from "~/nativeApi";...@@ -205,7 +204,6 @@ import { readNativeApi } from "~/nativeApi";
205import {204import {
206 getAppModelOptions,205 getAppModelOptions,
207 resolveAppModelSelection,206 resolveAppModelSelection,
208 shouldShowFastTierIcon,
209 useAppSettings,207 useAppSettings,
210} from "../appSettings";208} from "../appSettings";
211import {209import {
...@@ -408,7 +406,6 @@ type ComposerCommandItem =...@@ -408,7 +406,6 @@ type ComposerCommandItem =
408 model: ModelSlug;406 model: ModelSlug;
409 label: string;407 label: string;
410 description: string;408 description: string;
411 showFastBadge: boolean;
412 };409 };
413410
414type SendPhase = "idle" | "preparing-worktree" | "sending-turn";411type SendPhase = "idle" | "preparing-worktree" | "sending-turn";
...@@ -519,9 +516,6 @@ const ComposerCommandMenuItem = memo(function ComposerCommandMenuItem(props: {...@@ -519,9 +516,6 @@ const ComposerCommandMenuItem = memo(function ComposerCommandMenuItem(props: {
519 </Badge>516 </Badge>
520 ) : null}517 ) : null}
521 <span className="flex min-w-0 items-center gap-1.5 truncate">518 <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}
525 <span className="truncate">{props.item.label}</span>519 <span className="truncate">{props.item.label}</span>
526 </span>520 </span>
527 <span className="truncate text-muted-foreground/70 text-xs">{props.item.description}</span>521 <span className="truncate text-muted-foreground/70 text-xs">{props.item.description}</span>
...@@ -1250,10 +1244,8 @@ export default function ChatView({ threadId }: ChatViewProps) {...@@ -1250,10 +1244,8 @@ export default function ChatView({ threadId }: ChatViewProps) {
1250 model: slug,1244 model: slug,
1251 label: name,1245 label: name,
1252 description: `${providerLabel} · ${slug}`,1246 description: `${providerLabel} · ${slug}`,
1253 showFastBadge:
1254 provider === "codex" && shouldShowFastTierIcon(slug, selectedCodexFastModeEnabled),
1255 }));1247 }));
1256 }, [composerTrigger, searchableModelOptions, selectedCodexFastModeEnabled, workspaceEntries]);1248 }, [composerTrigger, searchableModelOptions, workspaceEntries]);
1257 const composerMenuOpen = Boolean(composerTrigger);1249 const composerMenuOpen = Boolean(composerTrigger);
1258 const activeComposerMenuItem = useMemo(1250 const activeComposerMenuItem = useMemo(
1259 () =>1251 () =>
...@@ -3695,7 +3687,6 @@ export default function ChatView({ threadId }: ChatViewProps) {...@@ -3695,7 +3687,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
3695 model={selectedModelForPickerWithCustomFallback}3687 model={selectedModelForPickerWithCustomFallback}
3696 lockedProvider={lockedProvider}3688 lockedProvider={lockedProvider}
3697 modelOptionsByProvider={modelOptionsByProvider}3689 modelOptionsByProvider={modelOptionsByProvider}
3698 fastModeEnabled={selectedCodexFastModeEnabled}
3699 onProviderModelChange={onProviderModelSelect}3690 onProviderModelChange={onProviderModelSelect}
3700 />3691 />
37013692
...@@ -5543,7 +5534,6 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {...@@ -5543,7 +5534,6 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {
5543 model: ModelSlug;5534 model: ModelSlug;
5544 lockedProvider: ProviderKind | null;5535 lockedProvider: ProviderKind | null;
5545 modelOptionsByProvider: Record<ProviderKind, ReadonlyArray<{ slug: string; name: string }>>;5536 modelOptionsByProvider: Record<ProviderKind, ReadonlyArray<{ slug: string; name: string }>>;
5546 fastModeEnabled: boolean;
5547 disabled?: boolean;5537 disabled?: boolean;
5548 onProviderModelChange: (provider: ProviderKind, model: ModelSlug) => void;5538 onProviderModelChange: (provider: ProviderKind, model: ModelSlug) => void;
5549}) {5539}) {
...@@ -5573,12 +5563,9 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {...@@ -5573,12 +5563,9 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {
5573 disabled={props.disabled}5563 disabled={props.disabled}
5574 />5564 />
5575 }5565 }
5576 >5566 >
5577 <span className="flex min-w-0 items-center gap-2">5567 <span className="flex min-w-0 items-center gap-2">
5578 <ProviderIcon aria-hidden="true" className="size-4 shrink-0 text-muted-foreground/70" />5568 <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}
5582 <span className="truncate">{selectedModelLabel}</span>5569 <span className="truncate">{selectedModelLabel}</span>
5583 <ChevronDownIcon aria-hidden="true" className="size-3 opacity-60" />5570 <ChevronDownIcon aria-hidden="true" className="size-3 opacity-60" />
5584 </span>5571 </span>
...@@ -5621,10 +5608,6 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {...@@ -5621,10 +5608,6 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {
5621 value={modelOption.slug}5608 value={modelOption.slug}
5622 onClick={() => setIsMenuOpen(false)}5609 onClick={() => setIsMenuOpen(false)}
5623 >5610 >
5624 {option.value === "codex" &&
5625 shouldShowFastTierIcon(modelOption.slug, props.fastModeEnabled) ? (
5626 <ZapIcon className="size-3.5 shrink-0 text-amber-500" />
5627 ) : null}
5628 {modelOption.name}5611 {modelOption.name}
5629 </MenuRadioItem>5612 </MenuRadioItem>
5630 ))}5613 ))}