Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
JinayJain committed Apr 3, 2024
2 parents c80d355 + 2981e02 commit a71b194
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 412 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"react-icons": "^4.8.0",
"react-markdown": "^8.0.x",
"react-syntax-highlighter": "^15.5.0",
"rehype-katex": "^6.0.x",
"remark-breaks": "^4.0.0",
"remark-math": "^6.0.0",
"rehype-katex": "^6.0.2",
"remark-breaks": "^3.0.2",
"remark-math": "^5.1.1",
"tauri-plugin-store-api": "https://github.com/tauri-apps/tauri-plugin-store"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ResponseBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function ResponseBox({
};

return (
<Stack bg="blackAlpha.800" rounded="md" p={4} {...props}>
<Stack bg="blackAlpha.800" rounded="md" p={4} {...props} role="group">
<Box>
<ReactMarkdown
remarkPlugins={[remarkBreaks, remarkMath]}
Expand Down
38 changes: 19 additions & 19 deletions src/pages/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ function App() {
/>

<Box overflowY="auto" maxH="100%">
{messages.length > 0 && (
<Center
as={motion.div}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
mb={2}
>
<Button
size="sm"
leftIcon={<NotAllowedIcon />}
onClick={reset}
colorScheme="red"
>
Reset Chat
</Button>
</Center>
)}

{error && (
<Box
as={motion.div}
Expand All @@ -91,25 +110,6 @@ function App() {
)}

<Messages messages={messages} />

{/* {messages.length > 0 && (
<Center
as={motion.div}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
mt={2}
>
<Button
size="sm"
leftIcon={<NotAllowedIcon />}
onClick={reset}
colorScheme="red"
>
Reset Chat
</Button>
</Center>
)} */}
</Box>
</Box>
);
Expand Down
10 changes: 1 addition & 9 deletions src/util/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,7 @@ export function useChat() {
[messages]
);

const reset = useCallback(() => {
setMessages([
{
id: generateId(),
role: "system",
content: "You are a helpful assistant.",
},
]);
}, []);
const reset = useCallback(() => setMessages([]), []);

return {
messages,
Expand Down
Loading

0 comments on commit a71b194

Please sign in to comment.