()
| 5063 | const mentionText = `@[${title}](${nodeId})`; |
| 5064 | const start = context?.start ?? input.selectionStart ?? input.value.length; |
| 5065 | const end = context?.end ?? input.selectionEnd ?? input.value.length; |
| 5066 | input.value = `${input.value.slice(0, start)}${mentionText} ${input.value.slice(end)}`; |
| 5067 | const cursor = start + mentionText.length + 1; |
| 5068 | input.setSelectionRange(cursor, cursor); |
| 5069 | if (!state.chatMentions.some((mention) => mention.node_id === nodeId)) { |
| 5070 | state.chatMentions.push({ |
| 5071 | node_id: nodeId, |
| 5072 | title, |
| 5073 | node_type: node.node_type || node.type || "" |
| 5074 | }); |
| 5075 | } |
| 5076 | renderChatMentionChips(); |
no test coverage detected