m4Mindset docs

Demos / Conversation list · Orbit Support

Conversation list

Conversation history lets a returning visitor pick up where they left off. In a help center, the agent opens wide with its conversation list, so a customer reopens an earlier conversation about the same order instead of starting again.

A returning visitor can reopen an earlier conversation and carry on. On the page's side that takes one attribute and one event listener.

Turn the list on

One attribute on the chat element adds a Conversations button. The element fetches the list itself.

src/demos/shared/useDemoElement.ts
el.setAttribute('agent', handle)
if (live.current.conversationList) el.setAttribute('conversation-list', '')

Whose list it is

The list holds the session user's own conversations, so your server's user id decides it.

server/guide-session/handler.ts
body: JSON.stringify({ user: { externalId: visitor }, agent, createUserIfNeeded: true }),

Hear which conversation is open

The element fires an event when a conversation is saved or the visitor picks an earlier one.

src/demos/orbit/index.tsx
const on = (e: Event) => onConversation((e as CustomEvent<ConversationEventDetail>).detail)
node.addEventListener('mindset:conversation', on)

Saved or resumed

The page turns each event into what it shows, so it never claims a save that didn't happen.

src/demos/orbit/history.ts
if (detail?.replacedBecause === 'switched') return { kind: 'resumed', conversationId: id, picks: (state.kind === 'resumed' ? state.picks : 0) + 1 }
if (state.kind !== 'idle' && state.conversationId === id) return state
return { kind: 'saved', conversationId: id }