Skip to content

Commit

Permalink
Merge pull request #61 from zamm-dev/max-lines-input
Browse files Browse the repository at this point in the history
Constrain max height on chat text input
  • Loading branch information
amosjyng authored Mar 13, 2024
2 parents 110b1f3 + 0f8114f commit 331e9e3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions src-svelte/src/routes/chat/Chat.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,33 @@ MultilineChat.parameters = {
},
};

export const ExtraLongInput: StoryObj = Template.bind({}) as any;
ExtraLongInput.args = {
conversation,
initialMessage: `Hey, I have this definition for a book object:
\`\`\`python
class Book:
def __init__(self, title, author, pages):
self.title = title
self.author = author
self.pages = pages
def book_info(self):
return f"'{self.title}' by {self.author} has {self.pages} pages."
def is_long(self):
return self.pages > 200
\`\`\`
Do you have any code comments for me?`,
};
ExtraLongInput.parameters = {
viewport: {
defaultViewport: "smallTablet",
},
};

export const BottomScrollIndicator: StoryObj = Template.bind({}) as any;
BottomScrollIndicator.args = {
conversation,
Expand Down
1 change: 1 addition & 0 deletions src-svelte/src/routes/chat/Form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
font-family: var(--font-body);
width: 100%;
min-height: 1.2rem;
max-height: 9.8rem;
resize: none;
}
</style>
1 change: 1 addition & 0 deletions src-svelte/src/routes/storybook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const components: ComponentTestConfig[] = [
"empty",
"not-empty",
"multiline-chat",
"extra-long-input",
"bottom-scroll-indicator",
"typing-indicator-static",
"full-message-width",
Expand Down

0 comments on commit 331e9e3

Please sign in to comment.