mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 17:30:31 +00:00
Remove default from composer effort picker
This commit is contained in:
parent
2ef0776e54
commit
eaa7f55c4a
6 changed files with 8 additions and 36 deletions
|
|
@ -44,7 +44,6 @@ export interface RuntimeComposerChoicesInput {
|
|||
snapshot: RuntimeSnapshot;
|
||||
requestModel: (model: string) => void;
|
||||
requestReasoningEffort: (effort: ReasoningEffort) => void;
|
||||
resetReasoningEffortToConfig: () => void;
|
||||
}
|
||||
|
||||
export function composerPlaceholder(threadName: string | null): string {
|
||||
|
|
@ -76,7 +75,6 @@ export function chatPanelComposerProjection(
|
|||
snapshot,
|
||||
requestModel: (model) => void surface.runtime.requestModel(model),
|
||||
requestReasoningEffort: (effort) => void surface.runtime.requestReasoningEffort(effort),
|
||||
resetReasoningEffortToConfig: () => void surface.runtime.resetReasoningEffortToConfig(),
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
|
@ -150,22 +148,13 @@ export function runtimeComposerChoices(input: RuntimeComposerChoicesInput): {
|
|||
}
|
||||
|
||||
const activeEffort = currentReasoningEffort(input.snapshot, config);
|
||||
const effortChoices: ChatPanelComposerRuntimeChoice[] = [
|
||||
{
|
||||
label: "Codex default",
|
||||
selected: activeEffort === null,
|
||||
onClick: () => {
|
||||
input.resetReasoningEffortToConfig();
|
||||
},
|
||||
const effortChoices: ChatPanelComposerRuntimeChoice[] = supportedReasoningEfforts(input.snapshot, config).map((effort) => ({
|
||||
label: effort,
|
||||
selected: activeEffort === effort,
|
||||
onClick: () => {
|
||||
input.requestReasoningEffort(effort);
|
||||
},
|
||||
...supportedReasoningEfforts(input.snapshot, config).map((effort) => ({
|
||||
label: effort,
|
||||
selected: activeEffort === effort,
|
||||
onClick: () => {
|
||||
input.requestReasoningEffort(effort);
|
||||
},
|
||||
})),
|
||||
];
|
||||
}));
|
||||
|
||||
return { modelChoices, effortChoices };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ export function createChatPanelSurface(host: ChatPanelSurfaceHost, deps: ChatPan
|
|||
runtime: {
|
||||
requestModel: (model) => deps.runtimeSettings.requestModelFromUi(model),
|
||||
requestReasoningEffort: (effort) => deps.runtimeSettings.requestReasoningEffortFromUi(effort),
|
||||
resetReasoningEffortToConfig: () => deps.runtimeSettings.resetReasoningEffortToConfigFromUi(),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ export interface ChatPanelComposerSurface {
|
|||
runtime: {
|
||||
requestModel: (model: string) => Promise<void>;
|
||||
requestReasoningEffort: (effort: ReasoningEffort) => Promise<void>;
|
||||
resetReasoningEffortToConfig: () => Promise<void>;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -450,7 +450,6 @@ function surfaceFixture(options: { toolbarConnected?: () => boolean } = {}): Cha
|
|||
runtime: {
|
||||
requestModel: async () => undefined,
|
||||
requestReasoningEffort: async () => undefined,
|
||||
resetReasoningEffortToConfig: async () => undefined,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -225,7 +225,6 @@ describe("chat panel surface projections", () => {
|
|||
state.connection.availableModels = [modelFixture("gpt-5.5"), modelFixture("gpt-5-mini")];
|
||||
const selectedModels: string[] = [];
|
||||
const selectedEfforts: string[] = [];
|
||||
let resetEffortCount = 0;
|
||||
|
||||
const choices = runtimeComposerChoices({
|
||||
state,
|
||||
|
|
@ -236,25 +235,17 @@ describe("chat panel surface projections", () => {
|
|||
requestReasoningEffort: (effort) => {
|
||||
selectedEfforts.push(effort);
|
||||
},
|
||||
resetReasoningEffortToConfig: () => {
|
||||
resetEffortCount += 1;
|
||||
},
|
||||
});
|
||||
|
||||
expect(choices.modelChoices).toMatchObject([
|
||||
{ label: "gpt-5-mini", selected: false },
|
||||
{ label: "gpt-5.5", selected: true },
|
||||
]);
|
||||
expect(choices.effortChoices).toMatchObject([
|
||||
{ label: "Codex default", selected: false },
|
||||
{ label: "high", selected: true },
|
||||
]);
|
||||
expect(choices.effortChoices).toMatchObject([{ label: "high", selected: true }]);
|
||||
|
||||
choices.modelChoices[0]?.onClick();
|
||||
choices.effortChoices[0]?.onClick();
|
||||
choices.effortChoices[1]?.onClick();
|
||||
expect(selectedModels).toEqual(["gpt-5-mini"]);
|
||||
expect(resetEffortCount).toBe(1);
|
||||
expect(selectedEfforts).toEqual(["high"]);
|
||||
});
|
||||
|
||||
|
|
@ -311,10 +302,7 @@ describe("chat panel surface projections", () => {
|
|||
model: "gpt-5.5",
|
||||
effort: "high",
|
||||
modelChoices: [{ label: "gpt-5.5", selected: true }],
|
||||
effortChoices: [
|
||||
{ label: "Codex default", selected: false },
|
||||
{ label: "high", selected: true },
|
||||
],
|
||||
effortChoices: [{ label: "high", selected: true }],
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
@ -365,7 +353,6 @@ function composerSurfaceFixture(overrides: Partial<ChatPanelComposerSurface> = {
|
|||
runtime: {
|
||||
requestModel: async () => undefined,
|
||||
requestReasoningEffort: async () => undefined,
|
||||
resetReasoningEffortToConfig: async () => undefined,
|
||||
...overrides.runtime,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -168,7 +168,6 @@ function surfaceFixture(store: ReturnType<typeof createChatStateStore>, toolbarA
|
|||
runtime: {
|
||||
requestModel: async () => undefined,
|
||||
requestReasoningEffort: async () => undefined,
|
||||
resetReasoningEffortToConfig: async () => undefined,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue