Repository navigation
feat: Models Library with safe downloads, redesigned UI, and multilingual fix - #18
Merged
Merged
Conversation
Development builds can now run beside an installed Yap without sharing its config, models, history, or logs.
One catalog holds every model's file, exact size, language support, curated speed and accuracy ratings, use case, and recommendation. Downloads are context-cancellable and limited to one at a time. Files are size-verified, synced, closed, and then atomically renamed, and temp files are removed on failure, cancellation, or shutdown. A wrong-sized model file no longer counts as downloaded. New bindings expose the download state and cancel and delete commands. Deletion protects the active model and the one downloading. Finishing a download no longer activates it. Refs #5
A dedicated Models page shows searchable, filterable model cards with language, recommendation, size, speed, and accuracy. Each card offers inline download, progress, cancel, retry, use, and delete actions. Settings shows an active-model summary (hidden for OpenAI), and Home links into the library and labels progress by the downloading model. Onboarding reacts only to its selected model. Every download listener is cleaned up, and browser alerts are replaced with inline errors. Adds Vitest component tests. Closes #5
Member
Author
Review findingsI confirmed all 9 catalog sizes against HuggingFace with live HEAD requests.
Fixes to follow in this PR. |
- Send download events in the same order the state changes, so a Cancel racing with completion can no longer leave the UI stuck on "Cancelling" with downloads disabled. - Remove partial downloads left by a crash, kill, or shutdown timeout when the manager starts and before each download. Only partials untouched for two minutes are removed, so a live download by another Yap sharing the directory is kept. - Onboarding asks the backend for the current download state when its request is rejected as busy, instead of trusting a possibly outdated render. Refs #5
Member
Author
|
All three findings are fixed in e35c6e6:
Re-verified with |
…l panel - Show models in a compact, sortable table (name, speed, accuracy, size) with the OpenAI logo, EN and Recommended badges, rating bars, and a status column for download, progress, failed, downloaded, and active models. - Move search and a filter menu (English only, Multilingual, Downloaded, Favorites, with counts) into the page header. Active filters show as removable chips. - Add a detail panel with description, type, language, spec icons, ratings, size, and status, plus one main action (Download, Cancel, Retry, Use, or Active) and a confirmed delete. It overlays the list in small windows and sits beside it in wide ones. Escape closes it. - Add favorites, saved in config through SetModelFavorite. - Name models "Whisper <size>" with an EN badge in the library. Other screens show "(English)" so the variants stay distinguishable. Refs #5
whisper.cpp defaults to English. Yap never passed a language, so multilingual models translated speech in other languages (e.g. Bulgarian) into English instead of transcribing it. Send "auto" for multilingual models and "en" for English-only models, as the language field on whisper-server requests and as -l to the whisper-cli fallback. The language comes from the model catalog. Refs #5
The shell-script worker tests skip on Windows, so add a test that sends the inference request to an httptest server and checks the language field. It runs on Windows CI too. Refs #5
- ConfigManager: guard the config with a RWMutex, apply each setter's change and save under one lock, write config.json atomically (temp file + rename), and return snapshots from Get. Concurrent favorite saves can no longer drop each other or corrupt the config. - Favorites: keep the optimistic star only while the save is in flight, then show the refreshed server state. Ignore repeat clicks while saving. If a save fails, open the model's panel with the error. - Toolbar: let filter chips scroll and the search field shrink, so the filter button stays reachable at the 850x550 minimum. - Escape that the app already handled (cancelling a recording) no longer also closes the panel or search. Closing the panel returns focus to the row that opened it. Refs #5
Member
Author
Review of the redesign and language fix (cfdcb3f, 4965bb4, 157e141)An independent review found no high-severity issues. Here's how each finding was handled; fixes are in 74f36e9.
Verification
|
Show the model name with an EN tag (matching the library) instead of "(English)", keep the name, tag, and badge on one line, stop the size from wrapping, and always reserve the space for the downloaded check so sizes line up. Cards are now keyboard-selectable radios. Refs #5
- Wrap the cards in a radiogroup labelled by the "Choose a Model" heading. - Name each card "<model> (English)", adding ", recommended" where it applies, and describe it with its size, purpose, and whether it is already downloaded, so screen readers get what the visuals show. - Use one Tab stop: arrow keys move the selection and focus between cards (wrapping at the ends), and Space or Enter selects. Refs #5
Member
Author
Review of 684247b (onboarding cards)No blocking issues. All findings are fixed in 77a7c05:
Verified in Playwriter at 850×550: the layout is unchanged, and ArrowDown moves the selection and focus. |
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.
Closes #5
Summary
Replaces the model dropdown and the background download flow with a dedicated Models page where users can compare, download, activate, and delete local transcription models.
Backend
internal/models/catalog.go). It holds each model's filename, exact byte size, language support, curated speed and accuracy ratings (1–5), use case, and recommendation. Previously this data was split betweentranscribeandmodels.transcribe.Modelconstants are tested against the catalog.small.enandmedium.Manager.DownloadModel(ctx, …)):IsModelDownloadedrequires the exact size, so a truncated file never counts as ready.Downloader(internal/models/downloads.go):{model,status,downloaded,total,progress,error}, with statusesdownloading/cancelling/completed/failed/cancelled.GetModelDownloadState,CancelModelDownload,DeleteModel.DownloadModelnow checks the request before returning. Finishing a download never activates the model.YAP_CONFIG_DIRkeeps dev data separate from the installed app.YAP_MODEL_BASE_URLpoints downloads at a local mirror for testing failures. Both are documented inDEVELOPMENT.md.Frontend
SetModelFavoritebinding.useModelDownloadloads the current state on mount, then follows events. Its listener is cleaned up (one listener under StrictMode).alert()popups are replaced with inline errors and Retry.npm test.Transcription language fix
whisper.cpp defaults to English, and Yap never passed a language, so multilingual models translated other languages into English instead of transcribing them. For example, Bulgarian came out as "Hello, my name is Daria, today is the time for the Soviet Union…".
autofor multilingual models andenfor.enmodels, from the catalog. It goes as thelanguagefield onwhisper-serverrequests and as-lfor thewhisper-clifallback.Testing
go vet ./...,go test -race ./...cd frontend && npm test(44 tests),npm run buildwhisper-serverrequest field (including a check that runs on Windows CI), and thewhisper-cli-lflagwails dev, an isolatedYAP_CONFIG_DIR, and a local mirror that slows some downloads and fails others. Checked in a browser with Playwriter at 850×550 and 1400×900:Note on auto-detection cost
Auto-detection adds a little time to each recording, but only for multilingual models. The default
base.enand every.enmodel are unchanged. Measured with Whisper Small on a 3 s clip:enautoThe planned language picker will let users pin a language and skip detection.