Skip to content

Commit ae3faae

Browse files
committed
Implement lazy email reply loading states
1 parent 6d758b6 commit ae3faae

File tree

3 files changed

+248
-97
lines changed

3 files changed

+248
-97
lines changed

packages/server/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,11 @@ function buildActionSummary(result: Record<string, unknown>): string {
711711
: []
712712
lines.push(`- User requested more emails${requestedCategories.length > 0 ? ` for categories: ${requestedCategories.join(', ')}` : ''}.`)
713713
}
714+
if (result.requestReplyDraft) {
715+
const emailSubject = typeof result.emailSubject === 'string' ? result.emailSubject : ''
716+
const emailId = typeof result.emailId === 'string' ? result.emailId : ''
717+
lines.push(`- User requested a reply draft${emailSubject ? ` for "${emailSubject}"` : emailId ? ` for ${emailId}` : ''}.`)
718+
}
714719

715720
const intents = (result.selectedIntents ?? []) as Array<{ id: string; accepted: boolean }>
716721
if (intents.length > 0) {

packages/web/src/pages/EmailTestPage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Acme Cloud Billing`,
2626
{ label: 'Thread', value: 'March Billing Summary' },
2727
],
2828
unread: true,
29+
replyState: 'loading',
2930
category: 'Updates',
3031
timestamp: Date.now() - 1000 * 60 * 45,
3132
},
@@ -71,6 +72,8 @@ Mina`,
7172
{ label: 'Priority', value: 'High' },
7273
],
7374
unread: true,
75+
replyState: 'ready',
76+
replyUnread: true,
7477
replyDraft: {
7578
replyTo: 'mina@example.com',
7679
to: 'mina@example.com',

0 commit comments

Comments
 (0)