feat(v2.7): 接入协作治理前端体验

This commit is contained in:
2026-07-08 16:31:06 +08:00
parent bcbe84bb6e
commit 9ba9449c1a
23 changed files with 987 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { extractMentionNames, mergeMentionMemberIds } from './comment-mentions';
test('extractMentionNames reads @memberName mentions from comment content', () => {
assert.deepEqual(extractMentionNames('请 @Alice 和 @张三 看一下'), ['Alice', '张三']);
});
test('mergeMentionMemberIds keeps text mention matches before explicit selection and dedupes', () => {
const ids = mergeMentionMemberIds({
content: '请 @Alice 看一下',
explicitMemberIds: ['m-bob', 'm-alice'],
members: [
{ id: 'm-alice', name: 'Alice' },
{ id: 'm-bob', name: 'Bob' },
],
});
assert.deepEqual(ids, ['m-alice', 'm-bob']);
});