feat: add message metadata viewer on hover

Small info button appears on hover of each message bubble.
Click to expand a panel showing raw message metadata (id, role,
timestamp, channel, sender info, etc.) from the gateway.
Useful for debugging and understanding message routing.
Collapsed by default, doesn't clutter the UI.

Closes feedback item #39
This commit is contained in:
Nicolas Varrot
2026-02-12 23:17:27 +00:00
parent 53a8655bb1
commit b4813f091a
5 changed files with 54 additions and 2 deletions

View File

@@ -171,12 +171,19 @@ export function useGateway() {
}
const textContent = blocks.filter((b): b is Extract<MessageBlock, { type: 'text' }> => b.type === 'text').map(b => b.text).join('');
// Capture raw metadata (exclude heavy fields already parsed)
const metadata: Record<string, unknown> = {};
for (const [k, v] of Object.entries(m)) {
if (['content', 'blocks'].includes(k)) continue;
metadata[k] = v;
}
return {
id: m.id || `hist-${i}`,
role,
content: textContent,
timestamp: m.timestamp || Date.now(),
blocks,
metadata,
isSystemEvent: role === 'user' && isSystemEvent(textContent),
};
});