-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Move diff editing config to provider settings #2655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| const { t } = useAppTranslation() | ||
|
|
||
| const handleDiffEnabledChange = useCallback( | ||
| (e: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider replacing the generic type for the event parameter with a more specific type (e.g., React.ChangeEvent<HTMLInputElement>) to improve type safety.
| (e: any) => { | |
| (e: React.ChangeEvent<HTMLInputElement>) => { |
| interface DiffSettingsControlProps { | ||
| diffEnabled?: boolean | ||
| fuzzyMatchThreshold?: number | ||
| onChange: (field: "diffEnabled" | "fuzzyMatchThreshold", value: any) => void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The onChange prop currently uses an any type for its value. Consider refining it so that when field is 'diffEnabled', value is a boolean, and when field is 'fuzzyMatchThreshold', value is a number. This would improve type-safety.
|
Context
Similar to #2376, I think diff editing settings should be per-profile as the ability to use diffs varies widely from model to model. So I moved the diff enabled flag and the fuzzy match config into the provider settings and removed the now empty Advanced settings.
Important
Move diff editing settings to provider-specific configurations and update UI components accordingly.
diffEnabledandfuzzyMatchThresholdsettings to provider-specific configurations inProviderSettingsManager.ts.AdvancedSettings.tsxand integrate diff settings intoApiOptions.tsxandDiffSettingsControl.tsx.migrateDiffSettings()inProviderSettingsManager.tsto migrate existing global settings to provider-specific settings.initialize()inProviderSettingsManager.tsto handle new migration.DiffSettingsControltoApiOptions.tsxfor managing diff settings per provider.AdvancedSettingssection fromSettingsView.tsx.ProviderSettingsManager.test.tsto test migration and initialization of diff settings.DiffSettingsControlinApiOptions.test.tsx.This description was created by
for bcc7e8d. It will automatically update as commits are pushed.