+
{snap.sqlSnippets.map((snippet: string, index: number) => (
{
newSnippets.splice(index, 1)
snap.setSqlSnippets(newSnippets)
}}
- className="text-xs"
+ className="text-xs rounded-b-none"
/>
))}
diff --git a/apps/studio/components/ui/AIAssistantPanel/AIAssistantChatSelector.tsx b/apps/studio/components/ui/AIAssistantPanel/AIAssistantChatSelector.tsx
index 1f332d3b1e2..9ced2b9cf20 100644
--- a/apps/studio/components/ui/AIAssistantPanel/AIAssistantChatSelector.tsx
+++ b/apps/studio/components/ui/AIAssistantPanel/AIAssistantChatSelector.tsx
@@ -1,4 +1,4 @@
-import { Check, Edit, MessageSquare, Plus, Trash, X } from 'lucide-react'
+import { Check, ChevronDown, Edit, MessageSquare, Plus, Trash, X } from 'lucide-react'
import { useState } from 'react'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
@@ -30,6 +30,7 @@ export const AIAssistantChatSelector = ({
disabled = false,
}: AIAssistantChatSelectorProps) => {
const snap = useAiAssistantStateSnapshot()
+ const currentChat = snap.activeChat?.name
const [chatSelectorOpen, setChatSelectorOpen] = useState(false)
const [editingChatId, setEditingChatId] = useState
(null)
@@ -91,15 +92,11 @@ export const AIAssistantChatSelector = ({
return (
- }
- className={cn('h-7 w-7', className)}
- tooltip={{ content: { side: 'bottom', text: 'View chats' } }}
- />
+ }>
+ {currentChat}
+
-
+
diff --git a/apps/studio/components/ui/AIAssistantPanel/CollapsibleCodeBlock.tsx b/apps/studio/components/ui/AIAssistantPanel/CollapsibleCodeBlock.tsx
index 92e83becffb..77a8a1e6bce 100644
--- a/apps/studio/components/ui/AIAssistantPanel/CollapsibleCodeBlock.tsx
+++ b/apps/studio/components/ui/AIAssistantPanel/CollapsibleCodeBlock.tsx
@@ -1,49 +1,47 @@
-import { ChevronDown, ChevronUp, X } from 'lucide-react'
-import { useState } from 'react'
+import { Code, X } from 'lucide-react'
-import { Button, CodeBlock, CodeBlockProps, cn } from 'ui'
+import {
+ Button,
+ CodeBlock,
+ CodeBlockProps,
+ cn,
+ HoverCard_Shadcn_,
+ HoverCardContent_Shadcn_,
+ HoverCardTrigger_Shadcn_,
+} from 'ui'
interface CollapsibleCodeBlockProps extends CodeBlockProps {
onRemove?: () => void
}
export const CollapsibleCodeBlock = ({ onRemove, ...props }: CollapsibleCodeBlockProps) => {
- const [isExpanded, setIsExpanded] = useState(false)
-
const codeString = (props.value || props.children) as string
- const firstLine = isExpanded
- ? codeString
- : codeString?.substring(0, codeString.indexOf('\n')) || codeString
+ const firstLine = codeString?.substring(0, codeString.indexOf('\n')) || codeString
return (
-
setIsExpanded(!isExpanded)}
- icon={isExpanded ? : }
- />
-
- code]:m-0 [&>code>span]:flex border-t-0 [&>code>span]:flex-wrap [&>code]:block [&>code>span]:text-foreground text-wrap whitespace-pre-wrap',
- props.className
- )}
- />
-
+
+
+
+
+ {firstLine}...
+
+
+
+
+
+
{onRemove && (
+
) {
+ const { profile } = useProfile()
const allMarkdownComponents: Partial = useMemo(
() => ({
...markdownComponents,
@@ -88,7 +91,7 @@ export const Message = function Message({
{isUser && (
-
-
-
+
)}
@@ -116,7 +121,7 @@ export const Message = function Message({
li]:pl-4 [&_ol>li]:my-0 [&_li>p]:mt-0 space-y-5 [&>*>code]:text-xs [&>*>*>code]:text-xs [&_li]:space-y-4',
+ 'prose prose-sm break-words [&>p:not(:last-child)]:!mb-2',
isUser && 'text-foreground font-semibold'
)}
remarkPlugins={[remarkGfm]}
@@ -130,14 +135,13 @@ export const Message = function Message({
const { toolCallId, toolName, args, state } = part.toolInvocation
if (state === 'call' || state === 'partial-call') {
if (shownLoadingTools.has(toolName)) {
- // Already shown loading for this toolName in this step
return null
}
shownLoadingTools.add(toolName)
return (
{`Calling ${toolName}...`}
@@ -191,7 +195,7 @@ export const Message = function Message({
})()
) : hasTextContent ? (
diff --git a/apps/studio/components/ui/QueryBlock/BlockViewConfiguration.tsx b/apps/studio/components/ui/QueryBlock/BlockViewConfiguration.tsx
index d040354cfc9..2580eea2296 100644
--- a/apps/studio/components/ui/QueryBlock/BlockViewConfiguration.tsx
+++ b/apps/studio/components/ui/QueryBlock/BlockViewConfiguration.tsx
@@ -43,7 +43,7 @@ export const BlockViewConfiguration = ({
id="help-popover-button"
type="text"
className="px-1"
- icon={ }
+ icon={ }
tooltip={{ content: { side: 'bottom', text: 'View data' } }}
/>
diff --git a/apps/studio/components/ui/QueryBlock/EditQueryButton.tsx b/apps/studio/components/ui/QueryBlock/EditQueryButton.tsx
index 545ec7eb58a..19cabf19ab1 100644
--- a/apps/studio/components/ui/QueryBlock/EditQueryButton.tsx
+++ b/apps/studio/components/ui/QueryBlock/EditQueryButton.tsx
@@ -62,7 +62,7 @@ export const EditQueryButton = ({
type={type}
size="tiny"
className={cn('w-7 h-7', className)}
- icon={ }
+ icon={ }
tooltip={tooltip}
>
@@ -75,7 +75,7 @@ export const EditQueryButton = ({
type={type}
size="tiny"
className={cn('w-7 h-7', className)}
- icon={ }
+ icon={ }
onClick={() => {
if (isInlineEditorEnabled) {
setEditorPanel({
@@ -105,7 +105,7 @@ export const EditQueryButton = ({
size="tiny"
disabled={!sql}
className={cn('w-7 h-7', className)}
- icon={ }
+ icon={ }
tooltip={!!sql ? tooltip : { content: { side: 'bottom', text: undefined } }}
/>
diff --git a/apps/studio/components/ui/QueryBlock/QueryBlock.tsx b/apps/studio/components/ui/QueryBlock/QueryBlock.tsx
index afa9fc56408..b434044f48c 100644
--- a/apps/studio/components/ui/QueryBlock/QueryBlock.tsx
+++ b/apps/studio/components/ui/QueryBlock/QueryBlock.tsx
@@ -258,7 +258,7 @@ export const QueryBlock = ({
type="text"
size="tiny"
className="w-7 h-7"
- icon={}
+ icon={}
onClick={() => setShowSql(!showSql)}
tooltip={{
content: { side: 'bottom', text: showSql ? 'Hide query' : 'Show query' },
@@ -302,7 +302,7 @@ export const QueryBlock = ({
type="text"
size="tiny"
className="w-7 h-7"
- icon={ }
+ icon={ }
loading={isExecuting || isLoading}
disabled={isLoading}
onClick={() => {
diff --git a/packages/ui-patterns/src/AssistantChat/AssistantChatForm.tsx b/packages/ui-patterns/src/AssistantChat/AssistantChatForm.tsx
index 8f37b777283..291996923b9 100644
--- a/packages/ui-patterns/src/AssistantChat/AssistantChatForm.tsx
+++ b/packages/ui-patterns/src/AssistantChat/AssistantChatForm.tsx
@@ -75,18 +75,14 @@ const AssistantChatFormComponent = React.forwardRef(
onSubmit={onSubmit}
className={cn('relative', props.className)}
>
- {icon && (
-
- {icon}
-
- )}
onValueChange(event)}
onKeyDown={handleKeyDown}