feat: show download state for local translation models - #1039
Conversation
|
Thanks for your first PR to Koharu. Please review our contribution guide before review: In the PR description, include:
If AI substantially helped design or implement the patch, disclose the extent and purpose of that assistance. A human contributor must personally review, understand, and take responsibility for every submission. |
mayocream
left a comment
There was a problem hiding this comment.
Please make minimal changes needed, only change the model list api to include a downloaded bool to indicate the status; let's use an icon for downloaded status instead of showing a literal.
1ddb782 to
581fc92
Compare
Addressed this point and kept the changes minimal. I used the HardDrive icon for the downloaded status — does that look appropriate, or would you prefer a different icon? |
Summary
Local translation models now expose their per-quantization download state and size from the on-disk Hugging Face cache.
Downloaded quantizations show a
Downloadedbadge. Missing quantizations show the remaining download size and aDownload & Loadaction, which saves the selectedModelSelectionand loads it through the existing translator path. Download state is derived locally from the pinned model catalog, so opening the picker does not require a Hugging Face metadata request.Normal model selection remains preference-only, and remote providers are unchanged. The
Download & Loadaction is available in the editor model picker; Settings remains selection-only and shows download state/size without triggering a download.Related issue
Closes #233
Verification
cargo fmt -- --checkcargo check -p koharu-appcargo test -p koharu-runtime --lib source::hugging_facecargo test -p koharu-translator --libcargo test -p koharu-pipeline --lib tests::load_translation_model_is_noop_for_remote_providersbun run --filter @koharu/app lintbunx tsc --noEmitinpackages/koharugit diff --checkDownload & Loadflow.UI
Downloaded quantization:
Settings:
Editor:
Undownloaded quantization:
Settings:
Editor:
AI assistance
Used AI assistance to understand the existing model-loading, Hugging Face cache, and frontend flows while developing the change. I reviewed the full diff, ran the checks above, and take responsibility for the change.