mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-03 19:25:19 +02:00
Email page (#561)
* email view * render html emails * match unread and read status * move to accordian * faster loads * iframe mounted across toggle and cached height * prefetch on hover * fix iframe caching * split inbox * email processing agent * summary * rich text * email drafts * add pagination, watcher and separation from gmail sync * fix first load issue * handle drafts * send button opens the thread * simplify renderer and fix flickering issue * remove rended driven email path * support attachments in incoming emails * fix white background as well as dark mode
This commit is contained in:
parent
af618155e1
commit
7dcf8eea70
10 changed files with 3139 additions and 72 deletions
|
|
@ -88,12 +88,13 @@ export type CalendarBlock = z.infer<typeof CalendarBlockSchema>;
|
|||
|
||||
export const EmailBlockSchema = z.object({
|
||||
threadId: z.string().optional(),
|
||||
threadUrl: z.string().url().optional(),
|
||||
summary: z.string().optional(),
|
||||
subject: z.string().optional(),
|
||||
from: z.string().optional(),
|
||||
to: z.string().optional(),
|
||||
date: z.string().optional(),
|
||||
latest_email: z.string(),
|
||||
latest_email: z.string().optional(),
|
||||
past_summary: z.string().optional(),
|
||||
draft_response: z.string().optional(),
|
||||
response_mode: z.enum(['inline', 'assistant', 'both']).optional(),
|
||||
|
|
@ -101,6 +102,42 @@ export const EmailBlockSchema = z.object({
|
|||
|
||||
export type EmailBlock = z.infer<typeof EmailBlockSchema>;
|
||||
|
||||
export const GmailAttachmentSchema = z.object({
|
||||
filename: z.string(),
|
||||
mimeType: z.string().optional(),
|
||||
sizeBytes: z.number().int().nonnegative().optional(),
|
||||
savedPath: z.string(),
|
||||
});
|
||||
|
||||
export type GmailAttachment = z.infer<typeof GmailAttachmentSchema>;
|
||||
|
||||
export const GmailThreadMessageSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
from: z.string().optional(),
|
||||
to: z.string().optional(),
|
||||
cc: z.string().optional(),
|
||||
date: z.string().optional(),
|
||||
subject: z.string().optional(),
|
||||
body: z.string().optional(),
|
||||
bodyHtml: z.string().optional(),
|
||||
unread: z.boolean().optional(),
|
||||
bodyHeight: z.number().int().positive().optional(),
|
||||
attachments: z.array(GmailAttachmentSchema).optional(),
|
||||
});
|
||||
|
||||
export type GmailThreadMessage = z.infer<typeof GmailThreadMessageSchema>;
|
||||
|
||||
export const GmailThreadSchema = EmailBlockSchema.extend({
|
||||
threadId: z.string(),
|
||||
threadUrl: z.string().url(),
|
||||
unread: z.boolean().optional(),
|
||||
importance: z.enum(['important', 'other']).optional(),
|
||||
gmail_draft: z.string().optional(),
|
||||
messages: z.array(GmailThreadMessageSchema),
|
||||
});
|
||||
|
||||
export type GmailThread = z.infer<typeof GmailThreadSchema>;
|
||||
|
||||
export const EmailsBlockSchema = z.object({
|
||||
title: z.string().optional(),
|
||||
emails: z.array(EmailBlockSchema),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue