fix(graph): improve text normalization in TeamGraphAdapter

- Enhanced text processing to clean up raw task ID hashes and replace pipe separators with dashes.
- Ensured consistent formatting for comments and inbox messages.
This commit is contained in:
iliya 2026-03-31 13:02:05 +03:00
parent 828e8d3371
commit 8cf2d41568

View file

@ -886,7 +886,13 @@ export class TeamGraphAdapter {
kind: 'inbox' | 'comment',
max = 52
): string | undefined {
const normalized = text?.replace(/\s+/g, ' ').trim();
let normalized = text?.replace(/\s+/g, ' ').trim();
// Clean up raw task ID hashes like "#363e78de done|sent to review" → "done | sent to review"
if (normalized) {
normalized = normalized.replace(/#[a-f0-9]{6,}\s*/gi, '').trim();
// Clean pipe separators
normalized = normalized.replace(/\|/g, ' - ');
}
const prefix = kind === 'comment' ? '\u{1F4AC}' : '\u{2709}';
if (!normalized) return prefix;
const clipped =