Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/asyncio
Browse files Browse the repository at this point in the history
dokterbob authored Jan 27, 2025

Verified

This commit was signed with the committer’s verified signature.
2 parents 9414d98 + a3ecfb2 commit ce2e3f0
Showing 8 changed files with 30 additions and 17 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,19 @@ All notable changes to Chainlit will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [2.0.602] - 2025-01-27

### Fixed

- Chat input should now auto focus
- When unfolding a step, the `Output` title should only show if there is an input to display

## [2.0.601] - 2025-01-25

### Fixed

- Element sidebar should take full height

## [2.0.6] - 2025-01-24

### Added
7 changes: 0 additions & 7 deletions backend/chainlit/auth/cookie.py
Original file line number Diff line number Diff line change
@@ -86,7 +86,6 @@ def _get_chunked_cookie(cookies: dict[str, str], name: str) -> Optional[str]:
if cookie_key not in cookies:
break

print("Reading chunk", cookie_key)
chunk_parts.append(cookies[cookie_key])
i += 1

@@ -100,11 +99,8 @@ def get_token_from_cookies(cookies: dict[str, str]) -> Optional[str]:
Read all chunk cookies and reconstruct the token
"""

print("Found cookies", cookies.keys())

# Default/unchunked cookies
if value := cookies.get(_auth_cookie_name):
print("Returning unchunked", _auth_cookie_name, value)
return value

return _get_chunked_cookie(cookies, _auth_cookie_name)
@@ -128,8 +124,6 @@ def set_auth_cookie(request: Request, response: Response, token: str):
for i, chunk in enumerate(chunks):
k = f"{_auth_cookie_name}_{i}"

print("Setting", k)

response.set_cookie(
key=k,
value=chunk,
@@ -155,7 +149,6 @@ def set_auth_cookie(request: Request, response: Response, token: str):

# Delete remaining prior cookies/cookie chunks
for k in existing_cookies:
print("Deleting", k)
response.delete_cookie(key=k, path="/")


2 changes: 1 addition & 1 deletion backend/chainlit/version.py
Original file line number Diff line number Diff line change
@@ -5,4 +5,4 @@
except metadata.PackageNotFoundError:
# Case where package metadata is not available, default to a 'non-outdated' version.
# Ref: config.py::load_settings()
__version__ = "2.0.6"
__version__ = "2.0.602"
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 = "2.0.6"
version = "2.0.602"
keywords = [
'LLM',
'Agents',
9 changes: 6 additions & 3 deletions frontend/src/components/ElementSideView.tsx
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ export default function ElementSideView() {
</SheetHeader>
<div
id="side-view-content"
className="mt-4 overflow-y-auto flex-grow flex flex-col gap-4"
className="mt-4 overflow-y-auto flex-grow flex flex-grow flex-col gap-4"
>
{sideView.elements.map((e) => (
<Element key={e.id} element={e} />
@@ -67,7 +67,7 @@ export default function ElementSideView() {
}`}
>
<aside className="relative flex-grow overflow-y-auto mr-4 mb-4">
<Card className="overflow-y-auto h-full">
<Card className="overflow-y-auto h-full flex flex-col">
<div
id="side-view-title"
className="text-lg font-semibold text-foreground px-6 py-4 flex items-center"
@@ -82,7 +82,10 @@ export default function ElementSideView() {
</Button>
{sideView.title}
</div>
<CardContent id="side-view-content" className="flex flex-col gap-4">
<CardContent
id="side-view-content"
className="flex flex-col flex-grow gap-4"
>
{sideView.elements.map((e) => (
<Element key={e.id} element={e} />
))}
2 changes: 2 additions & 0 deletions frontend/src/components/chat/MessageComposer/Input.tsx
Original file line number Diff line number Diff line change
@@ -94,6 +94,8 @@ const Input = forwardRef<InputMethods, Props>(
useEffect(() => {
if (!contentEditableRef.current) return;

contentEditableRef.current.focus();

mutationObserverRef.current = new MutationObserver((mutations) => {
if (isUpdatingRef.current) return;

Original file line number Diff line number Diff line change
@@ -33,11 +33,13 @@ const MessageContent = memo(
language: message.language
});

const displayInput = message.input && message.showInput;

const isMessage = message.type.includes('message');

const outputMarkdown = (
<p className="flex flex-col gap-2">
{!isMessage ? (
{!isMessage && displayInput ? (
<div className="text-lg font-semibold leading-none tracking-tight">
Output
</div>
@@ -54,7 +56,7 @@ const MessageContent = memo(

let inputMarkdown;

if (message.input && message.showInput) {
if (displayInput) {
const inputContent =
message.streaming && message.input
? message.input + CURSOR_PLACEHOLDER
6 changes: 3 additions & 3 deletions frontend/src/components/chat/Messages/Message/Step.tsx
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ export default function Step({
<div className="flex flex-col flex-grow w-0">
<p
className={cn(
'flex items-center gap-1 group/step',
'flex items-center group/step',
isError && 'text-red-500',
hasContent && 'cursor-pointer',
!using && 'text-muted-foreground hover:text-foreground',
@@ -50,9 +50,9 @@ export default function Step({
)}
{hasContent ? (
open ? (
<ChevronUp className="invisible group-hover/step:visible !size-4" />
<ChevronUp className="invisible group-hover/step:visible !size-4 ml-1" />
) : (
<ChevronDown className="invisible group-hover/step:visible !size-4" />
<ChevronDown className="invisible group-hover/step:visible !size-4 ml-1" />
)
) : null}
</p>

0 comments on commit ce2e3f0

Please sign in to comment.