mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: persist condensing API configuration in Context Management settings
- Added condensingApiConfigId dropdown to ContextManagementSettings component - Dropdown is now visible regardless of auto-condense checkbox state - Updated SettingsView to pass condensingApiConfigId prop - Fixed test expectations to account for new dropdown element Fixes #8871
This commit is contained in:
parent
3cbdbc2af6
commit
bcbcd20574
3 changed files with 42 additions and 4 deletions
|
|
@ -24,6 +24,7 @@ type ContextManagementSettingsProps = HTMLAttributes<HTMLDivElement> & {
|
|||
maxTotalImageSize?: number
|
||||
maxConcurrentFileReads?: number
|
||||
profileThresholds?: Record<string, number>
|
||||
condensingApiConfigId?: string
|
||||
includeDiagnosticMessages?: boolean
|
||||
maxDiagnosticMessages?: number
|
||||
writeDelayMs: number
|
||||
|
|
@ -40,6 +41,7 @@ type ContextManagementSettingsProps = HTMLAttributes<HTMLDivElement> & {
|
|||
| "maxTotalImageSize"
|
||||
| "maxConcurrentFileReads"
|
||||
| "profileThresholds"
|
||||
| "condensingApiConfigId"
|
||||
| "includeDiagnosticMessages"
|
||||
| "maxDiagnosticMessages"
|
||||
| "writeDelayMs"
|
||||
|
|
@ -61,6 +63,7 @@ export const ContextManagementSettings = ({
|
|||
maxTotalImageSize,
|
||||
maxConcurrentFileReads,
|
||||
profileThresholds = {},
|
||||
condensingApiConfigId,
|
||||
includeDiagnosticMessages,
|
||||
maxDiagnosticMessages,
|
||||
writeDelayMs,
|
||||
|
|
@ -398,6 +401,40 @@ export const ContextManagementSettings = ({
|
|||
data-testid="auto-condense-context-checkbox">
|
||||
<span className="font-medium">{t("settings:contextManagement.autoCondenseContext.name")}</span>
|
||||
</VSCodeCheckbox>
|
||||
|
||||
{/* API Configuration dropdown - shown regardless of auto-condense state */}
|
||||
<div className="mt-4">
|
||||
<label className="block font-medium mb-1">
|
||||
{t("prompts:supportPrompts.condense.apiConfiguration")}
|
||||
</label>
|
||||
<Select
|
||||
value={condensingApiConfigId || "-"}
|
||||
onValueChange={(value) => {
|
||||
const newConfigId = value === "-" ? "" : value
|
||||
setCachedStateField("condensingApiConfigId", newConfigId)
|
||||
vscode.postMessage({
|
||||
type: "condensingApiConfigId",
|
||||
text: newConfigId,
|
||||
})
|
||||
}}
|
||||
data-testid="condensing-api-config-select">
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue placeholder={t("prompts:supportPrompts.condense.useCurrentConfig")} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="-">{t("prompts:supportPrompts.condense.useCurrentConfig")}</SelectItem>
|
||||
{(listApiConfigMeta || []).map((config) => (
|
||||
<SelectItem key={config.id} value={config.id}>
|
||||
{config.name}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<div className="text-sm text-vscode-descriptionForeground mt-1">
|
||||
{t("prompts:supportPrompts.condense.apiConfigDescription")}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{autoCondenseContext && (
|
||||
<div className="flex flex-col gap-3 pl-3 border-l-2 border-vscode-button-background">
|
||||
<div className="flex items-center gap-4 font-bold">
|
||||
|
|
|
|||
|
|
@ -748,6 +748,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
|
|||
maxTotalImageSize={maxTotalImageSize}
|
||||
maxConcurrentFileReads={maxConcurrentFileReads}
|
||||
profileThresholds={profileThresholds}
|
||||
condensingApiConfigId={condensingApiConfigId}
|
||||
includeDiagnosticMessages={includeDiagnosticMessages}
|
||||
maxDiagnosticMessages={maxDiagnosticMessages}
|
||||
writeDelayMs={writeDelayMs}
|
||||
|
|
|
|||
|
|
@ -377,9 +377,9 @@ describe("ContextManagementSettings", () => {
|
|||
const slider = screen.getByTestId("condense-threshold-slider")
|
||||
expect(slider).toBeInTheDocument()
|
||||
|
||||
// Should render the profile select dropdown
|
||||
// Should render the profile select dropdown and condensing API config dropdown
|
||||
const selects = screen.getAllByRole("combobox")
|
||||
expect(selects).toHaveLength(1)
|
||||
expect(selects).toHaveLength(2)
|
||||
})
|
||||
|
||||
describe("Auto Condense Context functionality", () => {
|
||||
|
|
@ -412,8 +412,8 @@ describe("ContextManagementSettings", () => {
|
|||
|
||||
// Threshold settings should be visible
|
||||
expect(screen.getByTestId("condense-threshold-slider")).toBeInTheDocument()
|
||||
// One combobox for profile selection
|
||||
expect(screen.getAllByRole("combobox")).toHaveLength(1)
|
||||
// Two comboboxes: one for profile selection and one for condensing API config
|
||||
expect(screen.getAllByRole("combobox")).toHaveLength(2)
|
||||
})
|
||||
|
||||
it("updates auto condense context percent", () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue