From 8478af63c18b0c35d59d2326ca4e8687a42a624b Mon Sep 17 00:00:00 2001
From: Priyash <38959321+priyashpatil@users.noreply.github.com>
Date: Mon, 22 Jul 2024 07:34:48 +0530
Subject: [PATCH] feat: improve chat thread ui for better readability (#1786)
---
gui/src/components/Logo.tsx | 22 ++
gui/src/components/gui/StepContainer.tsx | 3 +-
.../components/mainInput/ContextItemsPeek.tsx | 2 +-
gui/src/pages/gui.tsx | 215 ++++++++++++------
4 files changed, 166 insertions(+), 76 deletions(-)
create mode 100644 gui/src/components/Logo.tsx
diff --git a/gui/src/components/Logo.tsx b/gui/src/components/Logo.tsx
new file mode 100644
index 000000000..a6f889768
--- /dev/null
+++ b/gui/src/components/Logo.tsx
@@ -0,0 +1,22 @@
+export default function Logo({
+ height,
+ width,
+}: {
+ height: number;
+ width: number;
+}) {
+ return (
+
+ );
+}
diff --git a/gui/src/components/gui/StepContainer.tsx b/gui/src/components/gui/StepContainer.tsx
index a93d377e1..402975382 100644
--- a/gui/src/components/gui/StepContainer.tsx
+++ b/gui/src/components/gui/StepContainer.tsx
@@ -58,7 +58,7 @@ const ContentDiv = styled.div<{ isUserInput: boolean; fontSize?: number }>`
background-color: ${(props) =>
props.isUserInput ? vscInputBackground : vscBackground};
font-size: ${(props) => props.fontSize || getFontSize()}px;
- border-radius: ${defaultBorderRadius};
+ // border-radius: ${defaultBorderRadius};
overflow: hidden;
`;
@@ -138,7 +138,6 @@ function StepContainer(props: StepContainerProps) {
/>
)}
-
{(isHovered || typeof feedback !== "undefined") && !active && (
{
style={{ color: lightGray }}
>
)}
- Context Used
+ Context Used
{open && (
{item.message.role === "user" ? (
-
{
- streamResponse(
- editorState,
- modifiers,
- ideMessenger,
- index,
- );
- }}
- isLastUserInput={isLastUserInput(index)}
- isMainInput={false}
- editorState={item.editorState}
- contextItems={item.contextItems}
- >
+
+
+
+
+
+
+ Continue
+ User
+
+
+
{
+ streamResponse(
+ editorState,
+ modifiers,
+ ideMessenger,
+ index,
+ );
+ }}
+ isLastUserInput={isLastUserInput(index)}
+ isMainInput={false}
+ editorState={item.editorState}
+ contextItems={item.contextItems}
+ >
+
) : (
-
- ) : false ? (
-
- ) : (
-
- )
- }
- open={
- typeof stepsOpen[index] === "undefined"
- ? false
- ? false
- : true
- : stepsOpen[index]!
- }
- onToggle={() => {}}
- >
-
+
+
+
+
+
+
+ {item.message.role}
+
+
+ {item.promptLogs?.[0]?.completionOptions?.model ??
+ "Agent"}
+
+
+
+
+ ) : false ? (
+
+ ) : (
+
+ )
+ }
open={
typeof stepsOpen[index] === "undefined"
- ? true
+ ? false
+ ? false
+ : true
: stepsOpen[index]!
}
- key={index}
- onUserInput={(input: string) => {}}
- item={item}
- onReverse={() => {}}
- onRetry={() => {
- streamResponse(
- state.history[index - 1].editorState,
- state.history[index - 1].modifiers ??
- defaultInputModifiers,
- ideMessenger,
- index - 1,
- );
- }}
- onContinueGeneration={() => {
- window.postMessage(
- {
- messageType: "userInput",
- data: {
- input:
- "Continue your response exactly where you left off:",
+ onToggle={() => {}}
+ >
+ {}}
+ item={item}
+ onReverse={() => {}}
+ onRetry={() => {
+ streamResponse(
+ state.history[index - 1].editorState,
+ state.history[index - 1].modifiers ??
+ defaultInputModifiers,
+ ideMessenger,
+ index - 1,
+ );
+ }}
+ onContinueGeneration={() => {
+ window.postMessage(
+ {
+ messageType: "userInput",
+ data: {
+ input:
+ "Continue your response exactly where you left off:",
+ },
},
- },
- "*",
- );
- }}
- onDelete={() => {}}
- />
-
+ "*",
+ );
+ }}
+ onDelete={() => {}}
+ />
+
+
)}