Auto-translate: add reset-to-default button for the prompt - #13672
Merged
Conversation
Both prompt editors - the auto-translate settings dialog and the llama.cpp advanced settings dialog - let you edit the prompt but gave no way back to the built-in text once it was changed. Add an icon button next to each "Prompt text" label that puts the default prompt back in the box. The 13-engine if/else chain in TranslateSettingsViewModel.LoadValues is collapsed into one GetPrompt(settings, engineType) helper, used for both the saved prompt and the built-in default, so the reset command and the loader cannot drift apart. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both prompt editors in auto-translate let you edit the prompt but gave no way back to the built-in text once it was changed. This adds a small ↺ icon button next to each Prompt text label:
LlamaCppAdvancedProtocol.DefaultPrompt(that box is normally empty, with the default only shown as placeholder text).Both buttons use
mdi-restoreand carry the accessible name / hint "Reset prompt to default" (newLanguageTranslate.ResetPromptToDefaultstring).The 13-engine if/else chain in
TranslateSettingsViewModel.LoadValuesis collapsed into oneGetPrompt(settings, engineType)helper, used for both the saved prompt and the built-in default — the reset command and the loader read the same mapping, so they cannot drift apart.Testing
New headless tests in
tests/UI/Features/TranslateSettingsResetPromptTests.cs:All 10 tests in the related filter pass.
🤖 Generated with Claude Code