From d82ca27fdc1c043c540e491355f3aeb6057d1fc1 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Wed, 15 Jul 2026 12:55:41 +0200 Subject: [PATCH] feat: move reply/forward/flag/event buttons to plugin toolbar - Toolbar now includes context-aware mail action buttons - Reply, Forward, Flag, Create Event disabled when no mail selected - Buttons grouped: account | search | compose | mail-actions | tools --- frontend/src/pages/Mail.tsx | 46 +++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/Mail.tsx b/frontend/src/pages/Mail.tsx index faff3b9..49f7dec 100644 --- a/frontend/src/pages/Mail.tsx +++ b/frontend/src/pages/Mail.tsx @@ -284,6 +284,7 @@ export function MailPage() { // Register toolbar items const { registerItems, unregisterPlugin } = usePluginToolbarStore(); useEffect(() => { + const hasMail = !!selectedMail; registerItems('mail', [ { id: 'account-select', @@ -308,15 +309,52 @@ export function MailPage() { id: 'compose', plugin: 'mail', label: 'Verfassen', - group: 'actions', + group: 'compose', icon: , onClick: handleCompose, }, + { + id: 'reply', + plugin: 'mail', + label: 'Antworten', + group: 'mail-actions', + disabled: !hasMail, + icon: , + onClick: () => selectedMail && handleReply(selectedMail), + }, + { + id: 'forward', + plugin: 'mail', + label: 'Weiterleiten', + group: 'mail-actions', + disabled: !hasMail, + icon: , + onClick: () => selectedMail && handleForward(selectedMail), + }, + { + id: 'flag', + plugin: 'mail', + label: 'Flagge', + group: 'mail-actions', + disabled: !hasMail, + active: selectedMail?.is_flagged, + icon: , + onClick: () => selectedMail && handleToggleFlag(selectedMail), + }, + { + id: 'create-event', + plugin: 'mail', + label: 'Termin', + group: 'mail-actions', + disabled: !hasMail, + icon: , + onClick: () => selectedMail && handleCreateEvent(selectedMail), + }, { id: 'sync', plugin: 'mail', label: 'Sync', - group: 'actions', + group: 'tools', icon: , onClick: () => { /* sync trigger */ }, }, @@ -324,13 +362,13 @@ export function MailPage() { id: 'settings', plugin: 'mail', label: 'Einstellungen', - group: 'actions', + group: 'tools', icon: , onClick: () => window.location.href = '/mail/settings', }, ]); return () => unregisterPlugin('mail'); - }, [registerItems, unregisterPlugin, accounts, selectedAccountId, handleAccountSwitch, handleSearch, handleCompose]); + }, [registerItems, unregisterPlugin, accounts, selectedAccountId, selectedMail, handleAccountSwitch, handleSearch, handleCompose, handleReply, handleForward, handleToggleFlag, handleCreateEvent]); if (loadingAccounts) { return (