MCPcopy Create free account
hub / github.com/Noumena-Network/code / Feedback

Function Feedback

src/components/Feedback.tsx:155–395  ·  view source on GitHub ↗
({
  abortSignal,
  messages,
  initialDescription,
  onDone,
  backgroundTasks = {}
}: Props)

Source from the content-addressed store, hash-verified

153 }
154}
155export function Feedback({
156 abortSignal,
157 messages,
158 initialDescription,
159 onDone,
160 backgroundTasks = {}
161}: Props): React.ReactNode {
162 const [step, setStep] = useState<Step>('userInput');
163 const [cursorOffset, setCursorOffset] = useState(0);
164 const [description, setDescription] = useState(initialDescription ?? '');
165 const [feedbackId, setFeedbackId] = useState<string | null>(null);
166 const [error, setError] = useState<string | null>(null);
167 const [envInfo, setEnvInfo] = useState<{
168 isGit: boolean;
169 gitState: GitRepoState | null;
170 }>({
171 isGit: false,
172 gitState: null
173 });
174 const [title, setTitle] = useState<string | null>(null);
175 const textInputColumns = useTerminalSize().columns - 4;
176 useEffect(() => {
177 async function loadEnvInfo() {
178 const isGit = await getIsGit();
179 let gitState: GitRepoState | null = null;
180 if (isGit) {
181 gitState = await getGitState();
182 }
183 setEnvInfo({
184 isGit,
185 gitState
186 });
187 }
188 void loadEnvInfo();
189 }, []);
190 const submitReport = useCallback(async () => {
191 setStep('submitting');
192 setError(null);
193 setFeedbackId(null);
194
195 // Get sanitized errors for the report
196 const sanitizedErrors = getSanitizedErrorLogs();
197
198 // Extract last assistant message ID from messages array
199 const lastAssistantMessage = getLastAssistantMessage(messages);
200 const lastAssistantMessageId = lastAssistantMessage?.requestId ?? null;
201 const [diskTranscripts, rawTranscriptJsonl] = await Promise.all([loadAllSubagentTranscriptsFromDisk(), loadRawTranscriptJsonl()]);
202 const teammateTranscripts = extractTeammateTranscriptsFromTasks(backgroundTasks);
203 const subagentTranscripts = {
204 ...diskTranscripts,
205 ...teammateTranscripts
206 };
207 const reportData = {
208 latestAssistantMessageId: lastAssistantMessageId,
209 message_count: messages.length,
210 datetime: new Date().toISOString(),
211 description,
212 platform: env.platform,

Callers

nothing calls this directly

Calls 15

useTerminalSizeFunction · 0.85
loadEnvInfoFunction · 0.85
setStepFunction · 0.85
getSanitizedErrorLogsFunction · 0.85
getLastAssistantMessageFunction · 0.85
loadRawTranscriptJsonlFunction · 0.85
normalizeMessagesForAPIFunction · 0.85
getLastAPIRequestFunction · 0.85
submitFeedbackFunction · 0.85
generateTitleFunction · 0.85

Tested by

no test coverage detected