Release v2.3.4 — QuickMove: "als gelesen" pro Aktion + dynamischer Button-Name

- QuickMove markiert Nachrichten als gelesen, pro Aktion ein-/ausschaltbar
  (Checkbox in den QuickMove-Einstellungen, Default an)
- Button-Label heißt wie die Aktion, wenn nur eine konfiguriert ist (setLabel)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kendrick Bollens
2026-06-18 11:08:43 +02:00
parent f223f55933
commit fa817050d8
5 changed files with 35 additions and 3 deletions

View File

@@ -16,6 +16,8 @@ async function executeErledigtAction(tab, actionConfig) {
const storage = await browser.storage.local.get(['gitea_config', 'schlagwoerter_cache']);
const config = storage.gitea_config || {};
const schlagwoerter = storage.schlagwoerter_cache;
// "Als gelesen markieren" — pro Aktion konfigurierbar, standardmäßig an.
const markRead = (actionConfig || {}).markRead !== false;
// Apply user's tag
let tagKey = null;
@@ -33,6 +35,11 @@ async function executeErledigtAction(tab, actionConfig) {
}
}
// Mark as read (before the move, while the id is still valid in this folder)
if (markRead && !message.read) {
await messenger.messages.update(message.id, { read: true });
}
// Move to target folder
if (actionConfig.targetFolder) {
const folderInfo = JSON.parse(actionConfig.targetFolder);
@@ -42,6 +49,7 @@ async function executeErledigtAction(tab, actionConfig) {
// Feedback
const parts = [];
if (tagKey) parts.push('markiert');
if (markRead && !message.read) parts.push('gelesen');
if (actionConfig.targetFolder) parts.push('verschoben');
const title = actionConfig.name || 'Erledigt';
browser.notifications.create({
@@ -68,12 +76,19 @@ messenger.messageDisplayAction.onClicked.addListener(async (tab) => {
async function updateErledigtPopup() {
const result = await browser.storage.local.get('erledigt_config');
const actions = (result.erledigt_config || {}).actions || [];
const setLabel = (label) => {
// setLabel ist Thunderbird-spezifisch — defensiv prüfen, damit der Start nie bricht.
if (messenger.messageDisplayAction.setLabel) return messenger.messageDisplayAction.setLabel({ label });
};
if (actions.length > 1) {
await messenger.messageDisplayAction.setPopup({ popup: 'message_popup.html' });
await messenger.messageDisplayAction.setTitle({ title: 'Aktion wählen' });
await setLabel('QuickMove');
} else {
const name = actions[0]?.name || 'QuickMove';
await messenger.messageDisplayAction.setPopup({ popup: '' });
await messenger.messageDisplayAction.setTitle({ title: actions[0]?.name || 'Erledigt' });
await messenger.messageDisplayAction.setTitle({ title: name });
await setLabel(name); // Button heißt wie die (einzige) Aktion
}
}