const day = 864e5;
const list = document.querySelector('aparte-conversation-list');
list.conversations = [
{ id: 'c1', title: 'What is aparté?', updatedAt: Date.now() },
{ id: 'c2', title: 'Approve a tool call', updatedAt: Date.now() - day },
{ id: 'c3', title: 'Branch a reply', updatedAt: Date.now() - 3 * day },
{ id: 'c4', title: 'Theme it in three variables', updatedAt: Date.now() - 12 * day },
];
// The header title follows the selected conversation - one listener, no framework.
list.addEventListener('aparte-conversation-select', (e) => {
const picked = list.conversations.find((c) => c.id === e.detail.id);
if (picked) document.querySelector('.aparte-app-header__title').textContent = picked.title;
});