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:
@@ -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),
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user