MCPcopy Create free account
hub / github.com/Roy3838/Observer / insertSystemPromptText

Function insertSystemPromptText

app/src/components/AgentCard/SensorModal.tsx:124–134  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

122
123 // Insert sensor variable at cursor position
124 const insertSystemPromptText = (text: string) => {
125 if (!textareaRef.current) return;
126 const { selectionStart, selectionEnd, value } = textareaRef.current;
127 const newPrompt = `${value.substring(0, selectionStart)} ${text} ${value.substring(selectionEnd)}`;
128 setEditedPrompt(newPrompt);
129 setTimeout(() => {
130 textareaRef.current?.focus();
131 const newPos = selectionStart + text.length + 2;
132 textareaRef.current?.setSelectionRange(newPos, newPos);
133 }, 0);
134 };
135
136 // Handle modal close with save
137 const handleClose = () => {

Callers 1

SensorModalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected