Change English profile hotkey

This commit is contained in:
2026-06-03 07:17:00 +02:00
parent 8a0b302f1d
commit efe7c4ba0a
8 changed files with 48 additions and 14 deletions
@@ -33,7 +33,7 @@ public sealed class LaunchProfileOptionsProviderTests
["MeetingAssistant:AzureSpeech:Region"] = "germanywestcentral",
["MeetingAssistant:AzureSpeech:Language"] = "de-DE",
["MeetingAssistant:AzureSpeech:AutoDetectLanguages:0"] = "de-DE",
["MeetingAssistant:LaunchProfiles:english:Hotkey:Toggle"] = "Ctrl+Alt+E",
["MeetingAssistant:LaunchProfiles:english:Hotkey:Toggle"] = "Ctrl+Alt+L",
["MeetingAssistant:LaunchProfiles:english:AzureSpeech:Language"] = "en-US",
["MeetingAssistant:LaunchProfiles:english:AzureSpeech:AutoDetectLanguages:0"] = "en-US"
});
@@ -41,13 +41,23 @@ public sealed class LaunchProfileOptionsProviderTests
var profile = provider.GetRequiredProfile("english");
Assert.Equal("english", profile.Name);
Assert.Equal("Ctrl+Alt+E", profile.Options.Hotkey.Toggle);
Assert.Equal("Ctrl+Alt+L", profile.Options.Hotkey.Toggle);
Assert.Equal("azure-speech", profile.Options.Recording.TranscriptionProvider);
Assert.Equal("germanywestcentral", profile.Options.AzureSpeech.Region);
Assert.Equal("en-US", profile.Options.AzureSpeech.Language);
Assert.Equal(["en-US"], profile.Options.AzureSpeech.AutoDetectLanguages);
}
[Fact]
public void CheckedInEnglishProfileUsesLanguageHotkey()
{
var provider = CreateProviderFromAppsettings();
var profile = provider.GetRequiredProfile("english");
Assert.Equal("Ctrl+Alt+L", profile.Options.Hotkey.Toggle);
}
[Fact]
public void DuplicateProfileHotkeysAreRejected()
{
@@ -69,7 +79,7 @@ public sealed class LaunchProfileOptionsProviderTests
["MeetingAssistant:Hotkey:Toggle"] = "Ctrl+Alt+M",
["MeetingAssistant:Hotkey:Abort"] = "Ctrl+Alt+Z",
["MeetingAssistant:Screenshots:Hotkey"] = "Ctrl+Alt+S",
["MeetingAssistant:LaunchProfiles:english:Hotkey:Toggle"] = "Ctrl+Alt+E",
["MeetingAssistant:LaunchProfiles:english:Hotkey:Toggle"] = "Ctrl+Alt+L",
["MeetingAssistant:LaunchProfiles:english:Hotkey:Abort"] = "Ctrl+Alt+Shift+D",
["MeetingAssistant:LaunchProfiles:english:Screenshots:Hotkey"] = "Ctrl+Alt+Shift+S"
});
@@ -136,4 +146,28 @@ public sealed class LaunchProfileOptionsProviderTests
.Build();
return new ConfigurationLaunchProfileOptionsProvider(configuration);
}
private static ConfigurationLaunchProfileOptionsProvider CreateProviderFromAppsettings()
{
var root = FindRepositoryRoot();
var configuration = new ConfigurationBuilder()
.AddJsonFile(Path.Combine(root, "MeetingAssistant", "appsettings.json"), optional: false)
.Build();
return new ConfigurationLaunchProfileOptionsProvider(configuration);
}
private static string FindRepositoryRoot()
{
for (var directory = new DirectoryInfo(AppContext.BaseDirectory);
directory is not null;
directory = directory.Parent)
{
if (File.Exists(Path.Combine(directory.FullName, "MeetingAssistant.slnx")))
{
return directory.FullName;
}
}
throw new InvalidOperationException("Could not locate MeetingAssistant.slnx from the test output folder.");
}
}