diff --git a/index.html b/index.html index b51b6f2..657d80b 100644 --- a/index.html +++ b/index.html @@ -1883,29 +1883,41 @@ .map(iconBtnHtml) .join(''); - // Only create type indicator badge for shared notes - let typeBadge = ''; + // Create type bubble and shared with capsules for shared notes only + let typeBubble = ''; + let sharedWithDisplay = ''; if (note.shared) { const typeColorMap = { - personal: { bg: 'bg-amber-200', border: 'border-amber-400', text: 'text-amber-900' }, - manager: { bg: 'bg-orange-300', border: 'border-orange-500', text: 'text-orange-900' }, - job: { bg: 'bg-pink-300', border: 'border-pink-500', text: 'text-pink-900' }, + personal: { bg: 'bg-amber-300', border: 'border-amber-400' }, + manager: { bg: 'bg-orange-400', border: 'border-orange-500' }, + job: { bg: 'bg-pink-400', border: 'border-pink-500' }, }; - const typeColor = typeColorMap[type] || { bg: 'bg-gray-200', border: 'border-gray-400', text: 'text-gray-900' }; - typeBadge = `${escapeHtml(type)}`; + const typeColor = typeColorMap[type] || { bg: 'bg-gray-300', border: 'border-gray-400' }; + typeBubble = ``; + + if (note.shared_with && note.shared_with.length > 0) { + const sharedNames = Array.isArray(note.shared_with) ? note.shared_with : (typeof note.shared_with === 'string' ? note.shared_with.split(',').map(n => n.trim()) : []); + const capsules = sharedNames.map(name => { + const firstName = name.split(' ')[0]; + return `${escapeHtml(firstName)}`; + }).join(''); + sharedWithDisplay = `