diff --git a/web/playwright-tests/pie-styling-updates.spec.ts b/web/playwright-tests/pie-styling-updates.spec.ts index 4fb7fcfed..b8ccec8b9 100644 --- a/web/playwright-tests/pie-styling-updates.spec.ts +++ b/web/playwright-tests/pie-styling-updates.spec.ts @@ -64,7 +64,7 @@ test.describe.serial('Pie chart styling updates', async () => { await page.getByTestId('edit-chart-button').getByRole('button').click(); await page.waitForTimeout(255); await page.getByTestId('edit-chart-button').getByRole('button').click(); - await page.waitForTimeout(55); + await page.waitForTimeout(255); await page.getByTestId('segmented-trigger-results').click(); await page.waitForTimeout(555); await page.waitForLoadState('networkidle'); @@ -75,7 +75,11 @@ test.describe.serial('Pie chart styling updates', async () => { await expect(page.getByRole('textbox', { name: 'New chart' })).toHaveValue( 'Top 10 Products by Revenue (Last 4 Quarters)' ); + await page.waitForTimeout(555); await page.getByTestId('edit-chart-button').getByRole('button').click(); + await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); + await page.waitForLoadState('load'); await expect(page.getByText('Edit chart')).toBeVisible(); await page .locator('div') diff --git a/web/src/layouts/ChatLayout/ChatLayout/ChatLayout.tsx b/web/src/layouts/ChatLayout/ChatLayout/ChatLayout.tsx index 7d5323755..69d9ef71f 100644 --- a/web/src/layouts/ChatLayout/ChatLayout/ChatLayout.tsx +++ b/web/src/layouts/ChatLayout/ChatLayout/ChatLayout.tsx @@ -8,6 +8,9 @@ import { ChatLayoutContextProvider, useChatLayoutContext } from '../ChatLayoutCo import { ChatContextProvider } from '../ChatContext/ChatContext'; import { DEFAULT_CHAT_OPTION_SIDEBAR_SIZE } from '../ChatLayoutContext/config'; import { useMount } from '@/hooks'; +import { useHotkeys } from 'react-hotkeys-hook'; +import { CREATE_LANGFUSE_SESSION_URL } from '@/routes/externalRoutes'; +import { useBusterNotifications } from '@/context/BusterNotifications'; interface ChatSplitterProps { children?: React.ReactNode; @@ -15,6 +18,7 @@ interface ChatSplitterProps { export const ChatLayout: React.FC = ({ children }) => { const appSplitterRef = useRef(null); + const { openErrorNotification } = useBusterNotifications(); const [mounted, setMounted] = useState(false); const chatLayoutProps = useChatLayoutContext({ appSplitterRef }); @@ -30,6 +34,23 @@ export const ChatLayout: React.FC = ({ children }) => { setMounted(true); //we need to wait for the app splitter to be mounted because this is nested in the app splitter }); + useHotkeys( + 'meta+l', + (e) => { + e.stopPropagation(); + const chatId = chatLayoutProps.chatId; + if (!chatId) { + openErrorNotification('No chat id found'); + return; + } + const link = CREATE_LANGFUSE_SESSION_URL(chatId); + window.open(link, '_blank'); + }, + { + preventDefault: true + } + ); + return ( diff --git a/web/src/routes/externalRoutes.ts b/web/src/routes/externalRoutes.ts index 295d3db77..c55d9f8bc 100644 --- a/web/src/routes/externalRoutes.ts +++ b/web/src/routes/externalRoutes.ts @@ -2,3 +2,5 @@ export const BUSTER_HOME_PAGE = 'https://buster.so'; export const BUSTER_DOCS_URL = 'https://docs.buster.so'; export const BUSTER_GETTING_STARTED_URL = 'https://www.buster.so/get-started'; export const BUSTER_DOCS_QUICKSTART = 'https://docs.buster.so/docs/getting-started/quickstart'; +export const CREATE_LANGFUSE_SESSION_URL = (chatId: string) => + `https://us.cloud.langfuse.com/project/clt828pud00004hn8abr822q8/sessions/${chatId}`;