@@ -4,6 +4,9 @@ import { SettingsBlock } from "../common/SettingsBlock";
44import { getApp } from "../../helpers/app" ;
55import { getDashboardState } from "apps" ;
66import { get , set } from "lodash" ;
7+ import { getParsedIframeInfo } from "../../helpers/origin" ;
8+ import { useSelector } from "react-redux" ;
9+ import { RootState } from "../../state/store" ;
710
811
912const useAppStore = getApp ( ) . useStore ( )
@@ -61,6 +64,21 @@ const downloadState = async (pageType: string) => {
6164
6265export const UserDebugTools : React . FC = ( ) => {
6366 const pageType = useAppStore ( ( state ) => state . toolContext . pageType )
67+ const isEmbedded = getParsedIframeInfo ( ) . isEmbedded as unknown === 'true'
68+ const activeThread = useSelector ( ( state : RootState ) => state . chat . threads [ state . chat . activeThread ] )
69+ const conversationID = activeThread . id
70+ // In embedded mode, just display converstaion ID
71+ if ( isEmbedded ) {
72+ return < >
73+ < VStack mb = { 4 } alignItems = { "stretch" } spacing = { 2 } width = "100%" >
74+ < Text fontSize = "2xl" fontWeight = "bold" > User Debug Tools</ Text >
75+ < Text > Tools for users to debug and look into Metabase internal workings</ Text >
76+ < SettingsBlock title = "Conversation ID" >
77+ < Text > { conversationID } </ Text >
78+ </ SettingsBlock >
79+ </ VStack >
80+ </ >
81+ }
6482 return < >
6583 < VStack mb = { 4 } alignItems = { "stretch" } spacing = { 2 } width = "100%" >
6684 < Text fontSize = "2xl" fontWeight = "bold" > User Debug Tools</ Text >
0 commit comments