| author | |
| committer | |
| log | 4a42fc62e15018973b0088667d037b2a35c4c261 |
| tree | 4764476f425ec4e9f4e22557860229fa74765f0e |
| parent | 126ea5c3bcf888df4a918438ae7d68a4a4a905f2 |
| signature | Signed by PGP key B5690EEEBB952194 |
5 files changed, 4 insertions(+), 150 deletions(-)
apps/web/src/components/color-selector.tsx deleted-101| ... | ... | @@ -1,101 +0,0 @@ |
| 1 | "use client"; | |
| 2 | ||
| 3 | import { useState } from "react"; | |
| 4 | import { cn } from "~/lib/utils"; | |
| 5 | ||
| 6 | interface ColorSelectorProps { | |
| 7 | colors: string[]; | |
| 8 | size?: "default" | "sm" | "lg"; | |
| 9 | defaultValue: string; | |
| 10 | name?: string; | |
| 11 | onColorSelect?: (color: string) => void; | |
| 12 | className?: string; | |
| 13 | } | |
| 14 | ||
| 15 | const colorMap = { | |
| 16 | default: "var(--contrast-foreground)", | |
| 17 | red: "var(--color-red-500)", | |
| 18 | green: "var(--color-green-500)", | |
| 19 | blue: "var(--color-blue-500)", | |
| 20 | yellow: "var(--color-yellow-500)", | |
| 21 | purple: "var(--color-purple-500)", | |
| 22 | pink: "var(--color-pink-500)", | |
| 23 | indigo: "var(--color-indigo-500)", | |
| 24 | orange: "var(--color-orange-500)", | |
| 25 | teal: "var(--color-teal-500)", | |
| 26 | cyan: "var(--color-cyan-500)", | |
| 27 | lime: "var(--color-lime-500)", | |
| 28 | emerald: "var(--color-emerald-500)", | |
| 29 | violet: "var(--color-violet-500)", | |
| 30 | fuchsia: "var(--color-fuchsia-500)", | |
| 31 | rose: "var(--color-rose-500)", | |
| 32 | sky: "var(--color-sky-500)", | |
| 33 | amber: "var(--color-amber-500)", | |
| 34 | } as const; | |
| 35 | ||
| 36 | function getSizeClass(size: "default" | "sm" | "lg") { | |
| 37 | switch (size) { | |
| 38 | case "sm": | |
| 39 | return "size-4"; | |
| 40 | case "default": | |
| 41 | return "size-5"; | |
| 42 | case "lg": | |
| 43 | return "size-6"; | |
| 44 | default: | |
| 45 | return "size-5"; | |
| 46 | } | |
| 47 | } | |
| 48 | ||
| 49 | function getColorValue(color: string): string { | |
| 50 | return colorMap[color as keyof typeof colorMap] || color; | |
| 51 | } | |
| 52 | ||
| 53 | export function ColorSelector({ | |
| 54 | colors, | |
| 55 | size = "default", | |
| 56 | defaultValue, | |
| 57 | name, | |
| 58 | onColorSelect, | |
| 59 | className, | |
| 60 | }: ColorSelectorProps) { | |
| 61 | const [selectedColor, setSelectedColor] = useState<string>(defaultValue); | |
| 62 | ||
| 63 | const handleColorSelect = (color: string) => { | |
| 64 | setSelectedColor(color); | |
| 65 | onColorSelect?.(color); | |
| 66 | }; | |
| 67 | ||
| 68 | const sizeClass = getSizeClass(size); | |
| 69 | ||
| 70 | return ( | |
| 71 | <div className={cn("flex gap-2", className)}> | |
| 72 | {name && <input type="hidden" name={name} value={selectedColor} />} | |
| 73 | {colors.map((color) => { | |
| 74 | const colorValue = getColorValue(color); | |
| 75 | return ( | |
| 76 | <div | |
| 77 | key={color} | |
| 78 | className={`${sizeClass} cursor-pointer rounded-full transition-transform duration-200 active:scale-90`} | |
| 79 | style={{ | |
| 80 | backgroundColor: colorValue, | |
| 81 | ...(selectedColor === color && { | |
| 82 | boxShadow: `inset 0 0 0 2px var(--card), 0 0 0 2px ${colorValue}`, | |
| 83 | }), | |
| 84 | }} | |
| 85 | onClick={() => handleColorSelect(color)} | |
| 86 | onKeyDown={(e) => { | |
| 87 | if (e.key === "Enter" || e.key === " ") { | |
| 88 | e.preventDefault(); | |
| 89 | handleColorSelect(color); | |
| 90 | } | |
| 91 | }} | |
| 92 | tabIndex={0} | |
| 93 | role="button" | |
| 94 | aria-label={`Select ${color} color`} | |
| 95 | aria-pressed={selectedColor === color} | |
| 96 | /> | |
| 97 | ); | |
| 98 | })} | |
| 99 | </div> | |
| 100 | ); | |
| 101 | } |
apps/web/src/modelSelection.ts+2-2| ... | ... | @@ -153,7 +153,7 @@ function applyInstanceModelPreferences( |
| 153 | 153 | ); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | export function normalizeCustomModelEntries( | |
| 156 | function normalizeCustomModelEntries( | |
| 157 | 157 | models: ReadonlyArray<CustomModelDefinition>, |
| 158 | 158 | builtInModelSlugs: ReadonlySet<string>, |
| 159 | 159 | ): CustomModelDefinition[] { |
| ... | ... | @@ -179,7 +179,7 @@ export function normalizeCustomModelEntries( |
| 179 | 179 | return normalizedModels; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | export function getAppModelOptions( | |
| 182 | function getAppModelOptions( | |
| 183 | 183 | settings: UnifiedSettings, |
| 184 | 184 | providers: ReadonlyArray<ServerProvider>, |
| 185 | 185 | provider: ProviderDriverKind, |
apps/web/src/providerInstances.ts+1-1| ... | ... | @@ -298,7 +298,7 @@ export function sortProviderInstanceEntries( |
| 298 | 298 | * Look up a single instance entry by exact `instanceId`. Missing snapshots |
| 299 | 299 | * are not inferred from driver kind in UI routing code. |
| 300 | 300 | */ |
| 301 | export function getProviderInstanceEntry( | |
| 301 | function getProviderInstanceEntry( | |
| 302 | 302 | providers: ReadonlyArray<ServerProvider>, |
| 303 | 303 | instanceId: ProviderInstanceId, |
| 304 | 304 | ): ProviderInstanceEntry | undefined { |
apps/web/src/providerModels.ts+1-8| ... | ... | @@ -30,7 +30,7 @@ export function getProviderModels( |
| 30 | 30 | return getProviderSnapshot(providers, provider)?.models ?? []; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | export function getProviderSnapshot( | |
| 33 | function getProviderSnapshot( | |
| 34 | 34 | providers: ReadonlyArray<ServerProvider>, |
| 35 | 35 | provider: ProviderDriverKind, |
| 36 | 36 | ): ServerProvider | undefined { |
| ... | ... | @@ -38,13 +38,6 @@ export function getProviderSnapshot( |
| 38 | 38 | return providers.find((candidate) => candidate.instanceId === defaultInstanceId); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | export function getProviderInteractionModeToggle( | |
| 42 | providers: ReadonlyArray<ServerProvider>, | |
| 43 | provider: ProviderDriverKind, | |
| 44 | ): boolean { | |
| 45 | return getProviderSnapshot(providers, provider)?.showInteractionModeToggle ?? true; | |
| 46 | } | |
| 47 | ||
| 48 | 41 | // Resolve an instance selection to the correlated live driver. If the |
| 49 | 42 | // instance is absent, fall back to a live enabled provider instead of |
| 50 | 43 | // inferring a driver from the missing instance id. |
apps/web/src/session-logic.ts-38| ... | ... | @@ -16,7 +16,6 @@ import { |
| 16 | 16 | type OrchestrationLatestTurn, |
| 17 | 17 | type OrchestrationThreadActivity, |
| 18 | 18 | type OrchestrationProposedPlanId, |
| 19 | ProviderDriverKind, | |
| 20 | 19 | ProviderApprovalOption, |
| 21 | 20 | ProviderRequestKind, |
| 22 | 21 | type ToolLifecycleItemType, |
| ... | ... | @@ -38,43 +37,6 @@ import { |
| 38 | 37 | |
| 39 | 38 | export { formatDuration, formatElapsed } from "@t3tools/shared/orchestrationTiming"; |
| 40 | 39 | |
| 41 | export type ProviderPickerKind = ProviderDriverKind; | |
| 42 | ||
| 43 | export const PROVIDER_OPTIONS: Array<{ | |
| 44 | value: ProviderPickerKind; | |
| 45 | label: string; | |
| 46 | available: boolean; | |
| 47 | /** Shown on the model picker sidebar when relevant */ | |
| 48 | pickerSidebarBadge?: "new" | "soon"; | |
| 49 | }> = [ | |
| 50 | { value: ProviderDriverKind.make("codex"), label: "Codex", available: true }, | |
| 51 | { value: ProviderDriverKind.make("claudeAgent"), label: "Claude", available: true }, | |
| 52 | { | |
| 53 | value: ProviderDriverKind.make("opencode"), | |
| 54 | label: "OpenCode", | |
| 55 | available: true, | |
| 56 | pickerSidebarBadge: "new", | |
| 57 | }, | |
| 58 | { | |
| 59 | value: ProviderDriverKind.make("cursor"), | |
| 60 | label: "Cursor", | |
| 61 | available: true, | |
| 62 | pickerSidebarBadge: "new", | |
| 63 | }, | |
| 64 | { | |
| 65 | value: ProviderDriverKind.make("grok"), | |
| 66 | label: "Grok", | |
| 67 | available: true, | |
| 68 | pickerSidebarBadge: "new", | |
| 69 | }, | |
| 70 | { | |
| 71 | value: ProviderDriverKind.make("antigravity"), | |
| 72 | label: "Antigravity", | |
| 73 | available: true, | |
| 74 | pickerSidebarBadge: "new", | |
| 75 | }, | |
| 76 | ]; | |
| 77 | ||
| 78 | 40 | export type WorkLogToolLifecycleStatus = |
| 79 | 41 | | "inProgress" |
| 80 | 42 | | "completed" |