summaryrefslogtreecommitdiff
path: root/extension/react-app/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'extension/react-app/src/components')
-rw-r--r--extension/react-app/src/components/CodeBlock.tsx3
-rw-r--r--extension/react-app/src/components/DebugPanel.tsx4
-rw-r--r--extension/react-app/src/components/StepContainer.tsx31
-rw-r--r--extension/react-app/src/components/index.ts2
4 files changed, 19 insertions, 21 deletions
diff --git a/extension/react-app/src/components/CodeBlock.tsx b/extension/react-app/src/components/CodeBlock.tsx
index 4c10ab23..e0336554 100644
--- a/extension/react-app/src/components/CodeBlock.tsx
+++ b/extension/react-app/src/components/CodeBlock.tsx
@@ -6,7 +6,8 @@ import { defaultBorderRadius, vscBackground } from ".";
import { Clipboard } from "@styled-icons/heroicons-outline";
const StyledPre = styled.pre`
- overflow: scroll;
+ overflow-y: scroll;
+ word-wrap: normal;
border: 1px solid gray;
border-radius: ${defaultBorderRadius};
background-color: ${vscBackground};
diff --git a/extension/react-app/src/components/DebugPanel.tsx b/extension/react-app/src/components/DebugPanel.tsx
index ed00571b..9dacc624 100644
--- a/extension/react-app/src/components/DebugPanel.tsx
+++ b/extension/react-app/src/components/DebugPanel.tsx
@@ -36,7 +36,8 @@ const GradientContainer = styled.div`
const MainDiv = styled.div`
height: 100%;
border-radius: ${defaultBorderRadius};
- overflow: scroll;
+ overflow-y: scroll;
+ scrollbar-gutter: stable both-edges;
scrollbar-base-color: transparent;
/* background: ${vscBackground}; */
background-color: #1e1e1ede;
@@ -107,6 +108,7 @@ function DebugPanel(props: DebugPanelProps) {
className={
tab.title === "Chat" ? "overflow-hidden" : "overflow-scroll"
}
+ style={{ scrollbarGutter: "stable both-edges" }}
>
{tab.element}
</div>
diff --git a/extension/react-app/src/components/StepContainer.tsx b/extension/react-app/src/components/StepContainer.tsx
index 03649b66..5e979b34 100644
--- a/extension/react-app/src/components/StepContainer.tsx
+++ b/extension/react-app/src/components/StepContainer.tsx
@@ -36,6 +36,8 @@ const MainDiv = styled.div<{ stepDepth: number; inFuture: boolean }>`
animation: ${appear} 0.3s ease-in-out;
/* padding-left: ${(props) => props.stepDepth * 20}px; */
overflow: hidden;
+ margin-left: 0px;
+ margin-right: 0px;
`;
const StepContainerDiv = styled.div<{ open: boolean }>`
@@ -78,6 +80,13 @@ function StepContainer(props: StepContainerProps) {
const [open, setOpen] = useState(false);
const [isHovered, setIsHovered] = useState(false);
const naturalLanguageInputRef = useRef<HTMLTextAreaElement>(null);
+ const userInputRef = useRef<HTMLInputElement>(null);
+
+ useEffect(() => {
+ if (userInputRef?.current) {
+ userInputRef.current.focus();
+ }
+ }, [userInputRef]);
useEffect(() => {
if (isHovered) {
@@ -134,6 +143,7 @@ function StepContainer(props: StepContainerProps) {
{props.historyNode.step.name === "Waiting for user input" && (
<input
+ ref={userInputRef}
className="m-auto p-2 rounded-md border-1 border-solid text-white w-3/4 border-gray-200 bg-vsc-background"
onKeyDown={(e) => {
if (e.key === "Enter") {
@@ -144,6 +154,9 @@ function StepContainer(props: StepContainerProps) {
onSubmit={(ev) => {
props.onUserInput(ev.currentTarget.value);
}}
+ onClick={(e) => {
+ e.stopPropagation();
+ }}
/>
)}
{props.historyNode.step.name === "Waiting for user confirmation" && (
@@ -165,24 +178,6 @@ function StepContainer(props: StepContainerProps) {
/>
</>
)}
-
- {open && (
- <>
- {/* {props.historyNode.observation && (
- <SubContainer title="Error">
- <CodeBlock>Error Here</CodeBlock>
- </SubContainer>
- )} */}
- {/* {props.iterationContext.suggestedChanges.map((sc) => {
- return (
- <SubContainer title="Suggested Change">
- {sc.filepath}
- <CodeBlock>{sc.replacement}</CodeBlock>
- </SubContainer>
- );
- })} */}
- </>
- )}
</StepContainerDiv>
</GradientBorder>
diff --git a/extension/react-app/src/components/index.ts b/extension/react-app/src/components/index.ts
index e37c97f3..7ba60467 100644
--- a/extension/react-app/src/components/index.ts
+++ b/extension/react-app/src/components/index.ts
@@ -45,7 +45,7 @@ export const Pre = styled.pre`
border-radius: ${defaultBorderRadius};
padding: 8px;
max-height: 150px;
- overflow: scroll;
+ overflow-y: scroll;
margin: 0;
background-color: ${secondaryDark};
border: none;