diff --git a/webview-ui/src/components/settings/ExperimentalSettings.tsx b/webview-ui/src/components/settings/ExperimentalSettings.tsx index ea59ab89f8..9bdae6cfa7 100644 --- a/webview-ui/src/components/settings/ExperimentalSettings.tsx +++ b/webview-ui/src/components/settings/ExperimentalSettings.tsx @@ -17,11 +17,13 @@ import { RulesSettings } from "./RulesSettings" type ExperimentalSettingsProps = HTMLAttributes & { experiments: Experiments setExperimentEnabled: SetExperimentEnabled + hasUnsavedChanges?: boolean } export const ExperimentalSettings = ({ experiments, setExperimentEnabled, + hasUnsavedChanges, className, ...props }: ExperimentalSettingsProps) => { @@ -68,7 +70,7 @@ export const ExperimentalSettings = ({ })} - + ) } diff --git a/webview-ui/src/components/settings/RulesSettings.tsx b/webview-ui/src/components/settings/RulesSettings.tsx index 95e5e928ad..c4d61ca704 100644 --- a/webview-ui/src/components/settings/RulesSettings.tsx +++ b/webview-ui/src/components/settings/RulesSettings.tsx @@ -5,12 +5,14 @@ import { Button } from "@/components/ui/button" import { vscode } from "@/utils/vscode" import { cn } from "@/lib/utils" import { useExtensionState } from "@/context/ExtensionStateContext" -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui" +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, StandardTooltip } from "@/components/ui" import { SectionHeader } from "./SectionHeader" import { Section } from "./Section" -type RulesSettingsProps = HTMLAttributes +type RulesSettingsProps = HTMLAttributes & { + hasUnsavedChanges?: boolean +} interface RuleType { id: string @@ -20,7 +22,7 @@ interface RuleType { exists?: boolean } -export const RulesSettings = ({ className, ...props }: RulesSettingsProps) => { +export const RulesSettings = ({ className, hasUnsavedChanges, ...props }: RulesSettingsProps) => { const { t } = useAppTranslation() const [isGenerating, setIsGenerating] = useState(false) const [generationStatus, setGenerationStatus] = useState<{ @@ -287,25 +289,33 @@ export const RulesSettings = ({ className, ...props }: RulesSettingsProps) => { - + + + + + {isGenerating && ( @@ -316,8 +326,7 @@ export const RulesSettings = ({ className, ...props }: RulesSettingsProps) => { {generationStatus.type === "success" && (
-

{t("settings:rules.taskCreated")}

-

{generationStatus.message}

+

{generationStatus.message || t("settings:rules.taskCreated")}

)} diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index cf9e779cbd..8314787aae 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -689,7 +689,11 @@ const SettingsView = forwardRef(({ onDone, t {/* Experimental Section */} {activeTab === "experimental" && ( - + )} {/* Language Section */} diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index be21a3ff3a..b9848a867a 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -626,6 +626,7 @@ "noWorkspaceDescription": "Please open a workspace folder to generate rules for your project.", "selectTypes": "Select rule types to generate:", "noRulesSelected": "Please select at least one rule type to generate", + "unsavedChangesError": "Please save your settings before generating rules", "types": { "general": { "label": "General Rules",