mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: remove remaining readFileDeduplicationCacheMinutes references from UI
- Removed from ExperimentalSettings component props and UI - Removed unused imports from ExperimentalSettings - Removed from SettingsView component - Removed from ExtensionStateContext default state - Removed from ExtensionStateContext test file
This commit is contained in:
parent
c98889cebf
commit
935677a143
4 changed files with 2 additions and 52 deletions
|
|
@ -7,9 +7,8 @@ import { EXPERIMENT_IDS, experimentConfigsMap } from "@roo/experiments"
|
|||
|
||||
import { useAppTranslation } from "@src/i18n/TranslationContext"
|
||||
import { cn } from "@src/lib/utils"
|
||||
import { Input } from "@src/components/ui"
|
||||
|
||||
import { SetExperimentEnabled, SetCachedStateField } from "./types"
|
||||
import { SetExperimentEnabled } from "./types"
|
||||
import { SectionHeader } from "./SectionHeader"
|
||||
import { Section } from "./Section"
|
||||
import { ExperimentalFeature } from "./ExperimentalFeature"
|
||||
|
|
@ -17,15 +16,11 @@ import { ExperimentalFeature } from "./ExperimentalFeature"
|
|||
type ExperimentalSettingsProps = HTMLAttributes<HTMLDivElement> & {
|
||||
experiments: Experiments
|
||||
setExperimentEnabled: SetExperimentEnabled
|
||||
readFileDeduplicationCacheMinutes?: number
|
||||
setCachedStateField?: SetCachedStateField<"readFileDeduplicationCacheMinutes">
|
||||
}
|
||||
|
||||
export const ExperimentalSettings = ({
|
||||
experiments,
|
||||
setExperimentEnabled,
|
||||
readFileDeduplicationCacheMinutes,
|
||||
setCachedStateField,
|
||||
className,
|
||||
...props
|
||||
}: ExperimentalSettingsProps) => {
|
||||
|
|
@ -70,40 +65,6 @@ export const ExperimentalSettings = ({
|
|||
/>
|
||||
)
|
||||
})}
|
||||
|
||||
{/* Show cache time setting when READ_FILE_DEDUPLICATION is enabled */}
|
||||
{experiments[EXPERIMENT_IDS.READ_FILE_DEDUPLICATION] && (
|
||||
<div className="mt-4 pl-8">
|
||||
<div className="flex flex-col gap-2">
|
||||
<span className="font-medium text-sm">
|
||||
{t("settings:experimental.READ_FILE_DEDUPLICATION.cacheTimeLabel")}
|
||||
</span>
|
||||
<div className="flex items-center gap-4">
|
||||
<Input
|
||||
type="number"
|
||||
pattern="[0-9]*"
|
||||
className="w-24 bg-vscode-input-background text-vscode-input-foreground border border-vscode-input-border px-2 py-1 rounded text-right [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
|
||||
value={readFileDeduplicationCacheMinutes ?? 5}
|
||||
min={0}
|
||||
onChange={(e) => {
|
||||
const newValue = parseInt(e.target.value, 10)
|
||||
if (!isNaN(newValue) && newValue >= 0 && setCachedStateField) {
|
||||
setCachedStateField("readFileDeduplicationCacheMinutes", newValue)
|
||||
}
|
||||
}}
|
||||
onClick={(e) => e.currentTarget.select()}
|
||||
data-testid="read-file-deduplication-cache-minutes-input"
|
||||
/>
|
||||
<span className="text-sm">
|
||||
{t("settings:experimental.READ_FILE_DEDUPLICATION.minutes")}
|
||||
</span>
|
||||
</div>
|
||||
<div className="text-vscode-descriptionForeground text-xs mt-1">
|
||||
{t("settings:experimental.READ_FILE_DEDUPLICATION.cacheTimeDescription")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -337,10 +337,6 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
|
|||
vscode.postMessage({ type: "upsertApiConfiguration", text: currentApiConfigName, apiConfiguration })
|
||||
vscode.postMessage({ type: "telemetrySetting", text: telemetrySetting })
|
||||
vscode.postMessage({ type: "profileThresholds", values: profileThresholds })
|
||||
vscode.postMessage({
|
||||
type: "readFileDeduplicationCacheMinutes",
|
||||
value: cachedState.readFileDeduplicationCacheMinutes ?? 5,
|
||||
})
|
||||
setChangeDetected(false)
|
||||
}
|
||||
}
|
||||
|
|
@ -708,12 +704,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
|
|||
|
||||
{/* Experimental Section */}
|
||||
{activeTab === "experimental" && (
|
||||
<ExperimentalSettings
|
||||
setExperimentEnabled={setExperimentEnabled}
|
||||
experiments={experiments}
|
||||
readFileDeduplicationCacheMinutes={cachedState.readFileDeduplicationCacheMinutes}
|
||||
setCachedStateField={setCachedStateField}
|
||||
/>
|
||||
<ExperimentalSettings setExperimentEnabled={setExperimentEnabled} experiments={experiments} />
|
||||
)}
|
||||
|
||||
{/* Language Section */}
|
||||
|
|
|
|||
|
|
@ -236,7 +236,6 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
|
|||
alwaysAllowUpdateTodoList: true,
|
||||
includeDiagnosticMessages: true,
|
||||
maxDiagnosticMessages: 50,
|
||||
readFileDeduplicationCacheMinutes: 5, // Default to 5 minutes
|
||||
})
|
||||
|
||||
const [didHydrateState, setDidHydrateState] = useState(false)
|
||||
|
|
|
|||
|
|
@ -209,7 +209,6 @@ describe("mergeExtensionState", () => {
|
|||
sharingEnabled: false,
|
||||
profileThresholds: {},
|
||||
hasOpenedModeSelector: false, // Add the new required property
|
||||
readFileDeduplicationCacheMinutes: 5, // Add the new required property
|
||||
}
|
||||
|
||||
const prevState: ExtensionState = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue