Email for professionals and teams
Improve UI
Hieu Nguyen (Jack)b9e9cf790d4e
diff --git a/package.json b/package.jsonindex 9a160ec..b22ed0d 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "mailflare",- "version": "0.4.0",+ "version": "0.4.1","private": true,"scripts": {"dev": "npm run db:bundle && vite dev --port 3000",diff --git a/src/app/api/messages/route.ts b/src/app/api/messages/route.tsindex 9d795ec..899d6bc 100644--- a/src/app/api/messages/route.ts+++ b/src/app/api/messages/route.ts@@ -1,5 +1,5 @@import { NextResponse } from "next/server";-import { eq, desc, and, or, count, isNull, isNotNull, inArray, lte, gt, notInArray, sql, sum } from "drizzle-orm";+import { eq, desc, and, or, count, isNull, isNotNull, inArray, lte, gt, notInArray, ne, sql, sum } from "drizzle-orm";import type { SQL } from "drizzle-orm";import { getEnv } from "@/lib/cloudflare";import { getCurrentUser } from "@/lib/auth/cookies";@@ -61,6 +61,10 @@ export async function GET(request: Request) {if (status) {conditions.push(eq(messages.status, status));}+ // Composer templates are stored as messages but never listed.+ if (status !== "template") {+ conditions.push(ne(messages.status, "template"));+ }if (status === "received" && !folderId) {conditions.push(isNull(messages.folderId));conditions.push(or(isNull(messages.snoozedUntil), lte(messages.snoozedUntil, new Date()))!);diff --git a/src/app/api/templates/[id]/route.ts b/src/app/api/templates/[id]/route.tsnew file mode 100644index 0000000..3dadaa0--- /dev/null+++ b/src/app/api/templates/[id]/route.ts@@ -0,0 +1,25 @@+import { and, eq } from "drizzle-orm";+import { NextResponse } from "next/server";+import { getDb } from "@/db";+import { messages } from "@/db/schema";+import { requireSessionUser } from "@/lib/api/auth";+import { hasValidSessionMutationOrigin } from "@/lib/auth/origin";+import { getEnv } from "@/lib/cloudflare";+import { deleteMessageWithObjects } from "@/lib/email/message-cleanup";++export async function DELETE(request: Request, { params }: { params: Promise<{ id: string }> }) {+ const env = getEnv();+ const auth = await requireSessionUser(env, request);+ if (auth.error) return auth.error;+ if (!hasValidSessionMutationOrigin(request)) return NextResponse.json({ error: "Invalid origin" }, { status: 403 });+ const { id } = await params;+ const db = getDb(env);+ const [row] = await db+ .select({ id: messages.id, rawR2Key: messages.rawR2Key })+ .from(messages)+ .where(and(eq(messages.id, id), eq(messages.userId, auth.user.id), eq(messages.status, "template")))+ .limit(1);+ if (!row) return NextResponse.json({ error: "Template not found" }, { status: 404 });+ await deleteMessageWithObjects(env, db, row.id, row.rawR2Key);+ return NextResponse.json({ ok: true });+}diff --git a/src/app/api/templates/route.ts b/src/app/api/templates/route.tsnew file mode 100644index 0000000..90f3295--- /dev/null+++ b/src/app/api/templates/route.ts@@ -0,0 +1,55 @@+import { and, desc, eq } from "drizzle-orm";+import { NextResponse } from "next/server";+import { getDb } from "@/db";+import { messages } from "@/db/schema";+import { requireSessionUser } from "@/lib/api/auth";+import { hasValidSessionMutationOrigin } from "@/lib/auth/origin";+import { getEnv } from "@/lib/cloudflare";+import { newId } from "@/lib/ids";+import { buildSnippet } from "@/lib/email/parse";+import { getDraftSender } from "../drafts/utils";++// Templates are outbound messages with status "template": they look like drafts+// in the database but no draft, folder or count query ever selects them.+export async function GET(request: Request) {+ const env = getEnv();+ const auth = await requireSessionUser(env, request);+ if (auth.error) return auth.error;+ const rows = await getDb(env)+ .select({ id: messages.id, subject: messages.subject, htmlBody: messages.htmlBody, textBody: messages.textBody })+ .from(messages)+ .where(and(eq(messages.userId, auth.user.id), eq(messages.status, "template")))+ .orderBy(desc(messages.createdAt))+ .limit(200);+ return NextResponse.json({ templates: rows });+}++export async function POST(request: Request) {+ const env = getEnv();+ const auth = await requireSessionUser(env, request);+ if (auth.error) return auth.error;+ if (!hasValidSessionMutationOrigin(request)) return NextResponse.json({ error: "Invalid origin" }, { status: 403 });+ const input = (await request.json().catch(() => null)) as { mailboxId?: string | null; from?: string; title?: string; html?: string; text?: string } | null;+ const title = input?.title?.trim().slice(0, 200);+ const html = input?.html ?? "";+ const text = input?.text ?? "";+ if (!title || !(html.trim() || text.trim())) return NextResponse.json({ error: "Enter a title and content." }, { status: 400 });+ const sender = await getDraftSender(env, auth.user.id, { mailboxId: input?.mailboxId, from: input?.from });+ if ("error" in sender) return NextResponse.json({ error: sender.error }, { status: 403 });+ const id = newId("msg");+ await getDb(env).insert(messages).values({+ id,+ userId: auth.user.id,+ mailboxId: sender.mailboxId,+ direction: "outbound",+ fromAddr: sender.fromAddr,+ toAddr: "",+ subject: title,+ snippet: buildSnippet(text || null, html || null),+ textBody: text || null,+ htmlBody: html || null,+ status: "template",+ read: true,+ });+ return NextResponse.json({ template: { id, subject: title, htmlBody: html || null, textBody: text || null } }, { status: 201 });+}diff --git a/src/app/globals.css b/src/app/globals.cssindex 5a3447f..0fc318a 100644--- a/src/app/globals.css+++ b/src/app/globals.css@@ -465,8 +465,8 @@ button {/* HTML emails assume a white background: keep them on light "paper" inside the dark theme */.dark .email-body {color-scheme: light;- background: #fff;- color: #202124;+ /* background: #fff; */+ /* color: #202124; */border-radius: 0.75rem;padding: 1rem;}diff --git a/src/components/compose/compose-form.tsx b/src/components/compose/compose-form.tsxindex a58bab2..7582d54 100644--- a/src/components/compose/compose-form.tsx+++ b/src/components/compose/compose-form.tsx@@ -516,8 +516,8 @@ export function ComposeForm({Drop files to attach</div>)}- <div className="flex h-9 shrink-0 items-center justify-between bg-neutral-800 px-4 text-sm font-medium text-white">- <span className="flex min-w-0 items-center gap-2 truncate">+ <div className="flex h-9 shrink-0 items-center justify-between bg-neutral-800 text-white dark:bg-neutral-100 px-4 text-sm font-medium">+ <span className="flex min-w-0 items-center gap-2 truncate dark:text-neutral-900">{threading?.inReplyTo && <Reply className="h-3.5 w-3.5 text-neutral-300" />}{!threading?.inReplyTo && /^fwd?:/i.test(subject) && <Forward className="h-3.5 w-3.5 text-neutral-300" />}{loadingDraft@@ -532,13 +532,13 @@ export function ComposeForm({</span>{mode === "popup" && (<div className="flex shrink-0 items-center gap-3 text-neutral-300">- <button type="button" onClick={() => { setMinimized((current) => !current); setDraggingFiles(false); }} aria-label={minimized ? "Restore composer" : "Minimize composer"} title={minimized ? "Restore composer" : "Minimize composer"} className="rounded p-1 hover:bg-neutral-700 hover:text-white">+ <button type="button" onClick={() => { setMinimized((current) => !current); setDraggingFiles(false); }} aria-label={minimized ? "Restore composer" : "Minimize composer"} title={minimized ? "Restore composer" : "Minimize composer"} className="rounded p-1 hover:bg-neutral-700 dark:hover:bg-neutral-200 hover:text-white">{minimized ? <ChevronUp className="h-4 w-4" /> : <Minus className="h-4 w-4" />}</button>- <button type="button" onClick={() => { if (minimized) setMinimized(false); setModalMode((current) => !current); }} aria-label={modalMode ? "Restore floating composer" : "Open composer as modal"} title={modalMode ? "Restore floating composer" : "Open composer as modal"} className="rounded p-1 hover:bg-neutral-700 hover:text-white">+ <button type="button" onClick={() => { if (minimized) setMinimized(false); setModalMode((current) => !current); }} aria-label={modalMode ? "Restore floating composer" : "Open composer as modal"} title={modalMode ? "Restore floating composer" : "Open composer as modal"} className="rounded p-1 dark:hover:bg-neutral-200 hover:bg-neutral-700 hover:text-white">{modalMode ? <Minimize2 className="h-4 w-4" /> : <Maximize2 className="h-4 w-4" />}</button>- <button type="button" onClick={onClose} aria-label="Close composer" className="rounded p-1 hover:bg-neutral-700 hover:text-white">+ <button type="button" onClick={onClose} aria-label="Close composer" className="rounded p-1 hover:bg-neutral-700 dark:hover:bg-neutral-200 hover:text-white"><X className="h-4 w-4" /></button></div>@@ -644,6 +644,12 @@ export function ComposeForm({disabled={loading || loadingDraft || !fromAddr}value={scheduledAt}onChange={setScheduledAt}+ mailboxId={selectedMailbox?.id}+ from={fromAddr}+ onApplyTemplate={({ title, html: templateHtml }) => {+ setSubject((current) => current.trim() ? current : title);+ setHtml((current) => (hasMeaningfulHtml(current) ? `${current}${templateHtml}` : templateHtml));+ }}/></div></>diff --git a/src/components/compose/new-template-dialog.tsx b/src/components/compose/new-template-dialog.tsxnew file mode 100644index 0000000..9d471fe--- /dev/null+++ b/src/components/compose/new-template-dialog.tsx@@ -0,0 +1,66 @@+"use client";++import { useState } from "react";+import { Button } from "@/components/ui/button";+import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";+import { Textarea } from "@/components/ui/textarea";+import { authFetch } from "@/lib/auth/client";+import { textToHtml } from "./rich-text-utils";+import type { NewTemplateDialogProps } from "./template-types";++export function NewTemplateDialog({ open, onOpenChange, mailboxId, from }: NewTemplateDialogProps) {+ const [title, setTitle] = useState("");+ const [content, setContent] = useState("");+ const [saving, setSaving] = useState(false);+ const [error, setError] = useState("");++ async function save() {+ setSaving(true);+ setError("");+ try {+ const response = await authFetch("/api/templates", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ mailboxId, from, title, text: content, html: textToHtml(content) }),+ });+ if (!response.ok) {+ setError(((await response.json().catch(() => null)) as { error?: string } | null)?.error ?? "Could not save template");+ return;+ }+ onOpenChange(false);+ setTitle("");+ setContent("");+ } catch {+ setError("Could not save template");+ } finally {+ setSaving(false);+ }+ }++ return (+ <Dialog open={open} onOpenChange={onOpenChange}>+ <DialogContent className="max-h-[calc(100vh-4rem)] overflow-y-auto">+ <DialogHeader><DialogTitle>New template</DialogTitle></DialogHeader>+ <form+ className="space-y-4"+ onSubmit={(event) => { event.preventDefault(); void save(); }}+ >+ <div className="space-y-1.5">+ <Label htmlFor="template-title">Title</Label>+ <Input id="template-title" value={title} onChange={(event) => setTitle(event.target.value)} maxLength={200} required />+ </div>+ <div className="space-y-1.5">+ <Label htmlFor="template-content">Content</Label>+ <Textarea id="template-content" value={content} onChange={(event) => setContent(event.target.value)} rows={8} required />+ </div>+ {error && <p className="text-sm text-red-600">{error}</p>}+ <Button type="submit" disabled={saving || !title.trim() || !content.trim()}>+ {saving ? "Saving…" : "Save template"}+ </Button>+ </form>+ </DialogContent>+ </Dialog>+ );+}diff --git a/src/components/compose/schedule-send-menu.tsx b/src/components/compose/schedule-send-menu.tsxindex a466bbc..c04c007 100644--- a/src/components/compose/schedule-send-menu.tsx+++ b/src/components/compose/schedule-send-menu.tsx@@ -1,7 +1,10 @@"use client";import * as DropdownMenu from "@radix-ui/react-dropdown-menu";-import { Check, ChevronDown, X } from "lucide-react";+import { useState } from "react";+import { ChevronDown, X } from "lucide-react";+import { NewTemplateDialog } from "./new-template-dialog";+import { TemplateMenu } from "./template-menu";import {formatDateTimeLocal,formatScheduledSend,@@ -11,11 +14,13 @@ import {import type { ScheduleSendMenuProps } from "./schedule-send-types";import { getUserTimeZone } from "@/lib/time/utils";-export function ScheduleSendMenu({ disabled, value, onChange }: ScheduleSendMenuProps) {+export function ScheduleSendMenu({ disabled, value, onChange, mailboxId, from, onApplyTemplate }: ScheduleSendMenuProps) {+ const [newTemplateOpen, setNewTemplateOpen] = useState(false);const options = getScheduleSendOptions();const minimum = new Date(Date.now() + 5 * 60 * 1000);return (+ <><DropdownMenu.Root><DropdownMenu.Triggertype="button"@@ -31,6 +36,9 @@ export function ScheduleSendMenu({ disabled, value, onChange }: ScheduleSendMenusideOffset={6}className="z-50 min-w-56 rounded-lg border border-neutral-200 bg-white p-1 text-sm shadow-lg">+ <TemplateMenu onApply={onApplyTemplate} onNew={() => setNewTemplateOpen(true)} />+ <DropdownMenu.Separator className="my-1 h-px bg-neutral-100" />+ <DropdownMenu.Label className="px-3 pb-1 pt-2 text-xs font-medium text-neutral-500">Schedule</DropdownMenu.Label>{value && (<><DropdownMenu.Item@@ -70,5 +78,7 @@ export function ScheduleSendMenu({ disabled, value, onChange }: ScheduleSendMenu</DropdownMenu.Content></DropdownMenu.Portal></DropdownMenu.Root>+ <NewTemplateDialog open={newTemplateOpen} onOpenChange={setNewTemplateOpen} mailboxId={mailboxId} from={from} />+ </>);}diff --git a/src/components/compose/schedule-send-types.d.ts b/src/components/compose/schedule-send-types.d.tsindex 3baaedb..bc46ddb 100644--- a/src/components/compose/schedule-send-types.d.ts+++ b/src/components/compose/schedule-send-types.d.ts@@ -7,4 +7,7 @@ export type ScheduleSendMenuProps = {disabled?: boolean;value: Date | null;onChange: (value: Date | null) => void;+ mailboxId?: string | null;+ from: string;+ onApplyTemplate: (template: { title: string; html: string }) => void;};diff --git a/src/components/compose/template-menu.tsx b/src/components/compose/template-menu.tsxnew file mode 100644index 0000000..a50c245--- /dev/null+++ b/src/components/compose/template-menu.tsx@@ -0,0 +1,67 @@+"use client";++import { useEffect, useState } from "react";+import * as DropdownMenu from "@radix-ui/react-dropdown-menu";+import { ChevronRight, FileText, Plus, Trash2 } from "lucide-react";+import { authFetch } from "@/lib/auth/client";+import { textToHtml } from "./rich-text-utils";+import type { ComposeTemplate, TemplateMenuProps } from "./template-types";++const itemClass = "flex cursor-pointer items-center rounded-md px-3 py-2 outline-none hover:bg-neutral-100 focus:bg-neutral-100";++export function TemplateMenu({ onApply, onNew }: TemplateMenuProps) {+ const [templates, setTemplates] = useState<ComposeTemplate[]>([]);++ useEffect(() => {+ void authFetch("/api/templates", { cache: "no-store" })+ .then(async (response) => {+ if (response.ok) setTemplates(((await response.json()) as { templates: ComposeTemplate[] }).templates);+ })+ .catch(() => {});+ }, []);+ async function remove(id: string) {+ const response = await authFetch(`/api/templates/${id}`, { method: "DELETE" });+ if (response.ok) setTemplates((current) => current.filter((template) => template.id !== id));+ }++ return (+ <DropdownMenu.Sub>+ <DropdownMenu.SubTrigger className={`${itemClass} justify-between data-[state=open]:bg-neutral-100`}>+ <span className="flex items-center"><FileText className="mr-2 h-4 w-4" />Template</span>+ <ChevronRight className="ml-4 h-4 w-4 text-neutral-400" />+ </DropdownMenu.SubTrigger>+ <DropdownMenu.Portal>+ <DropdownMenu.SubContent+ sideOffset={4}+ className="z-50 flex max-h-80 w-64 flex-col rounded-lg border border-neutral-200 bg-white p-1 text-sm shadow-lg"+ >+ <div className="min-h-0 flex-1 overflow-y-auto">+ {templates.length === 0 && <p className="px-3 py-2 text-xs text-neutral-400">No templates yet</p>}+ {templates.map((template) => (+ <DropdownMenu.Item+ key={template.id}+ onSelect={() => onApply({ title: template.subject ?? "", html: template.htmlBody ?? textToHtml(template.textBody ?? "") })}+ className={`${itemClass} group justify-between gap-2`}+ >+ <span className="whitespace-normal break-words">{template.subject || "Untitled"}</span>+ <button+ type="button"+ aria-label="Delete template"+ onPointerDown={(event) => event.stopPropagation()}+ onClick={(event) => { event.stopPropagation(); void remove(template.id); }}+ className="shrink-0 rounded p-1 text-neutral-400 opacity-0 hover:text-red-600 group-hover:opacity-100 group-focus:opacity-100"+ >+ <Trash2 className="h-3.5 w-3.5" />+ </button>+ </DropdownMenu.Item>+ ))}+ </div>+ <DropdownMenu.Separator className="my-1 h-px bg-neutral-100" />+ <DropdownMenu.Item onSelect={onNew} className={`${itemClass} text-blue-600`}>+ <Plus className="mr-2 h-4 w-4" />New template+ </DropdownMenu.Item>+ </DropdownMenu.SubContent>+ </DropdownMenu.Portal>+ </DropdownMenu.Sub>+ );+}diff --git a/src/components/compose/template-types.d.ts b/src/components/compose/template-types.d.tsnew file mode 100644index 0000000..6b0c0a7--- /dev/null+++ b/src/components/compose/template-types.d.ts@@ -0,0 +1,18 @@+export type ComposeTemplate = {+ id: string;+ subject: string | null;+ htmlBody: string | null;+ textBody: string | null;+};++export type TemplateMenuProps = {+ onApply: (template: { title: string; html: string }) => void;+ onNew: () => void;+};++export type NewTemplateDialogProps = {+ open: boolean;+ onOpenChange: (open: boolean) => void;+ mailboxId?: string | null;+ from: string;+};diff --git a/src/components/mailbox-selector.tsx b/src/components/mailbox-selector.tsxindex 003fb89..a849778 100644--- a/src/components/mailbox-selector.tsx+++ b/src/components/mailbox-selector.tsx@@ -373,14 +373,6 @@ export function MailboxSelector({ initialUser }: MailboxSelectorProps = {}) {)}<div className="mt-2 overflow-hidden rounded-[22px] bg-white">- <Link- href="/login?add=1"- onClick={() => setOpen(false)}- className="flex items-center gap-3 px-5 py-4 text-sm font-medium text-neutral-800 hover:bg-[#f2f6fc]"- >- <UserPlus size={18} className="text-neutral-600" />- Add another account- </Link>{user?.role === "admin" && (<Linkhref="/admin"@@ -392,6 +384,14 @@ export function MailboxSelector({ initialUser }: MailboxSelectorProps = {}) {{adminActive && <Check className="ml-auto h-4 w-4 text-blue-600" />}</Link>)}+ <Link+ href="/login?add=1"+ onClick={() => setOpen(false)}+ className="flex items-center gap-3 px-5 py-4 text-sm font-medium text-neutral-800 hover:bg-[#f2f6fc]"+ >+ <UserPlus size={18} className="text-neutral-600" />+ Add another account+ </Link><buttontype="button"onClick={logout}diff --git a/src/components/message-actions/message-actions.tsx b/src/components/message-actions/message-actions.tsxindex e7c32b6..e405421 100644--- a/src/components/message-actions/message-actions.tsx+++ b/src/components/message-actions/message-actions.tsx@@ -6,6 +6,7 @@ import { Archive, Ban, BellOff, Clock, FileCode2, Forward, Mail, MailOpen, MoreVimport { useCompose } from "@/components/compose/compose-context";import { MessageSourceDialog } from "@/components/messages/message-source-dialog";import { MessageSnoozeDialog } from "./message-snooze-dialog";+import { useIsMobile } from "@/components/sidebar-mobile-utils";import { useHotkeys, useShortcuts } from "@/components/shortcuts";import { Button } from "@/components/ui/button";import { Tooltip } from "@/components/ui/tooltip";@@ -43,6 +44,7 @@ export function MessageActions({bodyHtml,}: MessageActionsProps) {const router = useRouter();+ const isMobile = useIsMobile();const { openDraftComposer } = useCompose();const { shortcutsEnabled } = useShortcuts();const [pendingAction, setPendingAction] = useState<@@ -228,6 +230,40 @@ export function MessageActions({<div className="flex flex-wrap items-center gap-3 text-neutral-600 flex-1 min-w-0">{error && <span className="text-xs text-red-600">{error}</span>}+ {isMobile && (+ <>+ <Button+ type="button"+ variant="ghost"+ size="roundedSM"+ aria-label="Reply"+ disabled={disabled}+ onClick={() => handleReply("reply")}+ >+ <Reply size={iconSize} />+ </Button>+ <Button+ variant="ghost"+ size="roundedSM"+ aria-label="Move to trash"+ disabled={disabled || status === "trash"}+ onClick={() => runAction("trash")}+ >+ <Trash2 size={iconSize} />+ </Button>+ <Button+ variant="ghost"+ size="roundedSM"+ aria-label="Report spam"+ disabled={disabled || status === "spam" || direction !== "inbound"}+ onClick={() => runAction("spam")}+ >+ <ShieldAlert size={iconSize} />+ </Button>+ </>+ )}+ {!isMobile && (+ <><Tooltip label={shortcutsEnabled ? "Archive (e)" : "Archive"}><Buttonvariant="ghost"@@ -316,6 +352,8 @@ export function MessageActions({{read ? <Mail size={iconSize} /> : <MailOpen size={iconSize} />}</Button></Tooltip>+ </>+ )}<div className="relative"><Tooltip label="More actions"><Button@@ -334,6 +372,31 @@ export function MessageActions({{moreOpen && (<div className="absolute right-0 top-8 z-20 w-54 rounded-xl border border-neutral-200 bg-white p-2 shadow-lg">+ {isMobile && (+ <>+ <button type="button" className="flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm text-neutral-700 hover:bg-neutral-100 disabled:text-neutral-400" disabled={status === "archived"} onClick={() => void runAction("archive")}>+ <Archive className="h-4 w-4" />+ Archive+ </button>+ {canReplyAll && (+ <button type="button" className="flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm text-neutral-700 hover:bg-neutral-100 disabled:text-neutral-400" onClick={() => { setMoreOpen(false); void handleReply("replyAll"); }}>+ <ReplyAll className="h-4 w-4" />+ Reply all+ </button>+ )}+ {message && messageMeta && (+ <button type="button" className="flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm text-neutral-700 hover:bg-neutral-100 disabled:text-neutral-400" onClick={() => { setMoreOpen(false); void handleForward(); }}>+ <Forward className="h-4 w-4" />+ Forward+ </button>+ )}+ <button type="button" className="flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm text-neutral-700 hover:bg-neutral-100 disabled:text-neutral-400" onClick={() => void runAction(markAction)}>+ {read ? <Mail className="h-4 w-4" /> : <MailOpen className="h-4 w-4" />}+ {read ? "Mark as unread" : "Mark as read"}+ </button>+ <hr className="my-1 border-neutral-100" />+ </>+ )}{direction === "inbound" && status === "received" && (<buttontype="button"diff --git a/src/components/messages/message-folder-page.tsx b/src/components/messages/message-folder-page.tsxindex e6b739d..baff6bf 100644--- a/src/components/messages/message-folder-page.tsx+++ b/src/components/messages/message-folder-page.tsx@@ -402,7 +402,7 @@ export function MessageFolderPage({return (<div className="flex h-full min-h-0 flex-col">- <div className={`flex h-14 shrink-0 items-center justify-between border-b border-neutral-200 ${compact ? "px-4" : "px-6"}`}>+ <div className={`flex h-14 shrink-0 items-center justify-between border-b border-neutral-200 ${compact ? "px-4" : "px-4.5 md:px-6"}`}><div className="flex items-center gap-3 w-full"><Tooltip label="Select all visible messages"><Checkbox@@ -423,13 +423,8 @@ export function MessageFolderPage({folder={config.folderId ? undefined : config.folder}/>) : (- compact && (- <>- {/* <h1 className="truncate text-sm font-semibold text-neutral-900">- {config.title}- </h1>- <Badge variant="secondary">{total}</Badge> */}- </>+ (compact || isMobile) && (+ <h1 className="truncate font-semibold text-neutral-900 pl-1">{config.title}</h1>))}</div>diff --git a/src/components/messages/message-split-layout.tsx b/src/components/messages/message-split-layout.tsxindex 9642476..00fbe18 100644--- a/src/components/messages/message-split-layout.tsx+++ b/src/components/messages/message-split-layout.tsx@@ -95,7 +95,7 @@ export function MessageSplitLayout({)}<MessageListVisibilityContext.Provider value={{ visible: listVisible, toggle: () => { const visible = !manualListVisible; setManualListVisible(visible); saveMessageListVisible(visible); }, singleColumn: !twoColumnReading, backHref: config.hrefPrefix, backLabel: config.title }}><MessageDetailNavigationProvider config={config}>- <section className="min-h-0 min-w-0 overflow-hidden bg-white flex flex-col">+ <section className="min-h-0 min-w-0 overflow-hidden bg-white flex flex-col h-full">{twoColumnReading && selectedMessages.length > 0 ? (<BulkMessageSelectionPanefolder={config.folder}