From 8d7cd26fa91e4eb98e6835c0107c98f8c7c2829b Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sat, 28 Mar 2026 22:53:10 +0100 Subject: [PATCH] feat: enhance compose functionality with button integration and translations --- app/[locale]/page.tsx | 35 ++++++++++++++++++------------- components/email/email-viewer.tsx | 9 ++++++++ components/layout/sidebar.tsx | 15 +------------ locales/en/common.json | 2 ++ 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 4541c9f1..fda1d125 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -1497,20 +1497,23 @@ export default function Home() { - {/* Floating Compose Button (mobile) */} - {isMobile && ( - - )} + {/* Floating Compose Button */} + {/* Email list resize handle (desktop only) */} @@ -1665,6 +1668,10 @@ export default function Home() { onNavigatePrev={handleNavigatePrev} onShowShortcuts={() => setShowShortcutsModal(true)} onEditDraft={handleEditDraft} + onCompose={() => { + setComposerMode('compose'); + setShowComposer(true); + }} currentUserEmail={client?.getUsername()} currentUserName={client?.getUsername()?.split("@")[0]} currentMailboxRole={mailboxes.find(m => m.id === selectedMailbox)?.role} diff --git a/components/email/email-viewer.tsx b/components/email/email-viewer.tsx index c7befde0..5f7e5668 100644 --- a/components/email/email-viewer.tsx +++ b/components/email/email-viewer.tsx @@ -68,6 +68,7 @@ import { HelpCircle, EditIcon, PlayCircle, + PenSquare, } from "lucide-react"; import { useTranslations } from "next-intl"; import type { Attachment as PostalMimeAttachment } from 'postal-mime'; @@ -121,6 +122,7 @@ interface EmailViewerProps { onNavigatePrev?: () => void; onShowShortcuts?: () => void; onEditDraft?: () => void; + onCompose?: () => void; currentUserEmail?: string; currentUserName?: string; currentMailboxRole?: string; @@ -865,6 +867,7 @@ export function EmailViewer({ onNavigatePrev, onShowShortcuts, onEditDraft, + onCompose, currentUserEmail, currentUserName, currentMailboxRole, @@ -2836,6 +2839,12 @@ export function EmailViewer({
{t('no_conversation_description')}
+ {onCompose && ( + + )} ); diff --git a/components/layout/sidebar.tsx b/components/layout/sidebar.tsx index 65bf03ed..cb1a22dc 100644 --- a/components/layout/sidebar.tsx +++ b/components/layout/sidebar.tsx @@ -12,7 +12,6 @@ import { Star, Trash2, Archive, - PenSquare, ChevronsLeft, ChevronsRight, ChevronRight, @@ -762,19 +761,7 @@ export function Sidebar({ {!isCollapsed &&