Skip to content

Commit

Permalink
fix(toolkit): add loading screens and fix issues with code snippet (#662
Browse files Browse the repository at this point in the history
)

* fix(toolkit): add loading screens and fix issues with code snippet

* fix(toolkit): add loading screens and fix issues with code snippet
  • Loading branch information
knajjars authored Aug 15, 2024
1 parent 5f4acda commit 1c0fc8e
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/interfaces/assistants_web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"yarn": "9999"
},
"scripts": {
"dev": "next dev --port 4444 --turbo",
"dev": "next dev --port 4444",
"build": "next build",
"lint": "next lint",
"ts-lint": "tsc -noEmit -incremental -watch",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Chat: React.FC<{ agentId?: string; conversationId?: string }> = ({
if (conversationId) {
setConversation({ id: conversationId });
}
}, []);
}, [agent, tools, conversation]);

useEffect(() => {
if (!conversation) return;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Spinner } from '@/components/Shared';

const Loading: React.FC<React.PropsWithChildren> = () => {
return (
<div className="flex h-screen w-full items-center justify-center bg-marble-980 dark:bg-volcanic-150">
<Spinner className="h-10 w-10" />
</div>
);
};

export default Loading;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Spinner } from '@/components/Shared';

const Loading: React.FC<React.PropsWithChildren> = () => {
return (
<div className="flex h-screen w-full items-center justify-center bg-marble-980 dark:bg-volcanic-150">
<Spinner className="h-10 w-10" />
</div>
);
};

export default Loading;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Spinner } from '@/components/Shared';

const Loading: React.FC<React.PropsWithChildren> = () => {
return (
<div className="flex h-screen w-full items-center justify-center bg-marble-980 dark:bg-volcanic-150">
<Spinner className="h-10 w-10" />
</div>
);
};

export default Loading;
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ChatLayout: React.FC<React.PropsWithChildren> = ({ children }) => {
as="div"
className={cn(
'border-marble-950 bg-marble-980 px-6 dark:border-volcanic-200 dark:bg-volcanic-100',
'absolute inset-0 flex-shrink-0 rounded-lg border lg:static lg:w-[360px] lg:rounded-none lg:rounded-r-lg lg:border-y lg:border-l-0 lg:border-r'
'absolute inset-0 rounded-lg border lg:static lg:w-[360px] lg:rounded-none lg:rounded-r-lg lg:border-y lg:border-l-0 lg:border-r'
)}
enter="transition-all transform ease-in-out duration-300"
enterFrom="translate-x-full"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const DeleteAgent: React.FC<Props> = ({ name, agentId, onClose }) => {
onClick={handleDeleteAgent}
disabled={isPending}
icon="arrow-right"
theme="danger"
theme="coral"
iconPosition="end"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ type Props = {};

const RightPanel: React.FC<Props> = () => {
const [isDeletingFile, setIsDeletingFile] = useState(false);
const { disabledAssistantKnowledge, setRightPanelOpen } =
useSettingsStore();
const { disabledAssistantKnowledge, setRightPanelOpen } = useSettingsStore();
const { agentId, conversationId } = useChatRoutes();
const { data: agent } = useAgent({ agentId });
const { theme } = useBrandedColors(agentId);
Expand Down
6 changes: 1 addition & 5 deletions src/interfaces/assistants_web/src/context/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import { ModalContext, ModalProvider } from '@/context/ModalContext';
export const ContextStore: React.FC<{
children: React.ReactNode;
}> = ({ children }) => {
return (
<ModalProvider>
{children}
</ModalProvider>
);
return <ModalProvider>{children}</ModalProvider>;
};

export const useContextStore = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/assistants_web/src/hooks/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export const useChat = (config?: { onSend?: (msg: string) => void }) => {
documentsMap = { ...documentsMap, ...newDocumentsMap };
outputFiles = { ...outputFiles, ...newOutputFilesMap };
saveOutputFiles({ ...savedOutputFiles, ...outputFiles });

// we are only interested in web_search results
// ignore search results of pyhton interpreter tool
if (
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/assistants_web/src/styles/code-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
.hljs-function,
.hljs-symbol,
.hljs-bullet {
color: #990073;
color: #e074fb;
}

.hljs-built_in {
Expand Down

0 comments on commit 1c0fc8e

Please sign in to comment.