Skip to content

Auto-translate: add reset-to-default button for the prompt - #13672

Merged
niksedk merged 1 commit into
mainfrom
claude/auto-translate-prompt-reset-b992cd
Aug 15, 2026
Merged

Auto-translate: add reset-to-default button for the prompt#13672
niksedk merged 1 commit into
mainfrom
claude/auto-translate-prompt-reset-b992cd

Conversation

@niksedk

@niksedk niksedk commented Aug 15, 2026

Copy link
Copy Markdown
Member

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:

  • Auto-translate → settings (cog) — restores the built-in prompt of the currently selected engine (ChatGPT, Anthropic, Gemini, Ollama, llama.cpp, …).
  • Auto-translate → llama.cpp → Advanced… — fills the box with LlamaCppAdvancedProtocol.DefaultPrompt (that box is normally empty, with the default only shown as placeholder text).

Both buttons use mdi-restore and carry the accessible name / hint "Reset prompt to default" (new LanguageTranslate.ResetPromptToDefault string).

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 — 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:

  • the button reaches the logical tree and is visible for an engine with a prompt,
  • it is hidden for an engine without one (the whole prompt row hides),
  • the command replaces a customized prompt with the built-in default.

All 10 tests in the related filter pass.

🤖 Generated with Claude Code

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>
@niksedk
niksedk merged commit a19a709 into main Aug 15, 2026
1 check passed
@niksedk
niksedk deleted the claude/auto-translate-prompt-reset-b992cd branch August 15, 2026 17:29
@niksedk niksedk mentioned this pull request Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant