diff --git a/apps/studio/components/interfaces/Settings/Logs/LogSelection.tsx b/apps/studio/components/interfaces/Settings/Logs/LogSelection.tsx
index 50198dd9fab..40d9c408fdd 100644
--- a/apps/studio/components/interfaces/Settings/Logs/LogSelection.tsx
+++ b/apps/studio/components/interfaces/Settings/Logs/LogSelection.tsx
@@ -19,6 +19,7 @@ import type { LogData, QueryType } from './Logs.types'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
import { useAppStateSnapshot } from 'state/app-state'
import { useChatInputRef } from 'components/ui/AIAssistantPanel/AIAssistant'
+import { useFlag } from 'hooks/ui/useFlag'
export interface LogSelectionProps {
log?: LogData
@@ -31,6 +32,7 @@ export interface LogSelectionProps {
}
const LogSelection = ({ log, onClose, queryType, isLoading, error }: LogSelectionProps) => {
+ const logsAIShortcutEnabled = useFlag('logsaishortcut')
const LogDetails = () => {
if (error) return
if (!log) return
@@ -80,42 +82,44 @@ const LogSelection = ({ log, onClose, queryType, isLoading, error }: LogSelectio
Raw
-
-
-
-
-
-
- AI Assistant
-
- {
- setAiAssistantPanel({
- open: true,
- initialInput: `Provide a concise explanation of the following log from the Supabase ${queryType} logs. \n\`\`\`json
+ {logsAIShortcutEnabled && (
+
+
+
+
+
+
+ AI Assistant
+
+ {
+ setAiAssistantPanel({
+ open: true,
+ initialInput: `Provide a concise explanation of the following log from the Supabase ${queryType} logs. \n\`\`\`json
${JSON.stringify(log)}\n\`\`\``,
- })
- focusInput()
- }}
- >
- Explain
-
- {
- setAiAssistantPanel({
- open: true,
- initialInput: `Troubleshoot the following log from the Supabase ${queryType} logs and provide a concise step by step guide on how to fix it.\n\`\`\`json
+ })
+ focusInput()
+ }}
+ >
+ Explain
+
+ {
+ setAiAssistantPanel({
+ open: true,
+ initialInput: `Troubleshoot the following log from the Supabase ${queryType} logs and provide a concise step by step guide on how to fix it.\n\`\`\`json
${JSON.stringify(log)}
\n\`\`\``,
- })
+ })
- focusInput()
- }}
- >
- Troubleshoot
-
-
-
+ focusInput()
+ }}
+ >
+ Troubleshoot
+
+
+
+ )}