-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from zamm-dev/fix-animations
Fix InfoBox reveal for populated chat conversations
- Loading branch information
Showing
12 changed files
with
148 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import type { ChatMessage } from "$lib/bindings"; | ||
|
||
export const shortConversation: ChatMessage[] = [ | ||
{ | ||
role: "System", | ||
text: "You are ZAMM, a chat program. Respond in first person.", | ||
}, | ||
{ | ||
role: "Human", | ||
text: "Hello, does this work?", | ||
}, | ||
]; | ||
|
||
export const conversation: ChatMessage[] = [ | ||
{ | ||
role: "System", | ||
text: "You are ZAMM, a chat program. Respond in first person.", | ||
}, | ||
{ | ||
role: "Human", | ||
text: "Hello, does this work?", | ||
}, | ||
{ | ||
role: "AI", | ||
text: | ||
"Hello! I'm ZAMM, a chat program. I'm here to assist you. " + | ||
"What can I help you with today?", | ||
}, | ||
{ | ||
role: "Human", | ||
text: "Tell me something really funny, like really funny. Make me laugh hard.", | ||
}, | ||
{ | ||
role: "AI", | ||
text: | ||
"Sure, here's a light-hearted joke for you:\n\n" + | ||
"Why don't scientists trust atoms?\n\n" + | ||
"Because they make up everything!", | ||
}, | ||
{ | ||
role: "Human", | ||
text: | ||
"This is some Python code:\n\n" + | ||
"```python\n" + | ||
"def hello_world():\n" + | ||
" print('Hello, world!')\n" + | ||
"```\n\n" + | ||
"Convert it to Rust", | ||
}, | ||
{ | ||
role: "AI", | ||
text: | ||
"Here's how the Python code you provided would look in Rust:\n\n" + | ||
'```rust\nfn main() {\n println!("Hello, world!");\n}\n```', | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import ChatComponent from "./Chat.svelte"; | ||
import SvelteStoresDecorator from "$lib/__mocks__/stores"; | ||
import MockPageTransitions from "$lib/__mocks__/MockPageTransitions.svelte"; | ||
import TauriInvokeDecorator from "$lib/__mocks__/invoke"; | ||
import type { StoryFn, StoryObj } from "@storybook/svelte"; | ||
import { conversation } from "./Chat.mock-data"; | ||
|
||
export default { | ||
component: ChatComponent, | ||
title: "Screens/Chat/Conversation", | ||
argTypes: {}, | ||
decorators: [ | ||
SvelteStoresDecorator, | ||
TauriInvokeDecorator, | ||
(story: StoryFn) => { | ||
return { | ||
Component: MockPageTransitions, | ||
slot: story, | ||
}; | ||
}, | ||
], | ||
}; | ||
|
||
const Template = ({ ...args }) => ({ | ||
Component: ChatComponent, | ||
props: args, | ||
}); | ||
|
||
export const FullPage: StoryObj = Template.bind({}) as any; | ||
|
||
export const FullPageConversation: StoryObj = Template.bind({}) as any; | ||
FullPageConversation.parameters = { | ||
stores: { | ||
conversation, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters