From ef46214aecc96d0efe21f3a334d2756dfb4330c8 Mon Sep 17 00:00:00 2001 From: Jordi Enric <37541088+jordienr@users.noreply.github.com> Date: Mon, 31 Mar 2025 13:16:55 +0200 Subject: [PATCH 1/4] fix missing braces (#34568) fix --- apps/ui-library/content/docs/nextjs/dropzone.mdx | 8 ++------ apps/ui-library/content/docs/react-router/dropzone.mdx | 8 ++------ apps/ui-library/content/docs/react/dropzone.mdx | 8 ++------ apps/ui-library/content/docs/tanstack/dropzone.mdx | 8 ++------ 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/apps/ui-library/content/docs/nextjs/dropzone.mdx b/apps/ui-library/content/docs/nextjs/dropzone.mdx index e3e2511c435..b44046058fd 100644 --- a/apps/ui-library/content/docs/nextjs/dropzone.mdx +++ b/apps/ui-library/content/docs/nextjs/dropzone.mdx @@ -43,11 +43,7 @@ The File Upload component makes it easy to add file uploads to your app, with bu ```tsx 'use client' -import { - Dropzone, - DropzoneContent, - DropzoneEmptyState, -} from '@/components/dropzone' +import { Dropzone, DropzoneContent, DropzoneEmptyState } from '@/components/dropzone' import { useSupabaseUpload } from '@/hooks/use-supabase-upload' const FileUploadDemo = () => { @@ -69,7 +65,7 @@ const FileUploadDemo = () => { ) } -export FileUploadDemo +export { FileUploadDemo } ``` ## Props diff --git a/apps/ui-library/content/docs/react-router/dropzone.mdx b/apps/ui-library/content/docs/react-router/dropzone.mdx index d8e6acc67c6..df505f31a67 100644 --- a/apps/ui-library/content/docs/react-router/dropzone.mdx +++ b/apps/ui-library/content/docs/react-router/dropzone.mdx @@ -41,11 +41,7 @@ The File Upload component makes it easy to add file uploads to your app, with bu - For control over file upload, you can pass in a `props` object to the component. ```tsx -import { - Dropzone, - DropzoneContent, - DropzoneEmptyState, -} from '@/components/dropzone' +import { Dropzone, DropzoneContent, DropzoneEmptyState } from '@/components/dropzone' import { useSupabaseUpload } from '@/hooks/use-supabase-upload' const FileUploadDemo = () => { @@ -67,7 +63,7 @@ const FileUploadDemo = () => { ) } -export FileUploadDemo +export { FileUploadDemo } ``` ## Props diff --git a/apps/ui-library/content/docs/react/dropzone.mdx b/apps/ui-library/content/docs/react/dropzone.mdx index 8072795254b..59f39112bf1 100644 --- a/apps/ui-library/content/docs/react/dropzone.mdx +++ b/apps/ui-library/content/docs/react/dropzone.mdx @@ -41,11 +41,7 @@ The File Upload component makes it easy to add file uploads to your app, with bu - For control over file upload, you can pass in a `props` object to the component. ```tsx -import { - Dropzone, - DropzoneContent, - DropzoneEmptyState, -} from '@/components/dropzone' +import { Dropzone, DropzoneContent, DropzoneEmptyState } from '@/components/dropzone' import { useSupabaseUpload } from '@/hooks/use-supabase-upload' const FileUploadDemo = () => { @@ -67,7 +63,7 @@ const FileUploadDemo = () => { ) } -export FileUploadDemo +export { FileUploadDemo } ``` ## Props diff --git a/apps/ui-library/content/docs/tanstack/dropzone.mdx b/apps/ui-library/content/docs/tanstack/dropzone.mdx index 90e1a47e714..024244b5c83 100644 --- a/apps/ui-library/content/docs/tanstack/dropzone.mdx +++ b/apps/ui-library/content/docs/tanstack/dropzone.mdx @@ -41,11 +41,7 @@ The File Upload component makes it easy to add file uploads to your app, with bu - For control over file upload, you can pass in a `props` object to the component. ```tsx -import { - Dropzone, - DropzoneContent, - DropzoneEmptyState, -} from '@/components/dropzone' +import { Dropzone, DropzoneContent, DropzoneEmptyState } from '@/components/dropzone' import { useSupabaseUpload } from '@/hooks/use-supabase-upload' const FileUploadDemo = () => { @@ -67,7 +63,7 @@ const FileUploadDemo = () => { ) } -export FileUploadDemo +export { FileUploadDemo } ``` ## Props From 8239e2f27b967537219549c6ef5c813a427aebeb Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 31 Mar 2025 19:24:21 +0800 Subject: [PATCH 2/4] Cache results in assistant panel (#34509) * Cache results in assistant panel * Small fixes * fix * disable switching chats while new messages are streaming in * small comment * Fix Create new snippet CTA in query block * Add useCallbacks * Update * Remove console log --------- Co-authored-by: Alaister Young --- .../layouts/AppLayout/AssistantButton.tsx | 3 ++ .../layouts/AppLayout/InlineEditorButton.tsx | 5 +- .../layouts/ProjectLayout/ProjectLayout.tsx | 7 +-- .../ui/AIAssistantPanel/AIAssistant.tsx | 41 +++++++++++++- .../ui/AIAssistantPanel/AIAssistant.types.ts | 1 + .../AIAssistantChatSelector.tsx | 11 +++- .../ui/AIAssistantPanel/Message.tsx | 25 +++++++-- .../ui/AIAssistantPanel/MessageMarkdown.tsx | 54 +++++++++++++++++-- .../ui/QueryBlock/EditQueryButton.tsx | 25 ++++----- .../components/ui/QueryBlock/QueryBlock.tsx | 26 ++++----- apps/studio/pages/api/ai/sql/generate-v3.ts | 3 +- apps/studio/state/ai-assistant-state.tsx | 36 ++++++++++++- 12 files changed, 191 insertions(+), 46 deletions(-) diff --git a/apps/studio/components/layouts/AppLayout/AssistantButton.tsx b/apps/studio/components/layouts/AppLayout/AssistantButton.tsx index 8540c6087ff..0fbdbd187dd 100644 --- a/apps/studio/components/layouts/AppLayout/AssistantButton.tsx +++ b/apps/studio/components/layouts/AppLayout/AssistantButton.tsx @@ -1,8 +1,10 @@ import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state' +import { useAppStateSnapshot } from 'state/app-state' import { AiIconAnimation, Button } from 'ui' const AssistantButton = () => { const snap = useAiAssistantStateSnapshot() + const { setEditorPanel } = useAppStateSnapshot() return (