Merge pull request #1057 from buster-so/big-nate-bus-1878-collapse-reasoning-slide-out-if-no-assets-are-returned
Big nate bus 1878 collapse reasoning slide out if no assets are returned
|
@ -3,9 +3,9 @@ import { useGetChat } from '../../api/buster_rest/chats';
|
|||
|
||||
const stableHasLoadedChat = (x: IBusterChat) => !!x.id;
|
||||
export const useHasLoadedChat = ({ chatId }: { chatId: string }) => {
|
||||
const { data: hasLoadedChat } = useGetChat(
|
||||
const { data: hasLoadedChat, isFetched } = useGetChat(
|
||||
{ id: chatId },
|
||||
{ select: stableHasLoadedChat, notifyOnChangeProps: ['data'] }
|
||||
{ select: stableHasLoadedChat, notifyOnChangeProps: ['data', 'isFetched'] }
|
||||
);
|
||||
return hasLoadedChat;
|
||||
return hasLoadedChat && isFetched;
|
||||
};
|
||||
|
|
|
@ -37,8 +37,6 @@ export const DatasetHeader: React.FC<{
|
|||
setOpenNewDatasetModal(true);
|
||||
};
|
||||
|
||||
useHotkeys('d', onOpenNewDatasetModal);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex space-x-3">
|
||||
|
|
|
@ -30,6 +30,8 @@ export const NewChatInput: React.FC<{
|
|||
});
|
||||
|
||||
const onChange = useMemoizedFn((e: ChangeEvent<HTMLTextAreaElement>) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setInputValue(e.target.value);
|
||||
});
|
||||
|
||||
|
|
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 637 KiB |
After Width: | Height: | Size: 1004 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 978 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 1.0 MiB |
|
@ -1,10 +1,22 @@
|
|||
import { ClientOnly } from '@tanstack/react-router';
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
import sample from 'lodash/sample';
|
||||
import React, { lazy, Suspense, useState } from 'react';
|
||||
import { useMount } from '@/hooks/useMount';
|
||||
import { isServer } from '@/lib/window';
|
||||
import image1 from './images/image1.png';
|
||||
import image2 from './images/image2.png';
|
||||
import image3 from './images/image3.png';
|
||||
import image4 from './images/image4.png';
|
||||
import image5 from './images/image5.png';
|
||||
import image6 from './images/image6.png';
|
||||
import image7 from './images/image7.png';
|
||||
|
||||
const isProduction = import.meta.env.PROD;
|
||||
|
||||
const arrayOfImages = [image1, image2, image3, image4, image5, image6, image7];
|
||||
|
||||
const randomImage = sample(arrayOfImages);
|
||||
|
||||
// Only create lazy components if we're in the browser
|
||||
const LazyTanstackDevtools = !import.meta.env.SSR
|
||||
? lazy(() =>
|
||||
|
@ -80,7 +92,8 @@ const TanstackDevtoolsImpl: React.FC = React.memo(() => {
|
|||
position: 'bottom-left',
|
||||
hideUntilHover: true,
|
||||
defaultOpen: false,
|
||||
openHotkey: ['Shift', 'D', 'T'],
|
||||
openHotkey: ['Meta', 'D'],
|
||||
triggerImage: randomImage,
|
||||
}}
|
||||
plugins={[
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ export const TanstackDevtools: React.FC = React.memo(() => {
|
|||
console.log('🐓 Setting useDevTools to true');
|
||||
setUseDevTools(true);
|
||||
},
|
||||
{ enabled: ENABLE_TANSTACK_PANEL }
|
||||
{ enabled: ENABLE_TANSTACK_PANEL, preventDefault: true }
|
||||
);
|
||||
|
||||
if (!ENABLE_TANSTACK_PANEL || !mounted || !useDevTools) {
|
||||
|
|
|
@ -33,6 +33,8 @@ export const ChatInput: React.FC = React.memo(() => {
|
|||
});
|
||||
|
||||
const onChange = (e: ChangeEvent<HTMLTextAreaElement>) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setInputValue(e.target.value);
|
||||
};
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ export const useAutoRedirectStreaming = ({
|
|||
}) => {
|
||||
const navigate = useNavigate();
|
||||
const getChatMessageMemoized = useGetChatMessageMemoized();
|
||||
const location = useLocation();
|
||||
const isStreamFinished = useGetChatMessageCompleted({ messageId: lastMessageId });
|
||||
const lastReasoningMessageId = useGetChatMessageLastReasoningMessageId({
|
||||
messageId: lastMessageId,
|
||||
|
@ -40,7 +39,7 @@ export const useAutoRedirectStreaming = ({
|
|||
|
||||
//streaming logic to redirect
|
||||
useEffect(() => {
|
||||
if (!hasLoadedChat || !chatId || isStreamFinished) {
|
||||
if (!hasLoadedChat || !chatId) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|