From 25262703573e79fc436c32f48b8df428bfeb4c97 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 12 Jun 2023 13:18:16 -0700 Subject: clear history and delete step buttons --- .../react-app/src/components/StepContainer.tsx | 44 ++-- extension/react-app/src/components/index.ts | 18 ++ .../src/hooks/ContinueGUIClientProtocol.ts | 6 + .../react-app/src/hooks/useContinueGUIProtocol.ts | 8 + extension/react-app/src/tabs/gui.tsx | 272 +++++++++++---------- 5 files changed, 202 insertions(+), 146 deletions(-) (limited to 'extension/react-app/src') diff --git a/extension/react-app/src/components/StepContainer.tsx b/extension/react-app/src/components/StepContainer.tsx index fb0143b5..2d85b4f0 100644 --- a/extension/react-app/src/components/StepContainer.tsx +++ b/extension/react-app/src/components/StepContainer.tsx @@ -7,6 +7,7 @@ import { vscBackground, GradientBorder, vscBackgroundTransparent, + HeaderButton, } from "."; import { RangeInFile, FileEdit } from "../../../src/client"; import CodeBlock from "./CodeBlock"; @@ -15,7 +16,7 @@ import SubContainer from "./SubContainer"; import { ChevronDown, ChevronRight, - Backward, + XMark, ArrowPath, } from "@styled-icons/heroicons-outline"; import { HistoryNode } from "../../../schema/HistoryNode"; @@ -31,6 +32,7 @@ interface StepContainerProps { onRefinement: (input: string) => void; onUserInput: (input: string) => void; onRetry: () => void; + onDelete: () => void; open?: boolean; } @@ -54,8 +56,10 @@ const HeaderDiv = styled.div<{ error: boolean }>` background-color: ${(props) => props.error ? "#522" : vscBackgroundTransparent}; display: grid; - grid-template-columns: 1fr auto; + grid-template-columns: 1fr auto auto; + grid-gap: 8px; align-items: center; + padding-right: 8px; `; const ContentDiv = styled.div` @@ -64,20 +68,6 @@ const ContentDiv = styled.div` background-color: ${vscBackground}; `; -const HeaderButton = styled.button` - background-color: transparent; - border: 1px solid white; - border-radius: ${defaultBorderRadius}; - padding: 2px; - cursor: pointer; - color: white; - - &:hover { - background-color: white; - color: black; - } -`; - const OnHoverDiv = styled.div` text-align: center; padding: 10px; @@ -161,18 +151,28 @@ function StepContainer(props: StepContainerProps) { */} - {props.historyNode.observation?.error ? ( + <> { e.stopPropagation(); - props.onRetry(); + props.onDelete(); }} > - + - ) : ( - <> - )} + {props.historyNode.observation?.error ? ( + { + e.stopPropagation(); + props.onRetry(); + }} + > + + + ) : ( + <> + )} +