Skip to content

Add engine update button to auto-translate window#11289

Merged
niksedk merged 1 commit into
mainfrom
feature/auto-translate-engine-update-button
May 31, 2026
Merged

Add engine update button to auto-translate window#11289
niksedk merged 1 commit into
mainfrom
feature/auto-translate-engine-update-button

Conversation

@niksedk
Copy link
Copy Markdown
Member

@niksedk niksedk commented May 31, 2026

Summary

The auto-translate engine combo shows an amber "update available" status dot for SE-managed engines (CrispASR/MADLAD and llama.cpp) when the installed binary is outdated — but there was previously no way to act on it. CrispASR had no engine-update path at all (DownloadAsync only fetched the binary when it was missing), and llama.cpp only offered a one-time Yes/No prompt when the engine was selected.

This adds an "Update" button right after the engine combobox that appears only when the selected engine is installed but outdated, and re-downloads the engine binary.

Changes

  • CrispAsrTranslateDownloadHelperIsEngineUpdateAvailable() (mirrors the amber dot via DownloadHashManager.GetSidecarStatus) and UpdateEngineAsync() which force-redownloads just the engine binary, leaving MADLAD models untouched.
  • AutoTranslateViewModel — generalized UpdateEngine command + RefreshEngineUpdateButton() covering both engines; extracted GetLlamaCppEngineUpdate() / UpdateLlamaCppEngineAsync() so the new button and the existing llama.cpp on-select prompt share a single code path (no behavior change to that prompt).
  • AutoTranslateWindow — "Update" button (download icon, "Update available" tooltip) bound to EngineUpdateButtonIsVisible, placed after the engine combobox.

The button stays hidden for cloud/API translators (Google, DeepL, ChatGPT, …) and for engines that are not installed.

Verification

  • Builds clean (0 warnings/errors).
  • Ran the app and opened the auto-translate window: with CrispASR/MADLAD installed and up to date (green dot), the Update button is correctly hidden — confirming the visibility gating. The amber/button-visible path was confirmed manually.

Uses existing translated strings General.Update / General.UpdateAvailable — no new language keys.

🤖 Generated with Claude Code

The auto-translate engine combo shows an amber "update available" dot for
SE-managed engines (CrispASR/MADLAD and llama.cpp) when the installed binary
is outdated, but there was no way to act on it: CrispASR had no update path at
all, and llama.cpp only offered a one-time prompt on engine selection.

Add an "Update" button after the engine combobox that appears only when the
selected engine is installed but outdated, and re-downloads the engine binary:
- CrispAsrTranslateDownloadHelper: IsEngineUpdateAvailable() + UpdateEngineAsync()
  that force-redownloads just the engine binary (models left untouched).
- AutoTranslateViewModel: generalized UpdateEngine command + RefreshEngineUpdateButton
  covering both engines; extracted GetLlamaCppEngineUpdate()/UpdateLlamaCppEngineAsync()
  so the button and the existing llama.cpp prompt share one code path.
- AutoTranslateWindow: update button bound to EngineUpdateButtonIsVisible.

Hidden for cloud/API translators and for engines that are not installed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an "Update" button next to the auto-translate engine combobox that re-downloads the engine binary when an update is available for SE-managed engines (CrispASR/MADLAD, llama.cpp). The button mirrors the amber status dot already shown in the combo and is hidden for cloud/API translators or up-to-date engines.

Changes:

  • New CrispAsrTranslateDownloadHelper.IsEngineUpdateAvailable() and UpdateEngineAsync() (CrispASR engine-only force redownload, models untouched).
  • AutoTranslateViewModel: new UpdateEngine command, EngineUpdateButtonIsVisible flag and RefreshEngineUpdateButton(); refactored llama.cpp update path into shared GetLlamaCppEngineUpdate() / UpdateLlamaCppEngineAsync() used by both the new button and the existing on-select prompt.
  • AutoTranslateWindow: new "Update" button (download icon, "Update available" tooltip) bound to EngineUpdateButtonIsVisible, placed after the engine combo.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/ui/Features/Translate/CrispAsrTranslateDownloadHelper.cs Adds engine-update detection and engine-only force-redownload helpers for CrispASR/MADLAD.
src/ui/Features/Translate/AutoTranslateViewModel.cs Adds shared update command, visibility flag and refresh helper; extracts shared llama.cpp update logic.
src/ui/Features/Translate/AutoTranslateWindow.cs Adds "Update" button bound to the new visibility flag, placed after the engine combobox.

@niksedk niksedk merged commit 883cb7f into main May 31, 2026
3 of 4 checks passed
@niksedk niksedk deleted the feature/auto-translate-engine-update-button branch May 31, 2026 05:28
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.

2 participants