mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
refactor: remove redundant experimentConfigs array, use experimentConfigsMap directly
This commit is contained in:
@@ -40,13 +40,7 @@ import { singleCompletionHandler } from "../../utils/single-completion-handler"
|
||||
import { getCommitInfo, searchCommits, getWorkingState } from "../../utils/git"
|
||||
import { ConfigManager } from "../config/ConfigManager"
|
||||
import { CustomModesManager } from "../config/CustomModesManager"
|
||||
import {
|
||||
EXPERIMENT_IDS,
|
||||
experimentConfigs,
|
||||
experiments as Experiments,
|
||||
experimentDefault,
|
||||
ExperimentId,
|
||||
} from "../../shared/experiments"
|
||||
import { EXPERIMENT_IDS, experiments as Experiments, experimentDefault, ExperimentId } from "../../shared/experiments"
|
||||
import { CustomSupportPrompts, supportPrompt } from "../../shared/support-prompt"
|
||||
|
||||
import { ACTION_NAMES } from "../CodeActionProvider"
|
||||
|
||||
@@ -41,8 +41,6 @@ export const experimentConfigsMap: Record<ExperimentKey, ExperimentConfig> = {
|
||||
},
|
||||
}
|
||||
|
||||
// Keep the array version for backward compatibility
|
||||
export const experimentConfigs = Object.values(experimentConfigsMap)
|
||||
export const experimentDefault = Object.fromEntries(
|
||||
Object.entries(experimentConfigsMap).map(([_, config]) => [config.id, config.enabled]),
|
||||
) as Record<ExperimentId, boolean>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { validateApiConfiguration, validateModelId } from "../../utils/validate"
|
||||
import { vscode } from "../../utils/vscode"
|
||||
import ApiOptions from "./ApiOptions"
|
||||
import ExperimentalFeature from "./ExperimentalFeature"
|
||||
import { experimentConfigs, EXPERIMENT_IDS, experimentConfigsMap } from "../../../../src/shared/experiments"
|
||||
import { EXPERIMENT_IDS, experimentConfigsMap } from "../../../../src/shared/experiments"
|
||||
import ApiConfigManager from "./ApiConfigManager"
|
||||
|
||||
type SettingsViewProps = {
|
||||
@@ -646,7 +646,7 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
{experimentConfigs
|
||||
{Object.values(experimentConfigsMap)
|
||||
.filter((config) => config.id !== EXPERIMENT_IDS.DIFF_STRATEGY)
|
||||
.map((config) => (
|
||||
<ExperimentalFeature
|
||||
|
||||
Reference in New Issue
Block a user