From 90cc17989eceac3bf009f9da89620dd655b97908 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 29 Mar 2024 11:24:45 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Regenerate=20and=20copy=20buttons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui/src/components/gui/StepContainer.tsx | 21 ++++++++++++++++++++- gui/src/components/markdown/CopyButton.tsx | 3 ++- gui/src/pages/gui.tsx | 7 ++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/gui/src/components/gui/StepContainer.tsx b/gui/src/components/gui/StepContainer.tsx index f8158fa9a..20509e189 100644 --- a/gui/src/components/gui/StepContainer.tsx +++ b/gui/src/components/gui/StepContainer.tsx @@ -1,4 +1,5 @@ import { + ArrowUturnLeftIcon, HandThumbDownIcon, HandThumbUpIcon, } from "@heroicons/react/24/outline"; @@ -17,6 +18,7 @@ import { RootState } from "../../redux/store"; import { getFontSize } from "../../util"; import { postToIde } from "../../util/ide"; import HeaderButtonWithText from "../HeaderButtonWithText"; +import { CopyButton } from "../markdown/CopyButton"; import StyledMarkdownPreview from "../markdown/StyledMarkdownPreview"; interface StepContainerProps { @@ -98,11 +100,28 @@ function StepContainer(props: StepContainerProps) { showCodeBorder={true} /> +
{(isHovered || typeof feedback !== "undefined") && !active && (
+ + { + props.onRetry(); + }} + > + + {feedback === false || ( string); + color?: string; } export function CopyButton(props: CopyButtonProps) { @@ -26,7 +27,7 @@ export function CopyButton(props: CopyButtonProps) { {copied ? ( ) : ( - + )} diff --git a/gui/src/pages/gui.tsx b/gui/src/pages/gui.tsx index 6e9dab11a..6579e4fbd 100644 --- a/gui/src/pages/gui.tsx +++ b/gui/src/pages/gui.tsx @@ -417,7 +417,12 @@ function GUI(props: GUIProps) { onUserInput={(input: string) => {}} item={item} onReverse={() => {}} - onRetry={() => {}} + onRetry={() => { + streamResponse( + state.history[index - 1].editorState, + index - 1, + ); + }} onDelete={() => {}} />