diff --git a/tui/settings_general.go b/tui/settings_general.go index 9b0605addb6ee027dffeb6b03013d9ad0448455f..a39f1fbcfc0cc358f00bfa2209be759ac754bad5 100644 --- a/tui/settings_general.go +++ b/tui/settings_general.go @@ -10,40 +10,22 @@ import ( ) type generalOption struct { - labelKey string - value string - tip string - isAccountSig bool - accountID string + labelKey string + value string + tip string } func (m *Settings) buildGeneralOptions() []generalOption { - opts := make([]generalOption, 0, 9+len(m.cfg.Accounts)) - opts = append(opts, []generalOption{ - {"settings_general.disable_images", onOff(m.cfg.DisableImages), "Prevent images from loading automatically in emails.", false, ""}, - {"settings_general.hide_tips", onOff(m.cfg.HideTips), "Hide helpful hints displayed at the bottom of the screen.", false, ""}, - {"settings_general.disable_notifications", onOff(m.cfg.DisableNotifications), "Turn off desktop notifications for new mail.", false, ""}, - {"settings_general.enable_split_pane", onOff(m.cfg.EnableSplitPane), "View inbox and email side-by-side.", false, ""}, - {"settings_general.enable_threaded", onOff(m.cfg.EnableThreaded), "Group emails into conversations by reply chain. Per-folder overrides are kept.", false, ""}, - {"settings_general.enable_detailed_dates", onOff(m.cfg.EnableDetailedDates), "Show detailed inbox dates.", false, ""}, - {"settings_general.date_format", getDateFormatLabel(m.cfg.DateFormat), "Change how dates and times are displayed.", false, ""}, - {"settings_general.language", getLanguageLabel(m.cfg.GetLanguage()), "Change the interface language. Changes apply instantly.", false, ""}, - {"settings_general.signature", getSignatureStatus(), "Configure the global signature appended to your outgoing emails.", false, ""}, - }...) - - for _, acc := range m.cfg.Accounts { - status := t("settings_general.signature_not_configured") - accCopy := acc // capture for pointer safety - if config.HasAccountSignature(&accCopy) { - status = t("settings_general.signature_configured") - } - opts = append(opts, generalOption{ - labelKey: fmt.Sprintf("Signature (%s)", acc.Email), - value: status, - tip: fmt.Sprintf("Configure the signature for %s", acc.Email), - isAccountSig: true, - accountID: acc.ID, - }) + opts := []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.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."}, + {"settings_general.date_format", getDateFormatLabel(m.cfg.DateFormat), "Change how dates and times are displayed."}, + {"settings_general.language", getLanguageLabel(m.cfg.GetLanguage()), "Change the interface language. Changes apply instantly."}, + {"settings_general.signature", getSignatureStatus(), "Configure the global signature appended to your outgoing emails."}, } return opts @@ -59,14 +41,6 @@ func (m *Settings) updateGeneral(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { m.generalCursor = (m.generalCursor + 1) % len(opts) case keyEnter, "space", keyRight, "l": if m.generalCursor < len(opts) { - opt := opts[m.generalCursor] - if opt.isAccountSig { - if msg.String() == keyEnter || msg.String() == keyRight || msg.String() == "l" { - return m, func() tea.Msg { return GoToSignatureEditorMsg{AccountID: opt.accountID} } - } - return m, nil - } - saved := false switch m.generalCursor { case 0: // Image Display @@ -153,12 +127,9 @@ func (m *Settings) viewGeneral() string { style = selectedAccountItemStyle } - label := opt.labelKey - if !opt.isAccountSig { - label = t(opt.labelKey) - } + label := t(opt.labelKey) text := fmt.Sprintf("%s: %s", label, opt.value) - if opt.labelKey == "settings_general.signature" || opt.isAccountSig { + if opt.labelKey == "settings_general.signature" { text = fmt.Sprintf("%s (%s)", label, opt.value) }