Feat/chat full screen#2929
Conversation
Feat/chainlit upgrade
Feat/chainlit upgrade
Bugfix/chat popup height
Feature/multi modalitiy
There was a problem hiding this comment.
11 issues found across 189 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/src/components/chat/Messages/Message/Content/Tools/WebRequest.tsx">
<violation number="1" location="frontend/src/components/chat/Messages/Message/Content/Tools/WebRequest.tsx:11">
P1: Uncaught `JSON.parse` on `step.input` can crash rendering when payload is invalid JSON.</violation>
</file>
<file name="frontend/src/AppWrapper.tsx">
<violation number="1" location="frontend/src/AppWrapper.tsx:36">
P1: Translation loading fails permanently on import error, leaving the app blank forever</violation>
</file>
<file name="frontend/src/components/CopyButton.tsx">
<violation number="1" location="frontend/src/components/CopyButton.tsx:89">
P2: Programmatic anchor download may navigate away from the app for cross-origin image URLs because the `download` attribute is ignored by browsers for cross-origin resources.</violation>
</file>
<file name="frontend/src/components/chat/Messages/Message/index.tsx">
<violation number="1" location="frontend/src/components/chat/Messages/Message/index.tsx:97">
P2: Early `return null` filters for `Reinforcement`, `DocumentProcessor`, and `LangGraph` suppress entire step subtrees instead of preserving child messages like the existing `skip` branch does. If these filtered steps contain nested messages in `message.steps`, those children will never render.</violation>
</file>
<file name="frontend/src/components/chat/Messages/Message/ToolStepInfo.tsx">
<violation number="1" location="frontend/src/components/chat/Messages/Message/ToolStepInfo.tsx:108">
P2: useMemo omits the `t` translation dependency, which can leave step status text stale when the user changes language while `toolCalls` stays the same.</violation>
</file>
<file name="frontend/src/components/Elements/Audio.tsx">
<violation number="1" location="frontend/src/components/Elements/Audio.tsx:10">
P1: Stale audio remains visible when URL is removed or fetch fails because `audioSrc` state is never cleared on error or when `element.url` becomes falsy.</violation>
<violation number="2" location="frontend/src/components/Elements/Audio.tsx:12">
P1: Blob URL cleanup is misplaced inside an async nested function, so React never invokes it and object URLs leak memory on URL changes and unmount.</violation>
</file>
<file name="frontend/src/components/ui/separator.tsx">
<violation number="1" location="frontend/src/components/ui/separator.tsx:19">
P2: Shared `Separator` primitive has implicit sibling-dependent heading spacing rules that can cause cross-app layout regressions.</violation>
</file>
<file name="frontend/src/components/ui/dialog.tsx">
<violation number="1" location="frontend/src/components/ui/dialog.tsx:23">
P0: Overlay z-index z-[9999] exceeds dialog content z-50, causing overlay to render on top of and block interaction with the modal content.</violation>
</file>
<file name="frontend/src/components/chat/Messages/Message/Content/index.tsx">
<violation number="1" location="frontend/src/components/chat/Messages/Message/Content/index.tsx:44">
P2: useMemo dependency array is missing `transformOutput`, which can cause stale transformed output when privacy shield settings change.</violation>
</file>
<file name="frontend/src/App.tsx">
<violation number="1" location="frontend/src/App.tsx:52">
P2: Authentication request is executed unconditionally, including when token is null. This causes unnecessary failed API calls on every app mount.</violation>
</file>
Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.
Re-trigger cubic
| @@ -20,7 +20,7 @@ const DialogOverlay = React.forwardRef< | |||
| <DialogPrimitive.Overlay | |||
There was a problem hiding this comment.
P0: Overlay z-index z-[9999] exceeds dialog content z-50, causing overlay to render on top of and block interaction with the modal content.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/ui/dialog.tsx, line 23:
<comment>Overlay z-index z-[9999] exceeds dialog content z-50, causing overlay to render on top of and block interaction with the modal content.</comment>
<file context>
@@ -20,7 +20,7 @@ const DialogOverlay = React.forwardRef<
ref={ref}
className={cn(
- 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
+ 'fixed inset-0 z-[9999] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
className
)}
</file context>
| // const inputJson = JSON.parse(step.input ?? '{}'); | ||
| const inputJson = useMemo(() => { | ||
| if (step.showInput === "json") { | ||
| const json = JSON.parse(step.input ?? '{}'); |
There was a problem hiding this comment.
P1: Uncaught JSON.parse on step.input can crash rendering when payload is invalid JSON.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/chat/Messages/Message/Content/Tools/WebRequest.tsx, line 11:
<comment>Uncaught `JSON.parse` on `step.input` can crash rendering when payload is invalid JSON.</comment>
<file context>
@@ -0,0 +1,42 @@
+ // const inputJson = JSON.parse(step.input ?? '{}');
+ const inputJson = useMemo(() => {
+ if (step.showInput === "json") {
+ const json = JSON.parse(step.input ?? '{}');
+ console.log(json);
+ if (json.input && typeof json.input === 'string') {
</file context>
| handleChangeLanguage(translations.translation); | ||
| setTranslationLoaded(true); | ||
| }, [translations]); | ||
| loadTranslation(languageInUse); |
There was a problem hiding this comment.
P1: Translation loading fails permanently on import error, leaving the app blank forever
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/AppWrapper.tsx, line 36:
<comment>Translation loading fails permanently on import error, leaving the app blank forever</comment>
<file context>
@@ -10,27 +10,31 @@ import {
- handleChangeLanguage(translations.translation);
- setTranslationLoaded(true);
- }, [translations]);
+ loadTranslation(languageInUse);
+ }, []);
</file context>
| const [audioSrc, setAudioSrc] = useState<string | null>(null); | ||
|
|
||
| useEffect(() => { | ||
| if (!element.url) return; |
There was a problem hiding this comment.
P1: Stale audio remains visible when URL is removed or fetch fails because audioSrc state is never cleared on error or when element.url becomes falsy.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/Elements/Audio.tsx, line 10:
<comment>Stale audio remains visible when URL is removed or fetch fails because `audioSrc` state is never cleared on error or when `element.url` becomes falsy.</comment>
<file context>
@@ -1,16 +1,47 @@
+ const [audioSrc, setAudioSrc] = useState<string | null>(null);
+
+ useEffect(() => {
+ if (!element.url) return;
+
+ const fetchAudio = async () => {
</file context>
| useEffect(() => { | ||
| if (!element.url) return; | ||
|
|
||
| const fetchAudio = async () => { |
There was a problem hiding this comment.
P1: Blob URL cleanup is misplaced inside an async nested function, so React never invokes it and object URLs leak memory on URL changes and unmount.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/Elements/Audio.tsx, line 12:
<comment>Blob URL cleanup is misplaced inside an async nested function, so React never invokes it and object URLs leak memory on URL changes and unmount.</comment>
<file context>
@@ -1,16 +1,47 @@
+ useEffect(() => {
+ if (!element.url) return;
+
+ const fetchAudio = async () => {
+ const token = localStorage.getItem('chainlit_token');
+ const headers: Record<string, string> = {
</file context>
| ); | ||
| } | ||
|
|
||
| if (isStep && message.name === 'Reinforcement') return null; |
There was a problem hiding this comment.
P2: Early return null filters for Reinforcement, DocumentProcessor, and LangGraph suppress entire step subtrees instead of preserving child messages like the existing skip branch does. If these filtered steps contain nested messages in message.steps, those children will never render.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/chat/Messages/Message/index.tsx, line 97:
<comment>Early `return null` filters for `Reinforcement`, `DocumentProcessor`, and `LangGraph` suppress entire step subtrees instead of preserving child messages like the existing `skip` branch does. If these filtered steps contain nested messages in `message.steps`, those children will never render.</comment>
<file context>
@@ -68,6 +94,10 @@ const Message = memo(
);
}
+ if (isStep && message.name === 'Reinforcement') return null;
+ if (isStep && message.type === 'tool' && message.name.includes('DocumentProcessor')) return null;
+ if (isStep && message.name === 'LangGraph' && (langGraphExclude.includes(evoyaMode ?? '') || isRunning)) return null;
</file context>
| if (isStep && message.name === 'Reinforcement') return null; | |
| if (isStep && message.name === 'Reinforcement') { | |
| if (!message.steps) return null; | |
| return ( | |
| <Messages | |
| messages={message.steps} | |
| elements={elements} | |
| actions={actions} | |
| indent={indent} | |
| isRunning={isRunning} | |
| scorableRun={scorableRun} | |
| /> | |
| ); | |
| } |
| } | ||
|
|
||
| return <Translator path="chat.evoya.cot.thinking" />; | ||
| }, [toolCalls]); |
There was a problem hiding this comment.
P2: useMemo omits the t translation dependency, which can leave step status text stale when the user changes language while toolCalls stays the same.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/chat/Messages/Message/ToolStepInfo.tsx, line 108:
<comment>useMemo omits the `t` translation dependency, which can leave step status text stale when the user changes language while `toolCalls` stays the same.</comment>
<file context>
@@ -0,0 +1,122 @@
+ }
+
+ return <Translator path="chat.evoya.cot.thinking" />;
+ }, [toolCalls]);
+
+ return (
</file context>
| className={cn( | ||
| 'shrink-0 bg-border', | ||
| orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', | ||
| orientation === 'horizontal' ? 'h-[1px] w-full has-[+h3]:mt-6 has-[+h4]:mt-6 has-[+h1]:mt-8 has-[+h2]:mt-8' : 'h-full w-[1px]', |
There was a problem hiding this comment.
P2: Shared Separator primitive has implicit sibling-dependent heading spacing rules that can cause cross-app layout regressions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/ui/separator.tsx, line 19:
<comment>Shared `Separator` primitive has implicit sibling-dependent heading spacing rules that can cause cross-app layout regressions.</comment>
<file context>
@@ -16,7 +16,7 @@ const Separator = React.forwardRef<
className={cn(
'shrink-0 bg-border',
- orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
+ orientation === 'horizontal' ? 'h-[1px] w-full has-[+h3]:mt-6 has-[+h4]:mt-6 has-[+h1]:mt-8 has-[+h2]:mt-8' : 'h-full w-[1px]',
className
)}
</file context>
| orientation === 'horizontal' ? 'h-[1px] w-full has-[+h3]:mt-6 has-[+h4]:mt-6 has-[+h1]:mt-8 has-[+h2]:mt-8' : 'h-full w-[1px]', | |
| orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', |
|
|
||
| const messageTrans = useMemo<string>(() => { | ||
| return transformOutput(outputContent); | ||
| }, [message]) |
There was a problem hiding this comment.
P2: useMemo dependency array is missing transformOutput, which can cause stale transformed output when privacy shield settings change.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/chat/Messages/Message/Content/index.tsx, line 44:
<comment>useMemo dependency array is missing `transformOutput`, which can cause stale transformed output when privacy shield settings change.</comment>
<file context>
@@ -8,28 +9,48 @@ import Markdown from '@/components/Markdown';
+
+ const messageTrans = useMemo<string>(() => {
+ return transformOutput(outputContent);
+ }, [message])
+
const {
</file context>
| }, [message]) | |
| }, [message, transformOutput]) |
| searchParams.get('access_token') || | ||
| localStorage.getItem('chainlit_token_iframe'); | ||
| apiClient | ||
| .jwtAuth(token) |
There was a problem hiding this comment.
P2: Authentication request is executed unconditionally, including when token is null. This causes unnecessary failed API calls on every app mount.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/App.tsx, line 52:
<comment>Authentication request is executed unconditionally, including when token is null. This causes unnecessary failed API calls on every app mount.</comment>
<file context>
@@ -37,6 +43,17 @@ function App() {
+ searchParams.get('access_token') ||
+ localStorage.getItem('chainlit_token_iframe');
+ apiClient
+ .jwtAuth(token)
+ .then((res) => setUserFromAPI())
+ .catch((err) => console.log(err));
</file context>
15e827d to
036c5f6
Compare
…tial transcript handling
…project management
036c5f6 to
e7d3e5c
Compare
…tates in multiple languages
…ument is selected context
2891930 to
27a15a7
Compare
Summary by cubic
Upgrades the Copilot chat to a full‑screen and embeddable experience with auto‑open, privacy controls, agent selection, voice/STT with timer, richer markdown/visualizations, sharing/favorites, and Creator integration. Also upgrades Chainlit internals, hardens embed/auth flows (incl. URL token), and improves load time and scrolling across web and iframe.
New Features
@evoya/file-picker; Evoya attachments; project selector; prompt expand; STT‑first send button with timer.mermaiddiagrams with source view/open‑in‑mermaid,react-vegacharts (responsive), improved code blocks/whitespace/lists, and smarter copy/download incl. images.@radix-ui/react-tabs, item, spinner, input-group).Bug Fixes
access_tokenfrom URL/localStorage and use it for audio/files; widget sends token on connect; Privacy Shield uses access token.Written for commit 27a15a7. Summary will update on new commits. Review in cubic