From 48eadd4ebe8b3aa16e814dea954cd0b68499d1df Mon Sep 17 00:00:00 2001 From: drew Date: Sun, 7 Jun 2026 16:18:15 +0400 Subject: [PATCH 1/2] feat: make daemon optional Signed-off-by: drew --- config/config.go | 1 + daemonclient/service.go | 7 ++++++- i18n/locales/ar.json | 1 + i18n/locales/de.json | 1 + i18n/locales/en.json | 1 + i18n/locales/es.json | 1 + i18n/locales/fr.json | 1 + i18n/locales/ja.json | 1 + i18n/locales/pl.json | 1 + i18n/locales/pt.json | 1 + i18n/locales/ru.json | 1 + i18n/locales/uk.json | 1 + i18n/locales/zh.json | 1 + tui/settings_general.go | 21 +++++++++++++-------- 14 files changed, 31 insertions(+), 9 deletions(-) diff --git a/config/config.go b/config/config.go index 24e28e07..04ed559a 100644 --- a/config/config.go +++ b/config/config.go @@ -119,6 +119,7 @@ type Config struct { DisableImages bool `json:"disable_images,omitempty"` HideTips bool `json:"hide_tips,omitempty"` DisableNotifications bool `json:"disable_notifications,omitempty"` + DisableDaemon bool `json:"disable_daemon,omitempty"` EnableSplitPane bool `json:"enable_split_pane,omitempty"` EnableThreaded bool `json:"enable_threaded,omitempty"` EnableDetailedDates bool `json:"enable_detailed_dates,omitempty"` diff --git a/daemonclient/service.go b/daemonclient/service.go index 9c17977d..76b05796 100644 --- a/daemonclient/service.go +++ b/daemonclient/service.go @@ -37,8 +37,13 @@ type Service interface { } // NewService connects to the daemon, auto-starting it if needed. -// Falls back to direct mode only if daemon cannot be started. +// Falls back to direct mode only if daemon cannot be started, or if DisableDaemon is set. func NewService(cfg *config.Config) Service { + if cfg.DisableDaemon { + log.Println("service: daemon disabled by config, using direct mode") + return newDirectService(cfg) + } + // Try connecting to existing daemon. if svc := tryConnect(); svc != nil { return svc diff --git a/i18n/locales/ar.json b/i18n/locales/ar.json index 455105de..3510c51c 100644 --- a/i18n/locales/ar.json +++ b/i18n/locales/ar.json @@ -154,6 +154,7 @@ "disable_images": "تعطيل عرض الصور", "hide_tips": "إخفاء النصائح السياقية", "disable_notifications": "تعطيل الإشعارات", + "disable_daemon": "Background Daemon", "enable_split_pane": "عرض مقسم", "enable_threaded": "عرض المحادثات", "enable_detailed_dates": "تواريخ مفصلة", diff --git a/i18n/locales/de.json b/i18n/locales/de.json index b26196ca..0950d572 100644 --- a/i18n/locales/de.json +++ b/i18n/locales/de.json @@ -150,6 +150,7 @@ "disable_images": "Bildanzeige Deaktivieren", "hide_tips": "Kontextuelle Tipps Ausblenden", "disable_notifications": "Benachrichtigungen Deaktivieren", + "disable_daemon": "Background Daemon", "enable_split_pane": "Geteilte Ansicht", "enable_threaded": "Konversations-Threads", "enable_detailed_dates": "Detaillierte Datumsangaben", diff --git a/i18n/locales/en.json b/i18n/locales/en.json index 770d0100..38aef591 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -152,6 +152,7 @@ "disable_images": "Disable Image Display", "hide_tips": "Hide Contextual Tips", "disable_notifications": "Disable Notifications", + "disable_daemon": "Background Daemon", "enable_split_pane": "Split Pane View", "enable_threaded": "Threaded Conversation View", "enable_detailed_dates": "Detailed Dates", diff --git a/i18n/locales/es.json b/i18n/locales/es.json index f3247dac..2a24b944 100644 --- a/i18n/locales/es.json +++ b/i18n/locales/es.json @@ -150,6 +150,7 @@ "disable_images": "Deshabilitar Visualización de Imágenes", "hide_tips": "Ocultar Consejos Contextuales", "disable_notifications": "Deshabilitar Notificaciones", + "disable_daemon": "Background Daemon", "enable_split_pane": "Vista dividida", "enable_threaded": "Vista de conversación", "enable_detailed_dates": "Fechas detalladas", diff --git a/i18n/locales/fr.json b/i18n/locales/fr.json index f9ed8a0b..0a529868 100644 --- a/i18n/locales/fr.json +++ b/i18n/locales/fr.json @@ -150,6 +150,7 @@ "disable_images": "Désactiver l'Affichage des Images", "hide_tips": "Masquer les Conseils Contextuels", "disable_notifications": "Désactiver les Notifications", + "disable_daemon": "Background Daemon", "enable_split_pane": "Vue divisée", "enable_threaded": "Vue par conversation", "enable_detailed_dates": "Dates détaillées", diff --git a/i18n/locales/ja.json b/i18n/locales/ja.json index ee026e65..13c91a70 100644 --- a/i18n/locales/ja.json +++ b/i18n/locales/ja.json @@ -148,6 +148,7 @@ "disable_images": "画像表示を無効化", "hide_tips": "コンテキストヒントを非表示", "disable_notifications": "通知を無効化", + "disable_daemon": "Background Daemon", "enable_split_pane": "分割ビュー", "enable_threaded": "スレッド表示", "enable_detailed_dates": "詳細な日付", diff --git a/i18n/locales/pl.json b/i18n/locales/pl.json index 3746bde8..753c54d0 100644 --- a/i18n/locales/pl.json +++ b/i18n/locales/pl.json @@ -154,6 +154,7 @@ "disable_images": "Wyłącz Wyświetlanie Obrazów", "hide_tips": "Ukryj Wskazówki Kontekstowe", "disable_notifications": "Wyłącz Powiadomienia", + "disable_daemon": "Background Daemon", "enable_split_pane": "Widok podzielony", "enable_threaded": "Widok wątków", "enable_detailed_dates": "Szczegółowe daty", diff --git a/i18n/locales/pt.json b/i18n/locales/pt.json index 8d2acad2..96b83295 100644 --- a/i18n/locales/pt.json +++ b/i18n/locales/pt.json @@ -150,6 +150,7 @@ "disable_images": "Desativar Exibição de Imagens", "hide_tips": "Ocultar Dicas Contextuais", "disable_notifications": "Desativar Notificações", + "disable_daemon": "Background Daemon", "enable_split_pane": "Vista dividida", "enable_threaded": "Vista de conversação", "enable_detailed_dates": "Datas detalhadas", diff --git a/i18n/locales/ru.json b/i18n/locales/ru.json index 61db8055..b7f9be2f 100644 --- a/i18n/locales/ru.json +++ b/i18n/locales/ru.json @@ -154,6 +154,7 @@ "disable_images": "Отключить Отображение Изображений", "hide_tips": "Скрыть Контекстные Подсказки", "disable_notifications": "Отключить Уведомления", + "disable_daemon": "Background Daemon", "enable_split_pane": "Разделённый вид", "enable_threaded": "Просмотр беседами", "enable_detailed_dates": "Подробные даты", diff --git a/i18n/locales/uk.json b/i18n/locales/uk.json index 3bc0e45f..648e34d7 100644 --- a/i18n/locales/uk.json +++ b/i18n/locales/uk.json @@ -152,6 +152,7 @@ "disable_images": "Вимкнути показ зображень", "hide_tips": "Приховати контекстні підказки", "disable_notifications": "Вимкнути сповіщення", + "disable_daemon": "Background Daemon", "enable_split_pane": "Розділений вигляд", "enable_threaded": "Перегляд розмов", "enable_detailed_dates": "Детальні дати", diff --git a/i18n/locales/zh.json b/i18n/locales/zh.json index 6ba77ee3..341b816c 100644 --- a/i18n/locales/zh.json +++ b/i18n/locales/zh.json @@ -148,6 +148,7 @@ "disable_images": "禁用图片显示", "hide_tips": "隐藏上下文提示", "disable_notifications": "禁用通知", + "disable_daemon": "Background Daemon", "enable_split_pane": "分屏视图", "enable_threaded": "会话视图", "enable_detailed_dates": "详细日期", diff --git a/tui/settings_general.go b/tui/settings_general.go index 89cfe397..3f4eab48 100644 --- a/tui/settings_general.go +++ b/tui/settings_general.go @@ -20,6 +20,7 @@ func (m *Settings) buildGeneralOptions() []generalOption { {"settings_general.disable_images", onOff(m.cfg.DisableImages), "Prevent images from loading automatically in emails."}, {"settings_general.hide_tips", onOff(m.cfg.HideTips), "Hide helpful hints displayed at the bottom of the screen."}, {"settings_general.disable_notifications", onOff(m.cfg.DisableNotifications), "Turn off desktop notifications for new mail."}, + {"settings_general.disable_daemon", onOff(!m.cfg.DisableDaemon), "Run a background daemon for push notifications and sync. Takes effect on restart."}, {"settings_general.enable_split_pane", onOff(m.cfg.EnableSplitPane), "View inbox and email side-by-side."}, {"settings_general.enable_threaded", onOff(m.cfg.EnableThreaded), "Group emails into conversations by reply chain. Per-folder overrides are kept."}, {"settings_general.enable_detailed_dates", onOff(m.cfg.EnableDetailedDates), "Show detailed inbox dates."}, @@ -57,27 +58,31 @@ func (m *Settings) updateGeneral(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { m.cfg.DisableNotifications = !m.cfg.DisableNotifications _ = config.SaveConfig(m.cfg) saved = true - case 3: // Split Pane View + case 3: // Background Daemon + m.cfg.DisableDaemon = !m.cfg.DisableDaemon + _ = config.SaveConfig(m.cfg) + saved = true + case 4: // Split Pane View m.cfg.EnableSplitPane = !m.cfg.EnableSplitPane _ = config.SaveConfig(m.cfg) saved = true - case 4: // Threaded Conversation View + case 5: // Threaded Conversation View m.cfg.EnableThreaded = !m.cfg.EnableThreaded _ = config.SaveConfig(m.cfg) saved = true - case 5: // Detailed Dates + case 6: // Detailed Dates m.cfg.EnableDetailedDates = !m.cfg.EnableDetailedDates _ = config.SaveConfig(m.cfg) saved = true - case 6: // Spellcheck + case 7: // Spellcheck m.cfg.DisableSpellcheck = !m.cfg.DisableSpellcheck _ = config.SaveConfig(m.cfg) saved = true - case 7: // Spell Suggestions + case 8: // Spell Suggestions m.cfg.DisableSpellSuggestions = !m.cfg.DisableSpellSuggestions _ = config.SaveConfig(m.cfg) saved = true - case 8: // Date Format + case 9: // Date Format switch m.cfg.DateFormat { case config.DateFormatEU: m.cfg.DateFormat = config.DateFormatUS @@ -88,7 +93,7 @@ func (m *Settings) updateGeneral(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { } _ = config.SaveConfig(m.cfg) saved = true - case 9: // Language + case 10: // Language // Cycle through available languages langs := i18n.LanguageCodes() currentLang := m.cfg.GetLanguage() @@ -109,7 +114,7 @@ func (m *Settings) updateGeneral(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { func() tea.Msg { return ConfigSavedMsg{} }, func() tea.Msg { return LanguageChangedMsg{} }, ) - case 10: // Edit Signature + case 11: // Edit Signature if msg.String() == keyEnter || msg.String() == keyRight || msg.String() == "l" { return m, func() tea.Msg { return GoToSignatureEditorMsg{} } } From 87dca990af5365136e672b4015a2168f17bd12b3 Mon Sep 17 00:00:00 2001 From: drew Date: Sun, 7 Jun 2026 16:28:13 +0400 Subject: [PATCH 2/2] fix: config not saving Signed-off-by: drew --- config/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/config.go b/config/config.go index 04ed559a..67c8338c 100644 --- a/config/config.go +++ b/config/config.go @@ -445,6 +445,7 @@ type secureDiskConfig struct { DisableImages bool `json:"disable_images,omitempty"` HideTips bool `json:"hide_tips,omitempty"` DisableNotifications bool `json:"disable_notifications,omitempty"` + DisableDaemon bool `json:"disable_daemon,omitempty"` EnableSplitPane bool `json:"enable_split_pane,omitempty"` EnableThreaded bool `json:"enable_threaded,omitempty"` EnableDetailedDates bool `json:"enable_detailed_dates,omitempty"` @@ -495,6 +496,7 @@ func SaveConfig(config *Config) error { DisableImages: config.DisableImages, HideTips: config.HideTips, DisableNotifications: config.DisableNotifications, + DisableDaemon: config.DisableDaemon, EnableSplitPane: config.EnableSplitPane, EnableThreaded: config.EnableThreaded, EnableDetailedDates: config.EnableDetailedDates, @@ -603,6 +605,7 @@ func LoadConfig() (*Config, error) { DisableImages bool `json:"disable_images,omitempty"` HideTips bool `json:"hide_tips,omitempty"` DisableNotifications bool `json:"disable_notifications,omitempty"` + DisableDaemon bool `json:"disable_daemon,omitempty"` EnableSplitPane bool `json:"enable_split_pane,omitempty"` EnableThreaded bool `json:"enable_threaded,omitempty"` EnableDetailedDates bool `json:"enable_detailed_dates,omitempty"` @@ -645,6 +648,7 @@ func LoadConfig() (*Config, error) { config.DisableImages = raw.DisableImages config.HideTips = raw.HideTips config.DisableNotifications = raw.DisableNotifications + config.DisableDaemon = raw.DisableDaemon config.EnableSplitPane = raw.EnableSplitPane config.EnableThreaded = raw.EnableThreaded config.EnableDetailedDates = raw.EnableDetailedDates