diff --git a/claude-spec/05-options.md b/claude-spec/05-options.md index 81b1747a..b61cd92b 100644 --- a/claude-spec/05-options.md +++ b/claude-spec/05-options.md @@ -95,7 +95,7 @@ These are generated programmatically at the bottom of `mzta-options-default.js` | `spamfilter_enabled_accounts` | `[]` | Accounts where spam filter is active | | `spamfilter_show_msg_panel` | `true` | Show info panel on spam detection | | `summarize` | `false` | Enable email summarization | -| `summarize_auto` | `0` | Auto-summarize mode: `0` = disabled, `1` = manual (show "click to generate" button), `2` = automatic (generate on message open) | +| `summarize_auto` | `1` | Auto-summarize mode: `0` = disabled, `1` = manual (show "click to generate" button), `2` = automatic (generate on message open) | | `summarize_display_mode` | `'inline'` | Where to display summaries: `'inline'` = message pane banner, `'webchat'` = AI chat window. Note: `summarize_auto = 2` always uses inline regardless of this setting. | | `summarize_max_display_length` | `0` | Maximum characters shown in inline summary before truncation. `0` = no limit (show full text). When set, text is truncated at a word boundary and a "See more"/"See less" toggle link is shown. | diff --git a/mzta-background.js b/mzta-background.js index ef9f8d61..29ec2828 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -220,7 +220,9 @@ messenger.runtime.onMessage.addListener((message, sender, sendResponse) => { async function _initSummary() { try { let tabId = sender.tab.id; - let prefs = await browser.storage.sync.get({ summarize_auto: prefs_default.summarize_auto, summarize_display_mode: prefs_default.summarize_display_mode, summarize_max_display_length: prefs_default.summarize_max_display_length }); + let prefs = await browser.storage.sync.get({ summarize: prefs_default.summarize, summarize_auto: prefs_default.summarize_auto, summarize_display_mode: prefs_default.summarize_display_mode, summarize_max_display_length: prefs_default.summarize_max_display_length }); + + if (!prefs.summarize) return; let message = await browser.messageDisplay.getDisplayedMessage(tabId); if (!message) return; diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index 20dea23d..c7cbfcd8 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -137,10 +137,10 @@ export const prefs_default = { spamfilter: false, spamfilter_threshold: 70, spamfilter_enabled_accounts: [], - summarize_auto: 0, // 0: disabled, 1: manual button, 2: automatic + summarize: false, + summarize_auto: 1, // 0: disabled, 1: manual button, 2: automatic summarize_display_mode: 'inline', // 'inline' or 'webchat' summarize_max_display_length: 0, // 0 = no limit, otherwise max chars shown inline spamfilter_show_msg_panel: true, - summarize: false, ...generated_prefs }