fix(graph): filter system messages from particles + fix direction
- Skip idle_notification, shutdown, and other JSON system messages
(was showing {"type":"idle_notificatio... as particle labels)
- Skip system_notification source messages
- Skip messages with < 3 chars
This commit is contained in:
parent
f6daced2ce
commit
27b1a4fd9a
1 changed files with 15 additions and 0 deletions
|
|
@ -494,6 +494,9 @@ export class TeamGraphAdapter {
|
||||||
if (this.#seenMessageIds.has(msgKey)) continue;
|
if (this.#seenMessageIds.has(msgKey)) continue;
|
||||||
this.#seenMessageIds.add(msgKey);
|
this.#seenMessageIds.add(msgKey);
|
||||||
|
|
||||||
|
// Skip system/noise messages (idle notifications, JSON blobs)
|
||||||
|
if (TeamGraphAdapter.#isSystemMessage(msg)) continue;
|
||||||
|
|
||||||
const edgeId = TeamGraphAdapter.#resolveMessageEdge(msg, teamName, leadId, leadName, edges);
|
const edgeId = TeamGraphAdapter.#resolveMessageEdge(msg, teamName, leadId, leadName, edges);
|
||||||
if (!edgeId) continue;
|
if (!edgeId) continue;
|
||||||
|
|
||||||
|
|
@ -691,6 +694,18 @@ export class TeamGraphAdapter {
|
||||||
return `member:${teamName}:${name}`;
|
return `member:${teamName}:${name}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Filter out system/noise messages that shouldn't show as particles */
|
||||||
|
static #isSystemMessage(msg: InboxMessage): boolean {
|
||||||
|
const text = msg.text ?? '';
|
||||||
|
// JSON system messages (idle_notification, shutdown, etc.)
|
||||||
|
if (text.startsWith('{"type":') || text.startsWith('{"type" :')) return true;
|
||||||
|
// Very short system messages
|
||||||
|
if (text.length < 3) return true;
|
||||||
|
// System notification source
|
||||||
|
if (msg.source === 'system_notification') return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static #buildParticleLabel(
|
static #buildParticleLabel(
|
||||||
text: string | undefined,
|
text: string | undefined,
|
||||||
kind: 'inbox' | 'comment',
|
kind: 'inbox' | 'comment',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue