feat: P4.6 agent demo + escalate button + support seed/smoke (P4 complete)
apps/agent-demo (Vite): agent sets AVAILABLE, sees assigned tickets, opens the thread, replies. message-demo customer pane gains 'escalate to support' (via SupportProvider/useEscalate). seed-support + smoke-support prove the loop: escalate -> auto-assign -> agent reply -> customer receives. 45 tests; realtime/ inbox/support smokes all pass; both demos build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
"@insignia/iios-kernel-client": "workspace:*",
|
||||
"@insignia/iios-message-web": "workspace:*",
|
||||
"@insignia/iios-inbox-web": "workspace:*",
|
||||
"@insignia/iios-support-web": "workspace:*",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { MessageProvider, useThread, useMessages } from '@insignia/iios-message-web';
|
||||
import { useThread, useMessages } from '@insignia/iios-message-web';
|
||||
import { InboxProvider, useInbox } from '@insignia/iios-inbox-web';
|
||||
import { SupportProvider, useEscalate } from '@insignia/iios-support-web';
|
||||
|
||||
const SERVICE = 'http://localhost:3200';
|
||||
const APP_ID = 'portal-demo';
|
||||
@@ -43,6 +44,7 @@ function ChatInner({
|
||||
}, [threadId]);
|
||||
|
||||
const { messages, send, typing, typingUsers, markRead, reads } = useMessages(tid);
|
||||
const escalate = useEscalate();
|
||||
|
||||
return (
|
||||
<div style={{ flex: 1, border: '1px solid #ccc', borderRadius: 8, padding: 12, margin: 8, fontFamily: 'sans-serif' }}>
|
||||
@@ -80,6 +82,15 @@ function ChatInner({
|
||||
>
|
||||
mark last read
|
||||
</button>
|
||||
<button
|
||||
style={{ marginTop: 8, marginLeft: 4 }}
|
||||
disabled={!tid}
|
||||
onClick={() => {
|
||||
if (tid) void escalate(tid, 'Support request');
|
||||
}}
|
||||
>
|
||||
escalate to support
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -109,9 +120,9 @@ function Pane(props: { token: string | null; label: string; threadId: string | n
|
||||
<InboxProvider serviceUrl={SERVICE} token={props.token}>
|
||||
<InboxSidebar />
|
||||
</InboxProvider>
|
||||
<MessageProvider serviceUrl={SERVICE} token={props.token}>
|
||||
<SupportProvider serviceUrl={SERVICE} token={props.token}>
|
||||
<ChatInner label={props.label} threadId={props.threadId} onCreated={props.onCreated} />
|
||||
</MessageProvider>
|
||||
</SupportProvider>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user