From 51c52fc5b2c56e3497d7652b743a8e36547fd057 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 28 May 2026 05:43:28 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Implement=20first-run=20auto-download:=20hi?= =?UTF-8?q?nt=20panel=20and=20auto-start=20on=20Welcome=E2=86=92Model=20tr?= =?UTF-8?q?ansition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SettingsWindow.xaml | 19 ++++++++++++ SettingsWindow.xaml.cs | 67 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/SettingsWindow.xaml b/SettingsWindow.xaml index 7347a98..01d6958 100644 --- a/SettingsWindow.xaml +++ b/SettingsWindow.xaml @@ -145,6 +145,25 @@ Text="Emergency stop shortcuts and stop phrases discard the active capture without typing text. Use silence auto-commit or the start / stop shortcut when you want to commit." /> + + + + + + + ? SettingsSaved; @@ -1040,6 +1045,10 @@ private void OnSaveClick(object sender, RoutedEventArgs e) if (ReferenceEquals(this.SetupTabControl.SelectedItem, this.WelcomeTab)) { this.SetupTabControl.SelectedItem = this.ModelTab; + if (!this.IsCurrentBackendModelInstalled()) + { + this.OnDownloadSelectedModelClick(this, new RoutedEventArgs()); + } return; } @@ -2406,6 +2415,64 @@ private void SetModelPathText(string? value) this.suppressModelPathTextChanged = false; } + private void UpdateFirstRunDownloadHint() + { + if (this.FirstRunDownloadHintBorder is null || this.FirstRunDownloadHintText is null) + { + return; + } + + if (this.IsCurrentBackendModelInstalled()) + { + this.FirstRunDownloadHintBorder.Visibility = Visibility.Collapsed; + return; + } + + var recommendedOption = this.currentBackend switch + { + TranscriptionBackendKind.Moonshine => + MoonshineModelCatalog.Options.FirstOrDefault(opt => opt.Recommended) ?? MoonshineModelCatalog.Options.First(), + TranscriptionBackendKind.Parakeet => + (object)(ParakeetModelCatalog.Options.FirstOrDefault(opt => opt.Recommended) ?? ParakeetModelCatalog.Options.First()), + TranscriptionBackendKind.WhisperNet => + WhisperNetModelCatalog.Options.FirstOrDefault(opt => opt.Recommended) ?? WhisperNetModelCatalog.Options.First(), + _ => + WhisperModelCatalog.Options.FirstOrDefault(opt => opt.Recommended) ?? WhisperModelCatalog.Options.First() + }; + + var (name, size) = recommendedOption switch + { + WhisperModelOption w => (w.DisplayName, w.ApproximateSizeLabel), + MoonshineModelOption m => (m.DisplayName, m.ApproximateSizeLabel), + ParakeetModelOption p => (p.DisplayName, p.ApproximateSizeLabel), + WhisperNetModelOption n => (n.DisplayName, n.ApproximateSizeLabel), + _ => ("the recommended model", string.Empty) + }; + + var sizeNote = string.IsNullOrEmpty(size) ? string.Empty : $" (~{size} download)"; + this.FirstRunDownloadHintText.Text = + $"Clicking Next will begin downloading {name}{sizeNote}. " + + "You can change the model choice on the next step before the download finishes."; + this.FirstRunDownloadHintBorder.Visibility = Visibility.Visible; + } + + private bool IsCurrentBackendModelInstalled() + { + return this.currentBackend switch + { + TranscriptionBackendKind.Moonshine => + MoonshineModelCatalog.Options.Any(opt => MoonshineModelCatalog.TryResolveInstalledPath(opt, out _)), + TranscriptionBackendKind.Parakeet => + ParakeetModelCatalog.Options.Any(opt => ParakeetModelCatalog.TryResolveInstalledPath(opt, out _)), + TranscriptionBackendKind.QualcommQnn => + QualcommAihubWhisperModelCatalog.Options.Any(opt => QualcommAihubWhisperModelCatalog.TryResolveInstalledPath(opt, out _)), + TranscriptionBackendKind.WhisperNet => + WhisperNetModelCatalog.Options.Any(opt => WhisperNetModelCatalog.TryResolveInstalledArtifacts(opt, out _)), + _ => + WhisperModelCatalog.Options.Any(opt => WhisperModelCatalog.TryResolveInstalledPath(opt, out _)) + }; + } + private void ShowModelDownloadMessage(string message) { this.ModelDownloadStatusText.Text = message; From 000af3783fbcb05e3723dd875026cd04f4389bd5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 28 May 2026 05:45:51 +0000 Subject: [PATCH 2/2] Refactor UpdateFirstRunDownloadHint to collapse two switches into one, removing (object) cast --- SettingsWindow.xaml.cs | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/SettingsWindow.xaml.cs b/SettingsWindow.xaml.cs index 1640967..8c9f989 100644 --- a/SettingsWindow.xaml.cs +++ b/SettingsWindow.xaml.cs @@ -2428,25 +2428,28 @@ private void UpdateFirstRunDownloadHint() return; } - var recommendedOption = this.currentBackend switch + var (name, size) = this.currentBackend switch { TranscriptionBackendKind.Moonshine => - MoonshineModelCatalog.Options.FirstOrDefault(opt => opt.Recommended) ?? MoonshineModelCatalog.Options.First(), + MoonshineModelCatalog.Options + .Where(opt => opt.Recommended) + .Select(opt => (opt.DisplayName, opt.ApproximateSizeLabel)) + .FirstOrDefault(("the recommended model", string.Empty)), TranscriptionBackendKind.Parakeet => - (object)(ParakeetModelCatalog.Options.FirstOrDefault(opt => opt.Recommended) ?? ParakeetModelCatalog.Options.First()), + ParakeetModelCatalog.Options + .Where(opt => opt.Recommended) + .Select(opt => (opt.DisplayName, opt.ApproximateSizeLabel)) + .FirstOrDefault(("the recommended model", string.Empty)), TranscriptionBackendKind.WhisperNet => - WhisperNetModelCatalog.Options.FirstOrDefault(opt => opt.Recommended) ?? WhisperNetModelCatalog.Options.First(), + WhisperNetModelCatalog.Options + .Where(opt => opt.Recommended) + .Select(opt => (opt.DisplayName, opt.ApproximateSizeLabel)) + .FirstOrDefault(("the recommended model", string.Empty)), _ => - WhisperModelCatalog.Options.FirstOrDefault(opt => opt.Recommended) ?? WhisperModelCatalog.Options.First() - }; - - var (name, size) = recommendedOption switch - { - WhisperModelOption w => (w.DisplayName, w.ApproximateSizeLabel), - MoonshineModelOption m => (m.DisplayName, m.ApproximateSizeLabel), - ParakeetModelOption p => (p.DisplayName, p.ApproximateSizeLabel), - WhisperNetModelOption n => (n.DisplayName, n.ApproximateSizeLabel), - _ => ("the recommended model", string.Empty) + WhisperModelCatalog.Options + .Where(opt => opt.Recommended) + .Select(opt => (opt.DisplayName, opt.ApproximateSizeLabel)) + .FirstOrDefault(("the recommended model", string.Empty)) }; var sizeNote = string.IsNullOrEmpty(size) ? string.Empty : $" (~{size} download)";