MCPcopy
hub / github.com/codeaashu/claude-code / handleSelect

Function handleSelect

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

Source from the content-addressed store, hash-verified

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

logEventFunction · 0.85
fileHistoryGetDiffStatsFunction · 0.85

Tested by

no test coverage detected