Skip to content

Commit

Permalink
chore: debug ci (#1648)
Browse files Browse the repository at this point in the history
* fix: revert time.sleep change

* fix: step animation
  • Loading branch information
willydouhard authored Jan 8, 2025
1 parent bfa4e00 commit 3043989
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 14 deletions.
2 changes: 2 additions & 0 deletions backend/chainlit/message.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import json
import time
import uuid
from abc import ABC
from typing import Dict, List, Optional, Union, cast
Expand Down Expand Up @@ -217,6 +218,7 @@ def __init__(
parent_id: Optional[str] = None,
created_at: Union[str, None] = None,
):
time.sleep(0.001)
self.language = language
if isinstance(content, dict):
try:
Expand Down
1 change: 1 addition & 0 deletions backend/chainlit/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ async def process_message(session: WebsocketSession, payload: MessagePayload):
message = await context.emitter.process_message(payload)

if config.code.on_message:
await asyncio.sleep(0.001)
await config.code.on_message(message)
except asyncio.CancelledError:
pass
Expand Down
2 changes: 2 additions & 0 deletions backend/chainlit/step.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio
import inspect
import json
import time
import uuid
from copy import deepcopy
from functools import wraps
Expand Down Expand Up @@ -191,6 +192,7 @@ def __init__(
thread_id: Optional[str] = None,
):
trace_event(f"init {self.__class__.__name__} {type}")
time.sleep(0.001)
self._input = ""
self._output = ""
self.thread_id = thread_id or context.session.thread_id
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/chat/Messages/Message/Step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default function Step({
'flex items-center gap-1 group/step',
isError && 'text-red-500',
hasContent && 'cursor-pointer',
!isRunning && 'text-muted-foreground hover:text-foreground',
isRunning && 'loading-shimmer'
!using && 'text-muted-foreground hover:text-foreground',
using && 'loading-shimmer'
)}
onClick={() => setOpen(!open)}
id={`step-${stepName}`}
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ code {
text-fill-color: transparent;
-webkit-text-fill-color: transparent;
animation-delay: 0s;
animation-duration: 3s;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-name: loading-shimmer;
background: hsl(var(--muted-foreground))
background: hsl(var(--muted))
gradient(
linear,
100% 0,
0 0,
from(hsl(var(--muted-foreground))),
from(hsl(var(--muted))),
color-stop(0.5, hsl(var(--foreground))),
to(hsl(var(--muted-foreground)))
to(hsl(var(--muted)))
);
background: hsl(var(--muted-foreground)) -webkit-gradient(linear, 100% 0, 0 0, from(hsl(var(--muted-foreground))), color-stop(0.5, hsl(var(--foreground))), to(hsl(var(--muted-foreground))));
background: hsl(var(--muted)) -webkit-gradient(linear, 100% 0, 0 0, from(hsl(var(--muted))), color-stop(0.5, hsl(var(--foreground))), to(hsl(var(--muted))));
background-clip: text;
-webkit-background-clip: text;
background-repeat: no-repeat;
Expand Down
12 changes: 6 additions & 6 deletions libs/copilot/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,20 @@
background-position: -100% top;
text-fill-color: transparent;
-webkit-text-fill-color: transparent;
animation-delay: 0.3s;
animation-duration: 3s;
animation-delay: 0s;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-name: loading-shimmer;
background: hsl(var(--muted-foreground))
background: hsl(var(--muted))
gradient(
linear,
100% 0,
0 0,
from(hsl(var(--muted-foreground))),
from(hsl(var(--muted))),
color-stop(0.5, hsl(var(--foreground))),
to(hsl(var(--muted-foreground)))
to(hsl(var(--muted)))
);
background: hsl(var(--muted-foreground)) -webkit-gradient(linear, 100% 0, 0 0, from(hsl(var(--muted-foreground))), color-stop(0.5, hsl(var(--foreground))), to(hsl(var(--muted-foreground))));
background: hsl(var(--muted)) -webkit-gradient(linear, 100% 0, 0 0, from(hsl(var(--muted))), color-stop(0.5, hsl(var(--foreground))), to(hsl(var(--muted))));
background-clip: text;
-webkit-background-clip: text;
background-repeat: no-repeat;
Expand Down
2 changes: 1 addition & 1 deletion libs/react-client/src/useChatSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ const useChatSession = () => {
}
});
},
[setSession, sessionId, chatProfile]
[setSession, sessionId, idToResume, chatProfile]
);

const connect = useCallback(debounce(_connect, 200), [_connect]);
Expand Down

0 comments on commit 3043989

Please sign in to comment.