feat: remove legacy configuration

This commit is contained in:
leonardotrapani
2026-02-01 23:09:33 +01:00
parent 500b84caec
commit 2729882b9d
20 changed files with 272 additions and 622 deletions
+12 -7
View File
@@ -52,16 +52,21 @@ func TestGetTranscriptionModelOptions_NoHeadersAnymore(t *testing.T) {
func TestGetTranscriptionModelOptions_OpenAI_ShowsCapabilities(t *testing.T) {
options := getTranscriptionModelOptions("openai")
// OpenAI has 3 transcription models: whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe
if len(options) != 3 {
t.Errorf("expected 3 options for openai, got %d", len(options))
// OpenAI has 4 transcription models: whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe, gpt-4o-realtime-preview
if len(options) != 4 {
t.Errorf("expected 4 options for openai, got %d", len(options))
}
// gpt-4o-transcribe and gpt-4o-mini-transcribe should mention batch+streaming
// gpt-4o-realtime-preview should mention streaming
for _, opt := range options {
if strings.Contains(opt.ID, "gpt-4o") {
if !strings.Contains(opt.Desc, "batch+streaming") {
t.Errorf("gpt-4o model %s should mention batch+streaming: %s", opt.ID, opt.Desc)
switch opt.ID {
case "gpt-4o-realtime-preview":
if !strings.Contains(opt.Desc, "streaming") {
t.Errorf("gpt-4o-realtime-preview should mention streaming: %s", opt.Desc)
}
case "gpt-4o-transcribe", "gpt-4o-mini-transcribe":
if strings.Contains(opt.Desc, "streaming") {
t.Errorf("batch-only model %s should not mention streaming: %s", opt.ID, opt.Desc)
}
}
}
+4 -1
View File
@@ -25,11 +25,14 @@ const (
menuAdvanced = "advanced"
menuSave = "save"
menuDiscard = "discard"
repoURL = "https://github.com/leonardotrapani/hyprvoice"
)
func newWelcomeScreen(state *wizardState) screen {
desc := append([]string{}, LogoLines()...)
desc = append(desc, "", "Voice-powered typing for Wayland/Hyprland.", "Let's set up your configuration.")
desc = append(desc, "Consider starring the project on GitHub ⭐")
desc = append(desc, repoURL)
s := newInfoScreen(state, "Hyprvoice Onboarding", desc, func() screen {
return onboardingVoiceProviderScreen(state)
}, func() screen {
@@ -103,7 +106,7 @@ func newMenuScreen(state *wizardState) screen {
state.result = &ConfigureResult{Cancelled: true}
return nil
})
screen.footer = "enter select • esc cancel • / filter"
screen.footer = fmt.Sprintf("enter select • esc cancel • / filter\nconsider starring the project on github ⭐\n%s", repoURL)
return screen
}
+2 -1
View File
@@ -48,7 +48,8 @@ func (s *listScreen) Init() tea.Cmd {
func (s *listScreen) Update(msg tea.Msg) (screen, tea.Cmd) {
switch msg := msg.(type) {
case tea.WindowSizeMsg:
s.list.SetSize(msg.Width-4, msg.Height-8)
extraFooterLines := strings.Count(s.footer, "\n")
s.list.SetSize(msg.Width-4, msg.Height-8-extraFooterLines)
case tea.KeyMsg:
switch msg.String() {
case "enter":