diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-03 14:20:21 -0400 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-03 14:20:21 -0400 |
commit | b8067876bc5dd425d491863bd5338f325fea35ed (patch) | |
tree | 4c3167043c2bffaff5931b77e080a8f84ad52c96 /extension/react-app/src/components | |
parent | 4f3ceee573268fbe9db80fea372198523b5757a6 (diff) | |
download | sncontinue-b8067876bc5dd425d491863bd5338f325fea35ed.tar.gz sncontinue-b8067876bc5dd425d491863bd5338f325fea35ed.tar.bz2 sncontinue-b8067876bc5dd425d491863bd5338f325fea35ed.zip |
error handling and step retry
Diffstat (limited to 'extension/react-app/src/components')
-rw-r--r-- | extension/react-app/src/components/StepContainer.tsx | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/extension/react-app/src/components/StepContainer.tsx b/extension/react-app/src/components/StepContainer.tsx index f962cbc9..903f9b94 100644 --- a/extension/react-app/src/components/StepContainer.tsx +++ b/extension/react-app/src/components/StepContainer.tsx @@ -18,6 +18,7 @@ import { ChevronDown, ChevronRight, Backward, + ArrowPath, } from "@styled-icons/heroicons-outline"; import { HistoryNode } from "../../../schema/HistoryNode"; import ReactMarkdown from "react-markdown"; @@ -29,6 +30,7 @@ interface StepContainerProps { inFuture: boolean; onRefinement: (input: string) => void; onUserInput: (input: string) => void; + onRetry: () => void; } const MainDiv = styled.div<{ stepDepth: number; inFuture: boolean }>` @@ -135,19 +137,44 @@ function StepContainer(props: StepContainerProps) { > <Backward size="1.6em" onClick={props.onReverse}></Backward> </HeaderButton> */} + + {props.historyNode.observation?.error ? ( + <HeaderButton + onClick={(e) => { + e.stopPropagation(); + props.onRetry(); + }} + > + <ArrowPath size="1.6em" onClick={props.onRetry}></ArrowPath> + </HeaderButton> + ) : ( + <></> + )} </HeaderDiv> {open && ( - <pre> - Step Details: - <br /> - {JSON.stringify(props.historyNode.step, null, 2)} - </pre> + <> + <pre className="overflow-scroll"> + Step Details: + <br /> + {JSON.stringify(props.historyNode.step, null, 2)} + </pre> + </> )} - <ReactMarkdown key={1} className="overflow-scroll"> - {props.historyNode.step.description as any} - </ReactMarkdown> + {props.historyNode.observation?.error ? ( + <> + Error while running step: + <br /> + <pre className="overflow-scroll"> + {props.historyNode.observation.error as string} + </pre> + </> + ) : ( + <ReactMarkdown key={1} className="overflow-scroll"> + {props.historyNode.step.description as any} + </ReactMarkdown> + )} {props.historyNode.step.name === "Waiting for user input" && ( <input |