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

Function handleSelect

src/components/MessageSelector.tsx:156–177  ·  view source on GitHub ↗
(message_0: UserMessage)

Source from the content-addressed store, hash-verified

154 }
155 }
156 async function handleSelect(message_0: UserMessage) {
157 const index = messages.indexOf(message_0);
158 const indexFromEnd = messages.length - 1 - index;
159 logEvent('ncode_message_selector_selected', {
160 index_from_end: indexFromEnd,
161 message_type: message_0.type as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
162 is_current_prompt: false
163 });
164
165 // Do nothing if the message is not found
166 if (!messages.includes(message_0)) {
167 onClose();
168 return;
169 }
170 if (!isFileHistoryEnabled) {
171 await restoreConversationDirectly(message_0);
172 return;
173 }
174 const diffStats = await fileHistoryGetDiffStats(fileHistory, message_0.uuid);
175 setMessageToRestore(message_0);
176 setDiffStatsForRestore(diffStats);
177 }
178 async function onSelectRestoreOption(option: RestoreOption) {
179 logEvent('ncode_message_selector_restore_option_selected', {
180 option: option as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS

Callers 4

MessageSelectorFunction · 0.70
PermissionPromptFunction · 0.50
AddWorkspaceDirectoryFunction · 0.50
DesktopUpsellStartupFunction · 0.50

Calls 3

fileHistoryGetDiffStatsFunction · 0.85
logEventFunction · 0.70

Tested by

no test coverage detected