From fee38b8d1397cd0db6acdb169cd1d799663c7921 Mon Sep 17 00:00:00 2001 From: "ShengYan, Zhang" Date: Wed, 24 May 2023 14:42:36 +0800 Subject: [PATCH 1/2] fix: a few typos --- app/components/message-selector.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/message-selector.tsx b/app/components/message-selector.tsx index 3068e544..837591ac 100644 --- a/app/components/message-selector.tsx +++ b/app/components/message-selector.tsx @@ -75,7 +75,7 @@ export function MessageSelector(props: { const isValid = (m: ChatMessage) => m.content && !m.isError && !m.streaming; const messages = session.messages.filter( (m, i) => - m.id && // messsage must has id + m.id && // message must have id isValid(m) && (i >= session.messages.length - 1 || isValid(session.messages[i + 1])), ); @@ -88,13 +88,13 @@ export function MessageSelector(props: { return searchInput.length === 0 || searchIds.has(id); }; const doSearch = (text: string) => { - const searchResuts = new Set(); + const searchResults = new Set(); if (text.length > 0) { messages.forEach((m) => - m.content.includes(text) ? searchResuts.add(m.id!) : null, + m.content.includes(text) ? searchResults.add(m.id!) : null, ); } - setSearchIds(searchResuts); + setSearchIds(searchResults); }; // for range selection From e84da3089a70914bb33556a91f7b55b94153ea82 Mon Sep 17 00:00:00 2001 From: "ShengYan, Zhang" Date: Wed, 24 May 2023 14:44:06 +0800 Subject: [PATCH 2/2] fix state loss after user switches from steps --- app/components/exporter.tsx | 121 +++++++++++++++++------------------- 1 file changed, 57 insertions(+), 64 deletions(-) diff --git a/app/components/exporter.tsx b/app/components/exporter.tsx index f79e8490..a9a1071d 100644 --- a/app/components/exporter.tsx +++ b/app/components/exporter.tsx @@ -152,71 +152,64 @@ export function MessageExporter() { index={currentStepIndex} onStepChange={setCurrentStepIndex} /> - -
- {currentStep.value === "select" && ( - <> - - - - - - { - updateExportConfig( - (config) => - (config.includeContext = e.currentTarget.checked), - ); - }} - > - - - - - )} - - {currentStep.value === "preview" && ( - <> - {exportConfig.format === "text" ? ( - - ) : ( - - )} - - )} +
+ + + + + + { + updateExportConfig( + (config) => (config.includeContext = e.currentTarget.checked), + ); + }} + > + + +
+ {currentStep.value === "preview" && ( +
+ {exportConfig.format === "text" ? ( + + ) : ( + + )} +
+ )} ); }