@devries-cameron20 / t3code Mirror · read-only / commits / 792c7dd127
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 21:45 UTC

fix(web): show double bolts for Codex Ultrafast (#14479)

Theo Browne committed Sep 30, 2026 at 13:03 UTC 792c7dd127865fc542a453ad944b94ae85ead10a
4 files changed +95 -37
apps/web/src/components/Icons.tsx
+7
@@ -2,6 +2,13 @@ import React, { type SVGProps, useId } from "react";
2 import { cn } from "~/lib/utils";
3 export type Icon = React.FC<SVGProps<SVGSVGElement>>;
4
5 +export const UltrafastIcon: Icon = (props) => (
6 + <svg viewBox="0 0 24 24" fill="currentColor" {...props}>
7 + <path d="m17 2-10 12h7l-1 8 10-12h-7l1-8Z" opacity="0.4" />
8 + <path d="m11 2-10 12h7l-1 8 10-12h-7l1-8Z" />
9 + </svg>
10 +);
11 +
12 export const FinderIcon: Icon = (props) => (
13 <svg viewBox="0 0 24 24" fill="none" {...props}>
14 <rect x="2" y="2" width="20" height="20" rx="4" fill="#36A9F5" />
apps/web/src/components/chat/ComposerControl.tsx
+3 -3
@@ -1,8 +1,8 @@
1 import { mergeProps } from "@base-ui/react/merge-props";
2 import { Select as SelectPrimitive } from "@base-ui/react/select";
3 import { useRender } from "@base-ui/react/use-render";
4 -import type { ComponentProps } from "react";
5 -import { ChevronDownIcon, type LucideIcon } from "lucide-react";
4 +import type { ComponentProps, ComponentType, SVGProps } from "react";
5 +import { ChevronDownIcon } from "lucide-react";
6
7 import { cn } from "~/lib/utils";
8 import { Separator } from "../ui/separator";
@@ -52,7 +52,7 @@ export function ComposerControlIcon({
52 opticalSize = "default",
53 size = "sm",
54 }: {
55 - icon: LucideIcon;
55 + icon: ComponentType<SVGProps<SVGSVGElement>>;
56 className?: string | undefined;
57 opticalSize?: "default" | "large";
58 size?: ComposerControlSize;
apps/web/src/components/chat/TraitsPicker.test.ts
+57 -13
@@ -17,7 +17,7 @@ function fastModeDescriptor(
17 }
18
19 function serviceTierDescriptor(
20 - currentValue: "default" | "priority" | "flex",
20 + currentValue: "default" | "priority" | "ultrafast" | "flex",
21 ): Extract<ProviderOptionDescriptor, { type: "select" }> {
22 return {
23 id: "serviceTier",
@@ -26,6 +26,7 @@ function serviceTierDescriptor(
26 options: [
27 { id: "default", label: "Standard", isDefault: true },
28 { id: "priority", label: "Fast" },
29 + { id: "ultrafast", label: "Ultrafast" },
30 { id: "flex", label: "Flex" },
31 ],
32 currentValue,
@@ -64,43 +65,86 @@ describe("buildTraitsTriggerDisplay", () => {
65 it("omits fast mode from the label entirely when it is off", () => {
66 expect(display([EFFORT, fastModeDescriptor(false), CONTEXT_WINDOW])).toEqual({
67 label: "High · 1M",
67 - showFastModeIcon: false,
68 + speedIcon: null,
69 });
70 });
71
72 it("shows the bolt instead of a text label when fast mode is on", () => {
73 expect(display([EFFORT, fastModeDescriptor(true), CONTEXT_WINDOW])).toEqual({
74 label: "High · 1M",
74 - showFastModeIcon: true,
75 + speedIcon: "fast",
76 });
77 });
78
79 it("treats Codex standard and fast service tiers as fast mode states", () => {
80 expect(display([EFFORT, serviceTierDescriptor("default")])).toEqual({
81 label: "High",
81 - showFastModeIcon: false,
82 + speedIcon: null,
83 });
84 expect(display([EFFORT, serviceTierDescriptor("priority")])).toEqual({
85 label: "High",
85 - showFastModeIcon: true,
86 + speedIcon: "fast",
87 + });
88 + });
89 +
90 + it("uses a distinct double bolt for Codex Ultrafast", () => {
91 + expect(display([EFFORT, serviceTierDescriptor("ultrafast")])).toEqual({
92 + label: "High",
93 + speedIcon: "ultrafast",
94 + });
95 + });
96 +
97 + it("uses Ultrafast without requiring a Fast tier", () => {
98 + const descriptor = serviceTierDescriptor("ultrafast");
99 + expect(
100 + display([
101 + EFFORT,
102 + { ...descriptor, options: descriptor.options.filter(({ id }) => id !== "priority") },
103 + ]),
104 + ).toEqual({
105 + label: "High",
106 + speedIcon: "ultrafast",
107 });
108 });
109
110 it("keeps other Codex service tiers in the label", () => {
111 expect(display([EFFORT, serviceTierDescriptor("flex")])).toEqual({
112 label: "High · Flex",
92 - showFastModeIcon: false,
113 + speedIcon: null,
114 + });
115 + });
116 +
117 + it("keeps Standard as text for models without speed tiers", () => {
118 + const descriptor = serviceTierDescriptor("default");
119 + const nonSpeedDescriptor = {
120 + ...descriptor,
121 + options: descriptor.options.filter(({ id }) => id === "default" || id === "flex"),
122 + };
123 + expect(display([EFFORT, nonSpeedDescriptor])).toEqual({
124 + label: "High · Standard",
125 + speedIcon: null,
126 + });
127 + expect(display([nonSpeedDescriptor])).toEqual({
128 + label: "Standard",
129 + speedIcon: null,
130 });
131 });
132
133 it("keeps the Codex service tier readable when it is the only trait", () => {
134 expect(display([serviceTierDescriptor("default")])).toEqual({
135 label: "Standard",
99 - showFastModeIcon: false,
136 + speedIcon: null,
137 });
138 expect(display([serviceTierDescriptor("priority")])).toEqual({
139 label: "Fast",
103 - showFastModeIcon: false,
140 + speedIcon: null,
141 + });
142 + });
143 +
144 + it("keeps Ultrafast readable when it is the only trait", () => {
145 + expect(display([serviceTierDescriptor("ultrafast")])).toEqual({
146 + label: "Ultrafast",
147 + speedIcon: null,
148 });
149 });
150
@@ -113,18 +157,18 @@ describe("buildTraitsTriggerDisplay", () => {
157 };
158 expect(display([EFFORT, thinking])).toEqual({
159 label: "High · Thinking On",
116 - showFastModeIcon: false,
160 + speedIcon: null,
161 });
162 });
163
164 it("falls back to a text label when fast mode is the only trait", () => {
165 expect(display([fastModeDescriptor(true)])).toEqual({
166 label: "Fast",
123 - showFastModeIcon: false,
167 + speedIcon: null,
168 });
169 expect(display([fastModeDescriptor(false)])).toEqual({
170 label: "Normal",
127 - showFastModeIcon: false,
171 + speedIcon: null,
172 });
173 });
174
@@ -141,7 +185,7 @@ describe("buildTraitsTriggerDisplay", () => {
185 { id: "high", label: "High" },
186 ],
187 };
144 - expect(display([unresolved])).toEqual({ label: "", showFastModeIcon: false });
188 + expect(display([unresolved])).toEqual({ label: "", speedIcon: null });
189 });
190
191 it("still renders the prompt-controlled ultrathink label alongside the bolt", () => {
@@ -152,7 +196,7 @@ describe("buildTraitsTriggerDisplay", () => {
196 primarySelectDescriptorId: "reasoningEffort",
197 ultrathinkPromptControlled: true,
198 }),
155 - ).toEqual({ label: "Ultrathink", showFastModeIcon: true });
199 + ).toEqual({ label: "Ultrathink", speedIcon: "fast" });
200 });
201 });
202
apps/web/src/components/chat/TraitsPicker.tsx
+28 -21
@@ -17,6 +17,7 @@ import {
17 } from "@t3tools/shared/model";
18 import { memo, useCallback } from "react";
19 import { BrainIcon, ZapIcon } from "lucide-react";
20 +import { UltrafastIcon } from "../Icons";
21 import {
22 Menu,
23 MenuGroup,
@@ -474,26 +475,22 @@ export const TraitsMenuContent = memo(function TraitsMenuContentImpl({
475 });
476
477 /**
477 - * Build the traits trigger's text label plus whether the fast-mode bolt should
478 - * render. Claude and Cursor expose fast mode as a boolean, while Codex exposes
479 - * it through the Standard/Fast service tiers. In either form, fast mode is a
480 - * lightning bolt when on and nothing at all when off. The one exception is when
481 - * fast mode is the only trait, where a bare bolt (or bare chevron) would leave
482 - * the trigger unreadable.
478 + * Fast mode uses one bolt; Codex Ultrafast uses two. Keep a text label when
479 + * speed is the only trait so the trigger remains readable.
480 */
481 export function buildTraitsTriggerDisplay(input: {
482 provider: ProviderDriverKind;
483 descriptors: ReadonlyArray<ProviderOptionDescriptor>;
484 primarySelectDescriptorId: string | null;
485 ultrathinkPromptControlled: boolean;
489 -}): { label: string; showFastModeIcon: boolean } {
486 +}): { label: string; speedIcon: "fast" | "ultrafast" | null } {
487 let fastModeFallbackLabel: string | null = null;
491 - let fastModeEnabled = false;
488 + let speedIcon: "fast" | "ultrafast" | null = null;
489 const labels: Array<string> = [];
490 for (const descriptor of input.descriptors) {
491 if (descriptor.id === "fastMode" && descriptor.type === "boolean") {
495 - fastModeEnabled = descriptor.currentValue === true;
496 - fastModeFallbackLabel = fastModeEnabled ? "Fast" : "Normal";
492 + speedIcon = descriptor.currentValue === true ? "fast" : null;
493 + fastModeFallbackLabel = speedIcon ? "Fast" : "Normal";
494 continue;
495 }
496 if (
@@ -503,11 +500,20 @@ export function buildTraitsTriggerDisplay(input: {
500 ) {
501 const currentValue = getProviderOptionCurrentValue(descriptor);
502 const fastTier = descriptor.options.find(({ label }) => label === "Fast");
506 - if (fastTier && (currentValue === "default" || currentValue === fastTier.id)) {
507 - fastModeEnabled = currentValue === fastTier.id;
503 + const ultrafastTier = descriptor.options.find(({ label }) => label === "Ultrafast");
504 + if (
505 + ((fastTier || ultrafastTier) && currentValue === "default") ||
506 + (fastTier && currentValue === fastTier.id) ||
507 + (ultrafastTier && currentValue === ultrafastTier.id)
508 + ) {
509 + speedIcon =
510 + ultrafastTier && currentValue === ultrafastTier.id
511 + ? "ultrafast"
512 + : fastTier && currentValue === fastTier.id
513 + ? "fast"
514 + : null;
515 fastModeFallbackLabel =
509 - descriptor.options.find(({ id }) => id === currentValue)?.label ??
510 - (fastModeEnabled ? "Fast" : "Normal");
516 + descriptor.options.find(({ id }) => id === currentValue)?.label ?? "Normal";
517 continue;
518 }
519 }
@@ -526,9 +532,9 @@ export function buildTraitsTriggerDisplay(input: {
532 // off an empty label list alone would also catch descriptors that resolved to
533 // no label at all, printing a bogus "Normal" for a model without fast mode.
534 if (labels.length === 0 && fastModeFallbackLabel !== null) {
529 - return { label: fastModeFallbackLabel, showFastModeIcon: false };
535 + return { label: fastModeFallbackLabel, speedIcon: null };
536 }
531 - return { label: labels.join(" · "), showFastModeIcon: fastModeEnabled };
537 + return { label: labels.join(" · "), speedIcon };
538 }
539
540 export const TraitsPicker = memo(function TraitsPicker({
@@ -577,17 +583,18 @@ export const TraitsPicker = memo(function TraitsPicker({
583 return null;
584 }
585
580 - const { label: triggerLabel, showFastModeIcon } = buildTraitsTriggerDisplay({
586 + const { label: triggerLabel, speedIcon } = buildTraitsTriggerDisplay({
587 provider,
588 descriptors,
589 primarySelectDescriptorId: primarySelectDescriptor?.id ?? null,
590 ultrathinkPromptControlled,
591 });
586 - const accessibleLabel = showFastModeIcon ? `${triggerLabel}, Fast mode on` : triggerLabel;
587 - const fastModeIcon = showFastModeIcon ? (
592 + const speedLabel = speedIcon === "ultrafast" ? "Ultrafast mode on" : "Fast mode on";
593 + const accessibleLabel = speedIcon ? `${triggerLabel}, ${speedLabel}` : triggerLabel;
594 + const fastModeIcon = speedIcon ? (
595 <>
596 <ComposerControlIcon
590 - icon={ZapIcon}
597 + icon={speedIcon === "ultrafast" ? UltrafastIcon : ZapIcon}
598 size={size}
599 className={cn(
600 "fill-current opacity-80",
@@ -598,7 +605,7 @@ export const TraitsPicker = memo(function TraitsPicker({
605 : "text-foreground",
606 )}
607 />
601 - <span className="sr-only">Fast mode on</span>
608 + <span className="sr-only">{speedLabel}</span>
609 </>
610 ) : null;
611