diff --git a/src/index.css b/src/index.css index 7b096e8..a196794 100644 --- a/src/index.css +++ b/src/index.css @@ -626,6 +626,17 @@ button { .md del { color: var(--text-faint); } +.mention { + color: #c4b5fd; + background: var(--accent-soft); + border-radius: 4px; + padding: 0 3px; + font-weight: 600; + white-space: nowrap; +} +.mention:hover { + background: rgba(168, 85, 247, 0.28); +} .meta-badge { font-family: var(--mono); font-size: 10px; diff --git a/src/lib/markdown.ts b/src/lib/markdown.ts index 15115d3..7049d88 100644 Binary files a/src/lib/markdown.ts and b/src/lib/markdown.ts differ diff --git a/src/pages/ChatPage.tsx b/src/pages/ChatPage.tsx index 9c46f29..a3257ee 100644 --- a/src/pages/ChatPage.tsx +++ b/src/pages/ChatPage.tsx @@ -336,6 +336,10 @@ export default function ChatPage() { const nameById = new Map(members.map((m) => [m.userId, m.name || m.email])) const authorLabel = (uid?: string) => uid ? (uid === session?.user.id ? session?.user.name || 'You' : nameById.get(uid) || uid.slice(0, 8)) : 'unknown' + const mentionName = (id: string) => + id === session?.user.id + ? session?.user.name || session?.user.email || 'you' + : nameById.get(id) || id.slice(0, 8) const guildById = new Map(members.map((m) => [m.userId, m])) const channelMembers = channelMemberIds.map( @@ -471,7 +475,10 @@ export default function ChatPage() { wakeup={String(m.wakeup)} ) : null} -
+ {devMode ? (
{JSON.stringify(