mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-03 19:20:07 +02:00
* fix: execution log name rendering and squad assignee support - Strip mention markdown in trigger_summary ([@Name](mention://...) → @Name) so execution log rows show clean text instead of raw markdown - Add squad to ActorFilterValue type so squad assignees are filterable - Add squad section to assignee filter dropdown in issues-header - Add i18n keys for squads_group (en/zh-Hans) Co-authored-by: multica-agent <github@multica.ai> * fix: address PR #2575 review feedback 1. Extract stripMentionMarkdown as reusable helper with proper regex - Handles escaped brackets in names (e.g. David\[TF\]) - Skips backslash-escaped mentions (\[@...]) - Handles issue mentions (no @ prefix) - Does not touch regular markdown links - 10 unit tests added 2. Squad only appears in Assignee filter, not Creator - Added showSquads prop to ActorSubContent (default true) - Creator filter passes showSquads={false} 3. Squad included in Agents scope - issues-page scope filter now includes squad in agents scope - 2 regression tests added for scope coverage Co-authored-by: multica-agent <github@multica.ai> --------- Co-authored-by: multica-agent <github@multica.ai>
22 lines
851 B
TypeScript
22 lines
851 B
TypeScript
/**
|
|
* Strip mention markdown syntax to plain text.
|
|
*
|
|
* Handles:
|
|
* - Simple mentions: `[@Name](mention://agent/id)` → `@Name`
|
|
* - Escaped brackets in names: `[@David\[TF\]](mention://agent/id)` → `@David[TF]`
|
|
* - Issue mentions (no @): `[MUL-123](mention://issue/id)` → `MUL-123`
|
|
* - Does NOT touch regular markdown links: `[docs](https://...)` stays unchanged
|
|
* - Does NOT touch backslash-escaped mentions: `\[@Name](mention://...)` stays unchanged
|
|
*
|
|
* The regex mirrors the tokenizer in mention-extension.ts.
|
|
*/
|
|
export function stripMentionMarkdown(text: string): string {
|
|
return text.replace(
|
|
/(?<![\\])\[(@?)((?:\\.|[^\]])+)\]\(mention:\/\/\w+\/[^)]+\)/g,
|
|
(_, prefix: string, rawLabel: string) => {
|
|
const label = rawLabel.replace(/\\\[/g, "[").replace(/\\\]/g, "]");
|
|
return `${prefix}${label}`;
|
|
},
|
|
);
|
|
}
|