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
This commit is contained in:
Nate Kelley 2025-09-22 22:56:30 -06:00 committed by GitHub
commit 4eafa95f70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 24 additions and 10 deletions

View File

@ -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;
};

View File

@ -37,8 +37,6 @@ export const DatasetHeader: React.FC<{
setOpenNewDatasetModal(true);
};
useHotkeys('d', onOpenNewDatasetModal);
return (
<>
<div className="flex space-x-3">

View File

@ -30,6 +30,8 @@ export const NewChatInput: React.FC<{
});
const onChange = useMemoizedFn((e: ChangeEvent<HTMLTextAreaElement>) => {
e.preventDefault();
e.stopPropagation();
setInputValue(e.target.value);
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -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={[
{

View File

@ -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) {

View File

@ -33,6 +33,8 @@ export const ChatInput: React.FC = React.memo(() => {
});
const onChange = (e: ChangeEvent<HTMLTextAreaElement>) => {
e.preventDefault();
e.stopPropagation();
setInputValue(e.target.value);
};

View File

@ -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;
}