From e976d60974a7837967d03807605cbf2e7b4f3f9a Mon Sep 17 00:00:00 2001
From: Nate Sesti <33237525+sestinj@users.noreply.github.com>
Date: Sat, 23 Sep 2023 13:06:00 -0700
Subject: UI Redesign and fixing many details (#496)

* feat: :lipstick: start of major design upgrade

* feat: :lipstick: model selection page

* feat: :lipstick: use shortcut to add highlighted code as ctx

* feat: :lipstick: better display of errors

* feat: :lipstick: ui for learning keyboard shortcuts, more details

* refactor: :construction: testing slash commands ui

* Truncate continue.log

* refactor: :construction: refactoring client_session, ui, more

* feat: :bug: layout fixes

* refactor: :lipstick: ui to enter OpenAI Key

* refactor: :truck: rename MaybeProxyOpenAI -> OpenAIFreeTrial

* starting help center

* removing old shortcut docs

* fix: :bug: fix model setting logic to avoid overwrites

* feat: :lipstick: tutorial and model descriptions

* refactor: :truck: rename unused -> saved

* refactor: :truck: rename model roles

* feat: :lipstick: edit indicator

* refactor: :lipstick: move +, folder icons

* feat: :lipstick: tab to clear all context

* fix: :bug: context providers ui fixes

* fix: :bug: fix lag when stopping step

* fix: :bug: don't override system message for models

* fix: :bug: fix continue button cursor

* feat: :lipstick: title bar

* fix: :bug: updates to code highlighting logic and more

* fix: :bug: fix renaming of summarize model role

* feat: :lipstick: help page and better session title

* feat: :lipstick: more help page / ui improvements

* feat: :lipstick: set session title

* fix: :bug: small fixes for changing sessions

* fix: :bug: perfecting the highlighting code and ctx interactions

* style: :lipstick: sticky headers for scroll, ollama warming

* fix: :bug: fix toggle bug

---------

Co-authored-by: Ty Dunn <ty@tydunn.com>
---
 .../src/components/ErrorStepContainer.tsx          | 52 ++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 extension/react-app/src/components/ErrorStepContainer.tsx

(limited to 'extension/react-app/src/components/ErrorStepContainer.tsx')

diff --git a/extension/react-app/src/components/ErrorStepContainer.tsx b/extension/react-app/src/components/ErrorStepContainer.tsx
new file mode 100644
index 00000000..e8ab7950
--- /dev/null
+++ b/extension/react-app/src/components/ErrorStepContainer.tsx
@@ -0,0 +1,52 @@
+import React from "react";
+import styled from "styled-components";
+import { HistoryNode } from "../../../schema/HistoryNode";
+import { defaultBorderRadius, vscBackground } from ".";
+import HeaderButtonWithText from "./HeaderButtonWithText";
+import {
+  MinusCircleIcon,
+  MinusIcon,
+  XMarkIcon,
+} from "@heroicons/react/24/outline";
+
+const Div = styled.div`
+  padding: 8px;
+  background-color: #ff000011;
+  border-radius: ${defaultBorderRadius};
+  border: 1px solid #cc0000;
+`;
+
+interface ErrorStepContainerProps {
+  historyNode: HistoryNode;
+  onClose: () => void;
+  onDelete: () => void;
+}
+
+function ErrorStepContainer(props: ErrorStepContainerProps) {
+  return (
+    <div style={{ backgroundColor: vscBackground, position: "relative" }}>
+      <div
+        style={{
+          position: "absolute",
+          right: "4px",
+          top: "4px",
+          display: "flex",
+        }}
+      >
+        <HeaderButtonWithText text="Collapse" onClick={() => props.onClose()}>
+          <MinusCircleIcon width="1.3em" height="1.3em" />
+        </HeaderButtonWithText>
+        <HeaderButtonWithText text="Collapse" onClick={() => props.onDelete()}>
+          <XMarkIcon width="1.3em" height="1.3em" />
+        </HeaderButtonWithText>
+      </div>
+      <Div>
+        <pre className="overflow-x-scroll">
+          {props.historyNode.observation?.error as string}
+        </pre>
+      </Div>
+    </div>
+  );
+}
+
+export default ErrorStepContainer;
-- 
cgit v1.2.3-70-g09d2

