feat(voice): per-account choice between Whisper and the browser; STT_ALLOW_BROWSER
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m40s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sandrodachandClaude Opus 5.5 committed 2026-11-01 15:19:20 +01:00
1 parent 55112b940c
commit a927a94a95
21 files changed
+288 -15

No files matched your search

+12 -1
View File
@@ -49,7 +49,8 @@ func (s *Server) handleAuthStatus(w http.ResponseWriter, r *http.Request) {
"sharingMode": s.store.SharingMode(),
"passwordReset": s.passwordResetAvailable(),
// How voice input works: "server" (own Whisper), "browser" or "off"; set by STT_* only
"voice": map[string]interface{}{"mode": s.voiceMode(), "maxSeconds": s.cfg.Speech.MaxSeconds},
// browserAllowed: whether people may pick the browser's recognition instead of the Whisper server
"voice": map[string]interface{}{"mode": s.voiceMode(), "maxSeconds": s.cfg.Speech.MaxSeconds, "browserAllowed": !s.cfg.Speech.NoBrowser},
// Public so the login screen can link Impressum and Datenschutz
"legal": map[string]interface{}{
"imprintUrl": s.cfg.Legal.ImprintURL,
@@ -404,6 +405,7 @@ func (s *Server) handleMe(w http.ResponseWriter, r *http.Request) {
ns := s.store.NotificationSettingsOf(userID)
user.NotificationSettings = &ns
user.DoneRetentionDays = s.store.DoneRetentionDays(userID)
user.VoiceInput = s.store.VoiceInput(userID)
writeJSON(w, http.StatusOK, map[string]interface{}{
"user": user,
"stats": stats,
@@ -515,6 +517,8 @@ func (s *Server) handleUpdateUserSettings(w http.ResponseWriter, r *http.Request
NotificationSettings *domain.NotificationSettings `json:"notificationSettings"`
// Days after which completed tasks are deleted (done_cleanup.go)
DoneRetentionDays *int `json:"doneRetentionDays"`
// Voice input: "" (Whisper server, the default) or "browser"
VoiceInput *string `json:"voiceInput"`
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
writeError(w, http.StatusBadRequest, "Ungültiges JSON")
@@ -607,9 +611,16 @@ func (s *Server) handleUpdateUserSettings(w http.ResponseWriter, r *http.Request
return
}
}
if req.VoiceInput != nil {
if err := s.store.SetVoiceInput(userID, *req.VoiceInput); err != nil {
writeError(w, http.StatusBadRequest, err.Error())
return
}
}
ns := s.store.NotificationSettingsOf(userID)
u.NotificationSettings = &ns
u.DoneRetentionDays = s.store.DoneRetentionDays(userID)
u.VoiceInput = s.store.VoiceInput(userID)
writeJSON(w, http.StatusOK, u)
}