Skip to content

Commit

Permalink
UI fixes (#200)
Browse files Browse the repository at this point in the history
* UI fixes

* Add source code link
  • Loading branch information
jacoblee93 authored Oct 18, 2023
1 parent e8748d7 commit 25713ef
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chat-langchain/app/components/AutoResizeTextarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const AutoResizeTextarea = React.forwardRef<
return (
<Textarea
minH="unset"
overflow="scroll"
overflow="auto"
w="100%"
resize="none"
ref={ref as React.RefObject<HTMLTextAreaElement>}
Expand Down
3 changes: 2 additions & 1 deletion chat-langchain/app/components/ChatMessageBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,9 @@ export function ChatMessageBubble(props: {
}}
isLoading={traceIsLoading}
loadingText="🔄"
color="white"
>
🛠️🔗
🦜🛠️ View trace
</Button>
</HStack>
)}
Expand Down
17 changes: 16 additions & 1 deletion chat-langchain/app/components/ChatWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export function ChatWindow(props: {
},
include_names: [sourceStepName],
}),
openWhenHidden: true,
onerror(err) {
throw err;
},
Expand Down Expand Up @@ -215,7 +216,6 @@ export function ChatWindow(props: {
<AutoResizeTextarea
value={input}
maxRows={5}
rounded={"full"}
marginRight={"56px"}
placeholder="What is LangChain Expression Language?"
textColor={"white"}
Expand Down Expand Up @@ -245,6 +245,21 @@ export function ChatWindow(props: {
/>
</InputRightElement>
</InputGroup>

{messages.length === 0 ? (
<footer className="flex justify-center absolute bottom-8">
<a
href="https://github.com/langchain-ai/chat-langchain"
target="_blank"
className="text-white flex items-center"
>
<img src="/images/github-mark.svg" className="h-4 mr-1" />
<span>View Source</span>
</a>
</footer>
) : (
""
)}
</div>
);
}
3 changes: 1 addition & 2 deletions chat-langchain/app/components/EmptyState.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MouseEvent, MouseEventHandler } from "react";
import { MouseEvent } from "react";
import {
Heading,
Link,
Expand All @@ -7,7 +7,6 @@ import {
Flex,
Spacer,
} from "@chakra-ui/react";
import { ExternalLinkIcon } from "@chakra-ui/icons";

export function EmptyState(props: { onChoice: (question: string) => any }) {
const handleClick = (e: MouseEvent) => {
Expand Down
1 change: 1 addition & 0 deletions chat-langchain/public/images/github-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 25713ef

Please sign in to comment.