Show Claude Code in provider picker and add Cursor placeholder
- Include Claude Code in available provider options in the picker - Add Cursor as a disabled placeholder provider with icon mapping - Update session-logic tests to assert provider availability and ordering
This commit is contained in:
1 parent
e0facb03bd
commit
d2b00e6550
3 files changed
+14
-8
No files matched your search
@@ -17,7 +17,7 @@ import {
|
||||
MenuSubTrigger,
|
||||
MenuTrigger,
|
||||
} from "../ui/menu";
|
||||
import { ClaudeAI, Gemini, Icon, OpenAI, OpenCodeIcon } from "../Icons";
|
||||
import { ClaudeAI, CursorIcon, Gemini, Icon, OpenAI, OpenCodeIcon } from "../Icons";
|
||||
import { cn } from "~/lib/utils";
|
||||
|
||||
function isAvailableProviderOption(option: (typeof PROVIDER_OPTIONS)[number]): option is {
|
||||
@@ -25,7 +25,7 @@ function isAvailableProviderOption(option: (typeof PROVIDER_OPTIONS)[number]): o
|
||||
label: string;
|
||||
available: true;
|
||||
} {
|
||||
return option.available && option.value !== "claudeCode";
|
||||
return option.available;
|
||||
}
|
||||
|
||||
function resolveModelForProviderPicker(
|
||||
@@ -64,6 +64,7 @@ function resolveModelForProviderPicker(
|
||||
const PROVIDER_ICON_BY_PROVIDER: Record<ProviderPickerKind, Icon> = {
|
||||
codex: OpenAI,
|
||||
claudeCode: ClaudeAI,
|
||||
cursor: CursorIcon,
|
||||
};
|
||||
|
||||
export const AVAILABLE_PROVIDER_OPTIONS = PROVIDER_OPTIONS.filter(isAvailableProviderOption);
|
||||
@@ -174,10 +175,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
|
||||
<MenuItem key={option.value} disabled>
|
||||
<OptionIcon
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
"size-4 shrink-0 opacity-80",
|
||||
option.value === "claudeCode" ? "" : "text-muted-foreground/85",
|
||||
)}
|
||||
className="size-4 shrink-0 text-muted-foreground/85 opacity-80"
|
||||
/>
|
||||
<span>{option.label}</span>
|
||||
<span className="ms-auto text-[11px] text-muted-foreground/80 uppercase tracking-[0.08em]">
|
||||
|
||||
@@ -673,16 +673,23 @@ describe("deriveActiveWorkStartedAt", () => {
|
||||
});
|
||||
|
||||
describe("PROVIDER_OPTIONS", () => {
|
||||
it("advertises the supported providers", () => {
|
||||
it("advertises Claude Code as available while keeping Cursor as a placeholder", () => {
|
||||
const claude = PROVIDER_OPTIONS.find((option) => option.value === "claudeCode");
|
||||
const cursor = PROVIDER_OPTIONS.find((option) => option.value === "cursor");
|
||||
expect(PROVIDER_OPTIONS).toEqual([
|
||||
{ value: "codex", label: "Codex", available: true },
|
||||
{ value: "claudeCode", label: "Claude Code", available: true },
|
||||
{ value: "cursor", label: "Cursor", available: false },
|
||||
]);
|
||||
expect(claude).toEqual({
|
||||
value: "claudeCode",
|
||||
label: "Claude Code",
|
||||
available: true,
|
||||
});
|
||||
expect(cursor).toEqual({
|
||||
value: "cursor",
|
||||
label: "Cursor",
|
||||
available: false,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -18,7 +18,7 @@ import type {
|
||||
TurnDiffSummary,
|
||||
} from "./types";
|
||||
|
||||
export type ProviderPickerKind = ProviderKind;
|
||||
export type ProviderPickerKind = ProviderKind | "cursor";
|
||||
|
||||
export const PROVIDER_OPTIONS: Array<{
|
||||
value: ProviderPickerKind;
|
||||
@@ -27,6 +27,7 @@ export const PROVIDER_OPTIONS: Array<{
|
||||
}> = [
|
||||
{ value: "codex", label: "Codex", available: true },
|
||||
{ value: "claudeCode", label: "Claude Code", available: true },
|
||||
{ value: "cursor", label: "Cursor", available: false },
|
||||
];
|
||||
|
||||
export interface WorkLogEntry {
|
||||
|
||||
Reference in new issue
Block a user