Skip to content

Commit

Permalink
Wd/0.7.603 (#545)
Browse files Browse the repository at this point in the history
* bump version

* prep release

* fix large text display
  • Loading branch information
willydouhard authored Nov 15, 2023
1 parent 8649a89 commit 57d14f9
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 12 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

Nothing is unreleased!

## [0.7.603] - 2023-11-15

### Fixed

- Markdown links special characters are no longer encoded
- Collapsed messages no longer make the chat scroll
- Stringified Python objects are now displayed in a Python code block

## [0.7.602] - 2023-11-14

### Added
Expand Down
2 changes: 2 additions & 0 deletions backend/chainlit/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,12 @@ def __init__(
self.language = "json"
except TypeError:
self.content = str(content)
self.language = "python"
elif isinstance(content, str):
self.content = content
else:
self.content = str(content)
self.language = "python"

if id:
self.id = str(id)
Expand Down
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "chainlit"
version = "0.7.602"
version = "0.7.603"
keywords = ['LLM', 'Agents', 'gen ai', 'chat ui', 'chatbot ui', 'langchain']
description = "A faster way to build chatbot UIs."
authors = ["Chainlit"]
Expand Down
4 changes: 2 additions & 2 deletions libs/components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@chainlit/components",
"description": "Reusable components of the Chainlit UI.",
"version": "0.1.0",
"version": "0.1.1",
"scripts": {
"build": "tsup src/index.ts --clean --format esm,cjs --dts --external react --legacy-output --minify --sourcemap --treeshake",
"build:watch": "tsup src/index.ts --watch --clean --format esm,cjs --dts --external react --legacy-output --minify --sourcemap --treeshake",
Expand Down Expand Up @@ -70,7 +70,7 @@
"plotly.js": "^2.27.0",
"react-dropzone": "^14.2.3",
"react-file-icon": "^1.3.0",
"react-markdown": "^9.0.0",
"react-markdown": "^9.0.1",
"react-password-checklist": "^1.5.0",
"react-plotly.js": "^2.6.0",
"react-resizable": "^3.0.5",
Expand Down
9 changes: 4 additions & 5 deletions libs/components/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions libs/components/src/Collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,24 @@ const Collapse = ({
}: CollapseProps): JSX.Element => {
const [expandAll, toggleExpandAll] = useToggle(defaultExpandAll);

const content = (
<Box height={expandAll ? 'auto' : 100} position="relative">
<Box
position={expandAll ? 'relative' : 'absolute'}
top={0}
left={0}
right={0}
bottom={0}
>
{children}
</Box>
</Box>
);

return (
<Box>
<MCollapse in={expandAll} collapsedSize={100} timeout={0}>
{children}
{content}
</MCollapse>
<Stack direction="row" justifyContent="end">
<Tooltip title={expandAll ? 'Collapse' : 'Expand'}>
Expand All @@ -34,7 +48,7 @@ const Collapse = ({
</IconButton>
</Tooltip>
<Tooltip title="Download">
<IconButton onClick={onDownload}>
<IconButton onClick={onDownload} edge="end">
<DownloadOutlined />
</IconButton>
</Tooltip>
Expand Down
8 changes: 7 additions & 1 deletion libs/components/src/messages/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ const Message = memo(
}}
>
<Author message={message} show={showAvatar} />
<Stack alignItems="flex-start" width={0} flexGrow={1} spacing={1}>
<Stack
alignItems="flex-start"
width={0}
flexGrow={1}
spacing={1}
minWidth={150}
>
<MessageContent
elements={elements}
message={message}
Expand Down
2 changes: 1 addition & 1 deletion libs/components/src/messages/components/MessageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const MessageContent = memo(

return (
<Stack width="100%" direction="row">
<Box width="100%">
<Box width="100%" sx={{ overflowX: 'auto', minWidth: '100px' }}>
{preparedContent ? content : null}
<InlinedElements elements={inlinedElements} />
</Box>
Expand Down

0 comments on commit 57d14f9

Please sign in to comment.