Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

feat: adjust the email UIUX

Guse0ac8998e54f
diff --git a/src/web/src/app/(app)/w/[slug]/agents/[id]/email/page.tsx b/src/web/src/app/(app)/w/[slug]/agents/[id]/email/page.tsx
index 0fe5d7a91..a40d752a8 100644
--- a/src/web/src/app/(app)/w/[slug]/agents/[id]/email/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/agents/[id]/email/page.tsx
@@ -13,7 +13,8 @@ import { EmailCompose } from "@/components/email-compose";
import { cn } from "@/lib/utils";
import { toast } from "sonner";
import { Skeleton } from "@/components/ui/skeleton";
-import { Loader2, Mail, Inbox, Send, Plus, Trash2, Forward, Paperclip, File as FileIcon } from "lucide-react";
+import { Loader2, Mail, Inbox, Send, Plus, Trash2, Forward, Paperclip, File as FileIcon, Copy, Check } from "lucide-react";
+import { ResizablePanels } from "@/components/ui/resizable-panels";
type Folder = "inbox" | "sent";
@@ -154,235 +155,278 @@ export default function AgentEmailPage() {
};
const fromAddress = agent?.email_handle ? `${agent.email_handle}@alook.ai` : "";
+ const [copied, setCopied] = useState(false);
- return (
- <div className="flex flex-1 min-h-0">
- {/* Column 1: Folder sidebar */}
- <div className="flex w-45 shrink-0 flex-col border-r border-border/40">
- <div className="p-2">
- <Button
- size="sm"
- className="w-full text-xs h-8 gap-1.5"
- onClick={() => { setComposeInitial({}); setComposing(true); setSelectedId(null); }}
- disabled={!agent?.email_handle}
- title={!agent?.email_handle ? "Configure an email handle in agent settings to send emails" : "Compose new email"}
- >
- <Plus className="size-3.5" />
- New Email
- </Button>
+ const handleCopyAddress = async () => {
+ if (!fromAddress) return;
+ try {
+ await navigator.clipboard.writeText(fromAddress);
+ setCopied(true);
+ setTimeout(() => setCopied(false), 1500);
+ } catch {
+ toast.error("Failed to copy");
+ }
+ };
+
+ const sidebarContent = (
+ <div className="flex h-full flex-col">
+ {fromAddress ? (
+ <button
+ type="button"
+ onClick={handleCopyAddress}
+ className="group flex items-center gap-1.5 px-3 pt-3 pb-1 text-left cursor-pointer"
+ title="Click to copy"
+ >
+ <span className="text-xs text-muted-foreground truncate">{fromAddress}</span>
+ {copied ? (
+ <Check className="size-2.5 text-green-500 shrink-0" />
+ ) : (
+ <Copy className="size-2.5 text-muted-foreground/0 group-hover:text-muted-foreground/60 shrink-0 transition-colors" />
+ )}
+ </button>
+ ) : (
+ <div className="px-3 pt-3 pb-1">
+ <p className="text-xs text-muted-foreground/60">No email handle configured</p>
</div>
- <nav className="flex flex-col gap-0.5 px-2">
+ )}
+ <div className="p-2">
+ <Button
+ size="sm"
+ className="w-full justify-start text-xs h-8 gap-1.5"
+ onClick={() => { setComposeInitial({}); setComposing(true); setSelectedId(null); }}
+ disabled={!agent?.email_handle}
+ title={!agent?.email_handle ? "Configure an email handle in agent settings to send emails" : "Compose new email"}
+ >
+ <Plus className="size-3.5" />
+ New Email
+ </Button>
+ </div>
+ <nav className="flex flex-col gap-0.5 px-2">
+ <button
+ type="button"
+ onClick={() => setFolder("inbox")}
+ className={cn(
+ "flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer",
+ folder === "inbox"
+ ? "bg-accent text-foreground font-medium"
+ : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
+ )}
+ >
+ <Inbox className="size-4 shrink-0" />
+ Inbox
+ </button>
+ <button
+ type="button"
+ onClick={() => setFolder("sent")}
+ className={cn(
+ "flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer",
+ folder === "sent"
+ ? "bg-accent text-foreground font-medium"
+ : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
+ )}
+ >
+ <Send className="size-4 shrink-0" />
+ Sent
+ </button>
+ </nav>
+ </div>
+ );
+
+ const emailListContent = (
+ <div className={cn("h-full", emails.length > 0 && !loading ? "overflow-y-auto" : "overflow-hidden")}>
+ {loading ? (
+ <>
+ {Array.from({ length: 3 }).map((_, i) => (
+ <div key={i} className="px-4 py-3 border-b border-border/30">
+ <div className="flex items-center justify-between gap-2 mb-1.5">
+ <Skeleton className="h-3.5 w-32" />
+ <Skeleton className="h-2.5 w-10" />
+ </div>
+ <Skeleton className="h-3.5 w-48 mb-1.5" />
+ <Skeleton className="h-4 w-16 rounded-full" />
+ </div>
+ ))}
+ </>
+ ) : emails.length === 0 ? (
+ <div className="flex flex-col items-center justify-center h-full animate-[fade-up_400ms_ease-out_both]">
+ <Mail className="size-8 text-muted-foreground mb-3" />
+ <p className="text-sm text-muted-foreground">
+ {folder === "inbox" ? "No emails received yet" : "No emails sent yet"}
+ </p>
+ </div>
+ ) : (
+ emails.map((email) => (
<button
+ key={email.id}
type="button"
- onClick={() => setFolder("inbox")}
+ onClick={() => handleSelect(email.id)}
className={cn(
- "flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer",
- folder === "inbox"
- ? "bg-accent text-foreground font-medium"
- : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
+ "w-full text-left px-4 py-3 border-b border-border/30 transition-colors duration-150 cursor-pointer",
+ selectedId === email.id
+ ? "bg-accent/60"
+ : "hover:bg-accent/30"
)}
>
- <Inbox className="size-4 shrink-0" />
- Inbox
- </button>
- <button
- type="button"
- onClick={() => setFolder("sent")}
- className={cn(
- "flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer",
- folder === "sent"
- ? "bg-accent text-foreground font-medium"
- : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
+ <div className="flex items-center justify-between gap-2 mb-0.5">
+ <p className="text-sm font-medium truncate">
+ {folder === "inbox" ? email.from_email : email.to_email}
+ </p>
+ <span className="text-xs text-muted-foreground shrink-0">
+ {relativeTime(email.created_at)}
+ </span>
+ </div>
+ <p className="text-[13px] truncate text-muted-foreground">
+ {email.subject || "(no subject)"}
+ </p>
+ {folder === "inbox" && (
+ <div className="mt-1">
+ {email.is_whitelisted ? (
+ <Badge className="text-[11px] h-4 px-1">triggered</Badge>
+ ) : (
+ <Badge variant="secondary" className="text-[11px] h-4 px-1">
+ forwarded
+ </Badge>
+ )}
+ </div>
)}
- >
- <Send className="size-4 shrink-0" />
- Sent
</button>
- </nav>
- </div>
+ ))
+ )}
+ </div>
+ );
- {/* Column 2: Email list */}
- <div className={cn("w-75 shrink-0 border-r border-border/40", emails.length > 0 && !loading ? "overflow-y-auto" : "overflow-hidden")}>
- {loading ? (
- <>
- {Array.from({ length: 3 }).map((_, i) => (
- <div key={i} className="px-4 py-3 border-b border-border/30">
- <div className="flex items-center justify-between gap-2 mb-1.5">
- <Skeleton className="h-3.5 w-32" />
- <Skeleton className="h-2.5 w-10" />
- </div>
- <Skeleton className="h-3.5 w-48 mb-1.5" />
- <Skeleton className="h-4 w-16 rounded-full" />
- </div>
- ))}
- </>
- ) : emails.length === 0 ? (
- <div className="flex flex-col items-center justify-center h-full animate-[fade-up_400ms_ease-out_both]">
- <Mail className="size-8 text-muted-foreground/40 mb-3" />
- <p className="text-sm text-muted-foreground">
- {folder === "inbox" ? "No emails received yet." : "No emails sent yet."}
- </p>
- </div>
- ) : (
- emails.map((email) => (
- <button
- key={email.id}
- type="button"
- onClick={() => handleSelect(email.id)}
- className={cn(
- "w-full text-left px-4 py-3 border-b border-border/30 transition-colors duration-150 cursor-pointer",
- selectedId === email.id
- ? "bg-accent/60"
- : "hover:bg-accent/30"
- )}
+ const readingPaneContent = (
+ <div className="h-full overflow-auto flex flex-col min-w-0">
+ {composing ? (
+ <EmailCompose
+ key={JSON.stringify(composeInitial)}
+ fromAddress={fromAddress}
+ onSend={handleSend}
+ onDiscard={() => { setComposing(false); setComposeInitial({}); }}
+ initialTo={composeInitial.to}
+ initialSubject={composeInitial.subject}
+ initialBody={composeInitial.body}
+ initialAttachments={composeInitial.attachments}
+ />
+ ) : !selected ? (
+ <div className="flex items-center justify-center h-full text-sm text-muted-foreground">
+ Select an email to view
+ </div>
+ ) : (
+ <div className="flex flex-col h-full min-w-[400px] max-w-3xl mx-auto w-full">
+ {/* Detail toolbar */}
+ <div className="flex items-center gap-0.5 border-b border-border/40 px-4 py-1.5">
+ <Button
+ variant="ghost"
+ size="icon"
+ className="size-7 text-muted-foreground/60 hover:text-foreground"
+ title="Forward"
+ onClick={() => handleForward(selected)}
>
- <div className="flex items-center justify-between gap-2 mb-0.5">
- <p className="text-sm font-medium truncate">
- {folder === "inbox" ? email.from_email : email.to_email}
- </p>
- <span className="text-[10px] text-muted-foreground shrink-0">
- {relativeTime(email.created_at)}
- </span>
- </div>
- <p className="text-sm truncate text-muted-foreground">
- {email.subject || "(no subject)"}
- </p>
- {folder === "inbox" && (
- <div className="mt-1">
- {email.is_whitelisted ? (
- <Badge className="text-[10px] h-4 px-1">triggered</Badge>
- ) : (
- <Badge variant="secondary" className="text-[10px] h-4 px-1">
- forwarded
- </Badge>
- )}
- </div>
- )}
- </button>
- ))
- )}
- </div>
-
- {/* Column 3: Reading pane */}
- <div className="flex-1 overflow-y-auto flex flex-col min-w-0">
- {composing ? (
- <EmailCompose
- key={JSON.stringify(composeInitial)}
- fromAddress={fromAddress}
- onSend={handleSend}
- onDiscard={() => { setComposing(false); setComposeInitial({}); }}
- initialTo={composeInitial.to}
- initialSubject={composeInitial.subject}
- initialBody={composeInitial.body}
- initialAttachments={composeInitial.attachments}
- />
- ) : !selected ? (
- <div className="flex items-center justify-center h-full text-sm text-muted-foreground">
- Select an email to view
+ <Forward className="size-3.5" />
+ </Button>
+ <Button
+ variant="ghost"
+ size="icon"
+ className="size-7 text-muted-foreground/60 hover:text-destructive"
+ title="Delete"
+ onClick={() => {
+ setDeleteTarget(selected.id);
+ setDeleteConfirmOpen(true);
+ }}
+ >
+ <Trash2 className="size-3.5" />
+ </Button>
</div>
- ) : (
- <div className="flex flex-col h-full">
- {/* Detail toolbar */}
- <div className="flex items-center gap-0.5 border-b border-border/40 px-4 py-1.5">
- <Button
- variant="ghost"
- size="icon"
- className="size-7 text-muted-foreground/60 hover:text-foreground"
- title="Forward"
- onClick={() => handleForward(selected)}
- >
- <Forward className="size-3.5" />
- </Button>
- <Button
- variant="ghost"
- size="icon"
- className="size-7 text-muted-foreground/60 hover:text-destructive"
- title="Delete"
- onClick={() => {
- setDeleteTarget(selected.id);
- setDeleteConfirmOpen(true);
- }}
- >
- <Trash2 className="size-3.5" />
- </Button>
- </div>
- {/* Email detail */}
- <div className="p-5 max-w-2xl">
- <h2 className="text-lg font-medium mb-1">
- {selected.subject || "(no subject)"}
- </h2>
- {folder === "inbox" && (
- <div className="flex items-center gap-2 mb-4">
- {selected.is_whitelisted ? (
- <Badge className="text-[10px] h-4 px-1">triggered</Badge>
- ) : (
- <Badge variant="secondary" className="text-[10px] h-4 px-1">
- forwarded
- </Badge>
- )}
- </div>
- )}
- <div className="text-sm text-muted-foreground space-y-0.5 mb-5">
- <p>
- <span className="font-medium text-foreground">From:</span>{" "}
- {selected.from_email}
- </p>
- <p>
- <span className="font-medium text-foreground">To:</span>{" "}
- {selected.to_email}
- </p>
- <p>
- <span className="font-medium text-foreground">
- {folder === "inbox" ? "Received:" : "Sent:"}
- </span>{" "}
+ {/* Email detail */}
+ <div className="p-5">
+ <h2 className="text-lg font-heading font-semibold tracking-tight mb-1">
+ {selected.subject || "(no subject)"}
+ </h2>
+ {folder === "inbox" && (
+ <div className="flex items-center gap-2 mb-4">
+ {selected.is_whitelisted ? (
+ <Badge className="text-[11px] h-4 px-1">triggered</Badge>
+ ) : (
+ <Badge variant="secondary" className="text-[11px] h-4 px-1">
+ forwarded
+ </Badge>
+ )}
+ </div>
+ )}
+ <div className="text-sm space-y-1 mb-5">
+ <div className="flex items-center gap-2">
+ <span className="text-muted-foreground w-16 shrink-0">From</span>
+ <span>{selected.from_email}</span>
+ </div>
+ <div className="flex items-center gap-2">
+ <span className="text-muted-foreground w-16 shrink-0">To</span>
+ <span>{selected.to_email}</span>
+ </div>
+ <div className="flex items-center gap-2">
+ <span className="text-muted-foreground w-16 shrink-0">
+ {folder === "inbox" ? "Received" : "Sent"}
+ </span>
+ <span className="text-muted-foreground">
{new Date(selected.created_at).toLocaleString()}
- </p>
+ </span>
</div>
+ </div>
- <div className="rounded-lg border border-border/50 bg-background/50 p-4">
- {bodyLoading ? (
- <div className="flex items-center justify-center py-8">
- <Loader2 className="size-4 animate-spin text-muted-foreground" />
- </div>
- ) : selected.from_email === fromAddress && selected.html_body ? (
- <div
- className="prose prose-sm max-w-none"
- dangerouslySetInnerHTML={{ __html: selected.html_body }}
- />
- ) : (
- <pre className="text-sm whitespace-pre-wrap font-mono leading-relaxed">
- {body}
- </pre>
- )}
+ {bodyLoading ? (
+ <div className="flex items-center justify-center py-8">
+ <Loader2 className="size-4 animate-spin text-muted-foreground" />
</div>
+ ) : selected.html_body ? (
+ <div
+ className="markdown max-w-full text-base text-foreground"
+ dangerouslySetInnerHTML={{ __html: selected.html_body }}
+ />
+ ) : (
+ <div className="text-sm whitespace-pre-wrap leading-[1.65] text-foreground">
+ {body}
+ </div>
+ )}
- {selected.attachments && selected.attachments.length > 0 && (
- <div className="mt-4">
- <div className="flex items-center gap-1.5 mb-2 text-xs text-muted-foreground">
- <Paperclip className="size-3" />
- {selected.attachments.length} attachment{selected.attachments.length > 1 ? "s" : ""}
- </div>
- <div className="flex flex-wrap gap-1.5">
- {selected.attachments.map((att) => (
- <div
- key={att.key}
- className="flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/50 px-2.5 py-1.5 text-xs"
- >
- <FileIcon className="size-3 text-muted-foreground shrink-0" />
- <span className="truncate max-w-45">{att.filename}</span>
- <span className="text-muted-foreground shrink-0">
- {att.size < 1024 ? `${att.size} B` : att.size < 1024 * 1024 ? `${(att.size / 1024).toFixed(1)} KB` : `${(att.size / (1024 * 1024)).toFixed(1)} MB`}
- </span>
- </div>
- ))}
- </div>
+ {selected.attachments && selected.attachments.length > 0 && (
+ <div className="mt-4">
+ <div className="flex items-center gap-1.5 mb-2 text-xs text-muted-foreground">
+ <Paperclip className="size-3" />
+ {selected.attachments.length} attachment{selected.attachments.length > 1 ? "s" : ""}
</div>
- )}
- </div>
+ <div className="flex flex-wrap gap-1.5">
+ {selected.attachments.map((att) => (
+ <div
+ key={att.key}
+ className="flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/50 px-2.5 py-1.5 text-xs"
+ >
+ <FileIcon className="size-3 text-muted-foreground shrink-0" />
+ <span className="truncate max-w-45">{att.filename}</span>
+ <span className="text-muted-foreground shrink-0">
+ {att.size < 1024 ? `${att.size} B` : att.size < 1024 * 1024 ? `${(att.size / 1024).toFixed(1)} KB` : `${(att.size / (1024 * 1024)).toFixed(1)} MB`}
+ </span>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
</div>
- )}
- </div>
+ </div>
+ )}
+ </div>
+ );
+
+ return (
+ <>
+ <ResizablePanels
+ storageKey="email-panel-sizes"
+ panels={[
+ { defaultWidth: 180, minWidth: 120, maxWidth: 240, children: sidebarContent },
+ { defaultWidth: 300, minWidth: 200, maxWidth: 480, children: emailListContent },
+ { children: readingPaneContent, minWidth: 300 },
+ ]}
+ />
{/* Delete confirmation dialog */}
<ConfirmDialog
@@ -393,6 +437,6 @@ export default function AgentEmailPage() {
loading={deleting}
onConfirm={handleDelete}
/>
- </div>
+ </>
);
}
diff --git a/src/web/src/app/(app)/w/[slug]/agents/[id]/layout.tsx b/src/web/src/app/(app)/w/[slug]/agents/[id]/layout.tsx
index ba0968b5c..104a5413b 100644
--- a/src/web/src/app/(app)/w/[slug]/agents/[id]/layout.tsx
+++ b/src/web/src/app/(app)/w/[slug]/agents/[id]/layout.tsx
@@ -52,16 +52,20 @@ export default function AgentDetailLayout({ children }: { children: ReactNode })
)}
{agent ? (
<Link
- href={`/w/${slug}/agents/${agentId}/email`}
+ href={`/w/${slug}/agents/${agentId}/chat`}
onClick={() => setEditing(false)}
className="text-sm font-medium truncate hover:text-foreground/80 transition-colors"
>
- {agent.name}
+ <span title={agent.description || "No description"}>
+ {agent.name}
+ </span>
</Link>
) : (
<Skeleton className="h-3.5 w-24" />
)}
- {editing && <span className="text-xs text-muted-foreground">/ Settings</span>}
+ <span className="text-xs text-muted-foreground">
+ / {editing ? "Settings" : isOnChat ? "Chat" : "Email"}
+ </span>
</div>
{agent ? (
<div className="flex items-center gap-0.5 shrink-0">
diff --git a/src/web/src/app/(app)/w/[slug]/agents/[id]/page.tsx b/src/web/src/app/(app)/w/[slug]/agents/[id]/page.tsx
index ef404f1f5..b1f4a9d65 100644
--- a/src/web/src/app/(app)/w/[slug]/agents/[id]/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/agents/[id]/page.tsx
@@ -6,5 +6,5 @@ export default async function AgentDetailPage({
params: Promise<{ slug: string; id: string }>;
}) {
const { slug, id } = await params;
- redirect(`/w/${slug}/agents/${id}/email`);
+ redirect(`/w/${slug}/agents/${id}/chat`);
}
diff --git a/src/web/src/app/api/agents/[id]/route.test.ts b/src/web/src/app/api/agents/[id]/route.test.ts
index 58663d0b9..f9986c01e 100644
--- a/src/web/src/app/api/agents/[id]/route.test.ts
+++ b/src/web/src/app/api/agents/[id]/route.test.ts
@@ -144,4 +144,5 @@ describe("PATCH /api/agents/[id]", () => {
expect(res.status).toBe(400);
expect(body.error).toBe("invalid request body");
});
+
});
diff --git a/src/web/src/app/globals.css b/src/web/src/app/globals.css
index 5f1c00b53..23b262893 100644
--- a/src/web/src/app/globals.css
+++ b/src/web/src/app/globals.css
@@ -845,8 +845,13 @@
.markdown em { font-style: italic; }
/* ── TipTap editor styles ── */
+.tiptap { line-height: 1.6; }
+.tiptap p { margin: 0.25em 0; }
+.tiptap > p:first-child { margin-top: 0; }
+.tiptap > p:last-child { margin-bottom: 0; }
.tiptap p.is-editor-empty:first-child::before {
color: var(--muted-foreground);
+ opacity: 0.5;
content: attr(data-placeholder);
float: left;
height: 0;
diff --git a/src/web/src/components/agent-edit-form.tsx b/src/web/src/components/agent-edit-form.tsx
index 84452c577..128573193 100644
--- a/src/web/src/components/agent-edit-form.tsx
+++ b/src/web/src/components/agent-edit-form.tsx
@@ -96,29 +96,34 @@ export function AgentEditForm({
/>
</div>
- <div className="space-y-1.5">
- <Label htmlFor="agent-handle">Email Handle</Label>
- <div className="flex items-center gap-0">
- <Input
- id="agent-handle"
- value={emailHandle}
- onChange={(e) => setEmailHandle(e.target.value.toLowerCase())}
- placeholder={derivedHandle || "my-agent"}
- className="rounded-r-none"
- />
- <span className="inline-flex h-8 items-center rounded-r-lg border border-l-0 border-input bg-muted px-2.5 text-sm text-muted-foreground">
- @alook.ai
- </span>
- </div>
- {effectiveHandle && (
- <p className={cn(
- "text-xs",
- handleError ? "text-destructive" : "text-muted-foreground"
- )}>
- {handleError || `${effectiveHandle}@alook.ai`}
+ {!agent && (
+ <div className="space-y-1.5">
+ <Label htmlFor="agent-handle">Email Handle</Label>
+ <div className="flex items-center gap-0">
+ <Input
+ id="agent-handle"
+ value={emailHandle}
+ onChange={(e) => setEmailHandle(e.target.value.toLowerCase())}
+ placeholder={derivedHandle || "my-agent"}
+ className="rounded-r-none"
+ />
+ <span className="inline-flex h-8 items-center rounded-r-lg border border-l-0 border-input bg-muted px-2.5 text-sm text-muted-foreground">
+ @alook.ai
+ </span>
+ </div>
+ {effectiveHandle && (
+ <p className={cn(
+ "text-xs",
+ handleError ? "text-destructive" : "text-muted-foreground"
+ )}>
+ {handleError || `${effectiveHandle}@alook.ai`}
+ </p>
+ )}
+ <p className="text-xs text-muted-foreground/70">
+ This cannot be changed after creation.
</p>
- )}
- </div>
+ </div>
+ )}
<div className="space-y-1.5">
<Label htmlFor="agent-instructions">Instructions</Label>
@@ -131,28 +136,16 @@ export function AgentEditForm({
/>
</div>
- <div className="space-y-1.5">
- <Label htmlFor="agent-runtime">Runtime</Label>
- {agent ? (
- <p className="text-sm text-muted-foreground">
- {(() => {
- const rt = runtimes.find((r) => r.id === agent.runtime_id);
- if (!rt) return "Unknown runtime";
- const machine =
- (typeof rt.device_info === "string" ? rt.device_info : "") ||
- rt.name ||
- "";
- return machine ? `${rt.provider} (${machine})` : rt.provider;
- })()}
- </p>
- ) : (
+ {!agent && (
+ <div className="space-y-1.5">
+ <Label htmlFor="agent-runtime">Runtime</Label>
<RuntimeSelect
value={runtimeId}
onValueChange={setRuntimeId}
runtimes={runtimes}
/>
- )}
- </div>
+ </div>
+ )}
<div className="flex items-center gap-2 pt-2">
<Button
@@ -171,6 +164,31 @@ export function AgentEditForm({
{saving ? savingLabel : submitLabel}
</Button>
</div>
+
+ {agent && (
+ <div className="space-y-3 border-t border-border/40 pt-4">
+ <div className="space-y-1">
+ <Label className="text-muted-foreground">Email Handle</Label>
+ <p className="text-sm text-muted-foreground">
+ {agent.email_handle ? `${agent.email_handle}@alook.ai` : "Not configured"}
+ </p>
+ </div>
+ <div className="space-y-1">
+ <Label className="text-muted-foreground">Runtime</Label>
+ <p className="text-sm text-muted-foreground">
+ {(() => {
+ const rt = runtimes.find((r) => r.id === agent.runtime_id);
+ if (!rt) return "Unknown runtime";
+ const machine =
+ (typeof rt.device_info === "string" ? rt.device_info : "") ||
+ rt.name ||
+ "";
+ return machine ? `${rt.provider} (${machine})` : rt.provider;
+ })()}
+ </p>
+ </div>
+ </div>
+ )}
</form>
</div>
);
diff --git a/src/web/src/components/email-compose.tsx b/src/web/src/components/email-compose.tsx
index 15e64dd49..f37f5aee5 100644
--- a/src/web/src/components/email-compose.tsx
+++ b/src/web/src/components/email-compose.tsx
@@ -127,9 +127,9 @@ export function EmailCompose({
};
return (
- <div className="flex flex-col h-full">
+ <div className="flex flex-col h-full w-full min-w-0">
<div className="flex items-center justify-between border-b border-border/40 px-4 py-2">
- <h3 className="text-sm font-medium">New Email</h3>
+ <h3 className="text-sm font-heading font-medium tracking-tight">New Email</h3>
<div className="flex items-center gap-1">
<Button
variant="ghost"
@@ -157,31 +157,35 @@ export function EmailCompose({
</div>
</div>
- <div className="border-b border-border/30 px-4 py-2 space-y-2">
- <div className="flex items-center gap-2 text-sm">
- <span className="text-muted-foreground w-14 shrink-0">From:</span>
- <span className="text-foreground/70">{fromAddress}</span>
+ <div className="border-b border-border/30 px-4 py-2.5 space-y-1 min-w-0">
+ <div className="flex items-center gap-2 text-sm min-w-0">
+ <span className="text-muted-foreground w-16 shrink-0">From</span>
+ <span className="text-muted-foreground truncate min-w-0">{fromAddress}</span>
</div>
- <div className="flex items-center gap-2 text-sm">
- <span className="text-muted-foreground w-14 shrink-0">To:</span>
- <Input
- type="email"
- value={to}
- onChange={(e) => setTo(e.target.value)}
- placeholder="[email protected]"
- className="h-7 text-sm border-0 bg-transparent px-0 shadow-none focus-visible:ring-0"
- disabled={sending}
- />
+ <div className="flex items-center gap-2 text-sm min-w-0">
+ <span className="text-muted-foreground w-16 shrink-0">To</span>
+ <div className="flex-1 min-w-0 -ml-1.5 rounded-md bg-muted/40">
+ <Input
+ type="email"
+ value={to}
+ onChange={(e) => setTo(e.target.value)}
+ placeholder="[email protected]"
+ className="h-7 text-sm border-0 bg-transparent px-1.5 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground/50"
+ disabled={sending}
+ />
+ </div>
</div>
- <div className="flex items-center gap-2 text-sm">
- <span className="text-muted-foreground w-14 shrink-0">Subject:</span>
- <Input
- value={subject}
- onChange={(e) => setSubject(e.target.value)}
- placeholder="Email subject"
- className="h-7 text-sm border-0 bg-transparent px-0 shadow-none focus-visible:ring-0"
- disabled={sending}
- />
+ <div className="flex items-center gap-2 text-sm min-w-0">
+ <span className="text-muted-foreground w-16 shrink-0">Subject</span>
+ <div className="flex-1 min-w-0 -ml-1.5 rounded-md bg-muted/40">
+ <Input
+ value={subject}
+ onChange={(e) => setSubject(e.target.value)}
+ placeholder="Email subject"
+ className="h-7 text-sm border-0 bg-transparent px-1.5 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground/50"
+ disabled={sending}
+ />
+ </div>
</div>
</div>
diff --git a/src/web/src/components/email-toolbar.tsx b/src/web/src/components/email-toolbar.tsx
index 45d2b5ad1..4bef29882 100644
--- a/src/web/src/components/email-toolbar.tsx
+++ b/src/web/src/components/email-toolbar.tsx
@@ -84,7 +84,7 @@ export function EmailToolbar({ editor }: EmailToolbarProps) {
};
return (
- <div className="flex items-center gap-0.5 border-b border-border/30 px-3 py-1">
+ <div className="flex items-center gap-0.5 px-3 py-1 overflow-x-auto">
{/* Inline formatting */}
<ToolbarButton
title="Bold"
diff --git a/src/web/src/components/runtime-select.tsx b/src/web/src/components/runtime-select.tsx
index 75f271e35..337b271fa 100644
--- a/src/web/src/components/runtime-select.tsx
+++ b/src/web/src/components/runtime-select.tsx
@@ -73,7 +73,7 @@ export function RuntimeSelect({
<SelectTrigger>
<SelectValue placeholder={getPlaceholder(runtimes)} />
</SelectTrigger>
- <SelectPopup portal={false}>
+ <SelectPopup>
{Array.from(groups.entries()).map(([key, group]) => (
<SelectGroup key={key}>
<SelectGroupLabel className="truncate">
diff --git a/src/web/src/components/ui/resizable-panels.tsx b/src/web/src/components/ui/resizable-panels.tsx
new file mode 100644
index 000000000..ee09640dd
--- /dev/null
+++ b/src/web/src/components/ui/resizable-panels.tsx
@@ -0,0 +1,135 @@
+"use client";
+
+import {
+ useRef,
+ useCallback,
+ type ReactNode,
+ type CSSProperties,
+} from "react";
+import { useLocalStorage } from "@/hooks/use-local-storage";
+
+export interface PanelConfig {
+ /** Default width in px. Omit (or set 0) for the flex panel. */
+ defaultWidth?: number;
+ minWidth?: number;
+ maxWidth?: number;
+ children: ReactNode;
+ className?: string;
+}
+
+interface ResizablePanelsProps {
+ panels: PanelConfig[];
+ /** localStorage key for persisting widths */
+ storageKey: string;
+}
+
+export function ResizablePanels({ panels, storageKey }: ResizablePanelsProps) {
+ const defaults = panels.map((p) => p.defaultWidth ?? 0);
+ const [widths, setWidths] = useLocalStorage<number[]>(storageKey, defaults);
+
+ // Ensure stored array length matches panels
+ const safeWidths =
+ widths.length === panels.length ? widths : defaults;
+
+ const dragging = useRef<{
+ index: number;
+ startX: number;
+ startLeft: number;
+ startRight: number;
+ } | null>(null);
+
+ const handlePointerDown = useCallback(
+ (dividerIndex: number, e: React.PointerEvent) => {
+ e.preventDefault();
+ (e.target as HTMLElement).setPointerCapture(e.pointerId);
+ dragging.current = {
+ index: dividerIndex,
+ startX: e.clientX,
+ startLeft: safeWidths[dividerIndex],
+ startRight: safeWidths[dividerIndex + 1],
+ };
+ },
+ [safeWidths]
+ );
+
+ const handlePointerMove = useCallback(
+ (e: React.PointerEvent) => {
+ if (!dragging.current) return;
+ const { index, startX, startLeft, startRight } = dragging.current;
+ const delta = e.clientX - startX;
+
+ const leftPanel = panels[index];
+ const rightPanel = panels[index + 1];
+ const minL = leftPanel.minWidth ?? 60;
+ const maxL = leftPanel.maxWidth ?? Infinity;
+ const minR = rightPanel.minWidth ?? 60;
+ const maxR = rightPanel.maxWidth ?? Infinity;
+
+ // If right panel is the flex panel (defaultWidth 0), only resize left
+ if ((rightPanel.defaultWidth ?? 0) === 0) {
+ const newLeft = Math.max(minL, Math.min(maxL, startLeft + delta));
+ setWidths((prev) => {
+ const next = [...(prev.length === panels.length ? prev : defaults)];
+ next[index] = newLeft;
+ return next;
+ });
+ return;
+ }
+
+ // Both fixed panels — redistribute
+ let newLeft = startLeft + delta;
+ let newRight = startRight - delta;
+
+ if (newLeft < minL) { newLeft = minL; newRight = startLeft + startRight - minL; }
+ if (newLeft > maxL) { newLeft = maxL; newRight = startLeft + startRight - maxL; }
+ if (newRight < minR) { newRight = minR; newLeft = startLeft + startRight - minR; }
+ if (newRight > maxR) { newRight = maxR; newLeft = startLeft + startRight - maxR; }
+
+ setWidths((prev) => {
+ const next = [...(prev.length === panels.length ? prev : defaults)];
+ next[index] = newLeft;
+ next[index + 1] = newRight;
+ return next;
+ });
+ },
+ [panels, defaults, setWidths]
+ );
+
+ const handlePointerUp = useCallback(() => {
+ dragging.current = null;
+ }, []);
+
+ return (
+ <div
+ className="flex flex-1 min-h-0"
+ onPointerMove={handlePointerMove}
+ onPointerUp={handlePointerUp}
+ >
+ {panels.map((panel, i) => {
+ const isFlex = (panel.defaultWidth ?? 0) === 0;
+ const style: CSSProperties = isFlex
+ ? { flex: 1, minWidth: 0, overflow: "auto" }
+ : { width: safeWidths[i], flexShrink: 0 };
+
+ return (
+ <div key={i} className="flex min-h-0" style={isFlex ? { flex: 1, minWidth: 0 } : undefined}>
+ <div style={style} className={panel.className}>
+ {panel.children}
+ </div>
+ {i < panels.length - 1 && (
+ <div
+ onPointerDown={(e) => handlePointerDown(i, e)}
+ className="relative w-0 shrink-0 cursor-col-resize group z-10"
+ >
+ {/* Visible line */}
+ <div className="absolute inset-y-0 -left-px w-px bg-border/40 group-hover:bg-border transition-colors" />
+ {/* Wider hit area */}
+ <div className="absolute inset-y-0 -left-1.5 w-3" />
+ </div>
+ )}
+ </div>
+ );
+ })}
+ </div>
+ );
+}
diff --git a/src/web/src/hooks/use-local-storage.ts b/src/web/src/hooks/use-local-storage.ts
new file mode 100644
index 000000000..7a770e948
--- /dev/null
+++ b/src/web/src/hooks/use-local-storage.ts
@@ -0,0 +1,30 @@
+"use client";
+
+import { useState, useEffect, useCallback } from "react";
+
+export function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void] {
+ const [stored, setStored] = useState<T>(initialValue);
+
+ // Hydrate from localStorage after mount to avoid SSR mismatch
+ useEffect(() => {
+ try {
+ const item = localStorage.getItem(key);
+ if (item) setStored(JSON.parse(item) as T);
+ } catch { /* ignore */ }
+ }, [key]);
+
+ const setValue = useCallback(
+ (value: T | ((prev: T) => T)) => {
+ setStored((prev) => {
+ const next = value instanceof Function ? value(prev) : value;
+ try {
+ localStorage.setItem(key, JSON.stringify(next));
+ } catch { /* quota exceeded — silently ignore */ }
+ return next;
+ });
+ },
+ [key]
+ );
+
+ return [stored, setValue];
+}